Package 'betaMC'

Title: Monte Carlo for Regression Effect Sizes
Description: Generates Monte Carlo confidence intervals for standardized regression coefficients (beta) and other effect sizes, including multiple correlation, semipartial correlations, improvement in R-squared, squared partial correlations, and differences in standardized regression coefficients, for models fitted by lm(). 'betaMC' combines ideas from Monte Carlo confidence intervals for the indirect effect (Pesigan and Cheung, 2023 <doi:10.3758/s13428-023-02114-4>) and the sampling covariance matrix of regression coefficients (Dudgeon, 2017 <doi:10.1007/s11336-017-9563-z>) to generate confidence intervals effect sizes in regression.
Authors: Ivan Jacob Agaloos Pesigan [aut, cre, cph]
Maintainer: Ivan Jacob Agaloos Pesigan <[email protected]>
License: MIT + file LICENSE
Version: 1.3.2.9000
Built: 2024-11-21 05:51:29 UTC
Source: https://github.com/jeksterslab/betaMC

Help Index


Estimate Standardized Regression Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Standardized Regression Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

BetaMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

The vector of standardized regression coefficients (β^\boldsymbol{\hat{\beta}}) is derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of β^\boldsymbol{\hat{\beta}}, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of β^\boldsymbol{\hat{\beta}}.

vcov

Sampling variance-covariance matrix of β^\boldsymbol{\hat{\beta}}.

est

Vector of estimated β^\boldsymbol{\hat{\beta}}.

fun

Function used ("BetaMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: DeltaRSqMC(), DiffBetaMC(), MC(), MCMI(), PCorMC(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# BetaMC -------------------------------------------------------------------
out <- BetaMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimated Parameter Method for an Object of Class betamc

Description

Estimated Parameter Method for an Object of Class betamc

Usage

## S3 method for class 'betamc'
coef(object, ...)

Arguments

object

Object of Class betamc, that is, the output of the BetaMC(), RSqMC(), SCorMC(), DeltaRSqMC(), PCorMC(), or DiffBetaMC() functions.

...

additional arguments.

Value

Returns a vector of estimated parameters.

Author(s)

Ivan Jacob Agaloos Pesigan


Confidence Intervals Method for an Object of Class betamc

Description

Confidence Intervals Method for an Object of Class betamc

Usage

## S3 method for class 'betamc'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

Object of Class betamc, that is, the output of the BetaMC(), RSqMC(), SCorMC(), DeltaRSqMC(), PCorMC(), or DiffBetaMC() functions.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

...

additional arguments.

Value

Returns a matrix of confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Improvement in R-Squared and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

DeltaRSqMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

The vector of improvement in R-squared (ΔR2\Delta R^{2}) is derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of ΔR2\Delta R^{2}, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of ΔR2\Delta R^{2}.

vcov

Sampling variance-covariance matrix of ΔR2\Delta R^{2}.

est

Vector of estimated ΔR2\Delta R^{2}.

fun

Function used ("DeltaRSqMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: BetaMC(), DiffBetaMC(), MC(), MCMI(), PCorMC(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# DeltaRSqMC ---------------------------------------------------------------
out <- DeltaRSqMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimate Differences of Standardized Slopes and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Differences of Standardized Slopes and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

DiffBetaMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

The vector of differences of standardized regression slopes is derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of differences of standardized regression slopes, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of differences of standardized regression slopes.

vcov

Sampling variance-covariance matrix of differences of standardized regression slopes.

est

Vector of estimated differences of standardized regression slopes.

fun

Function used ("DiffBetaMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), MC(), MCMI(), PCorMC(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# DiffBetaMC ---------------------------------------------------------------
out <- DiffBetaMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Generate the Sampling Distribution of Regression Parameters Using the Monte Carlo Method

Description

Generate the Sampling Distribution of Regression Parameters Using the Monte Carlo Method

Usage

MC(
  object,
  R = 20000L,
  type = "hc3",
  g1 = 1,
  g2 = 1.5,
  k = 0.7,
  decomposition = "eigen",
  pd = TRUE,
  tol = 1e-06,
  fixed_x = FALSE,
  seed = NULL
)

Arguments

object

Object of class lm.

R

Positive integer. Number of Monte Carlo replications.

type

Character string. Sampling covariance matrix type. Possible values are "mvn", "adf", "hc0", "hc1", "hc2", "hc3", "hc4", "hc4m", and "hc5". type = "mvn" uses the normal-theory sampling covariance matrix. type = "adf" uses the asymptotic distribution-free sampling covariance matrix. type = "hc0" through "hc5" uses different versions of heteroskedasticity-consistent sampling covariance matrix.

g1

Numeric. g1 value for type = "hc4m".

g2

Numeric. g2 value for type = "hc4m".

k

Numeric. Constant for type = "hc5"

decomposition

Character string. Matrix decomposition of the sampling variance-covariance matrix for the data generation. If decomposition = "chol", use Cholesky decomposition. If decomposition = "eigen", use eigenvalue decomposition. If decomposition = "svd", use singular value decomposition.

pd

Logical. If pd = TRUE, check if the sampling variance-covariance matrix is positive definite using tol.

tol

Numeric. Tolerance used for pd.

fixed_x

Logical. If fixed_x = TRUE, treat the regressors as fixed. If fixed_x = FALSE, treat the regressors as random.

seed

Integer. Seed number for reproducibility.

Details

Let the parameter vector of the unstandardized regression model be given by

θ={b,σ2,vech(ΣXX)}\boldsymbol{\theta} = \left\{ \mathbf{b}, \sigma^{2}, \mathrm{vech} \left( \boldsymbol{\Sigma}_{\mathbf{X}\mathbf{X}} \right) \right\}

where b\mathbf{b} is the vector of regression slopes, σ2\sigma^{2} is the error variance, and vech(ΣXX)\mathrm{vech} \left( \boldsymbol{\Sigma}_{\mathbf{X}\mathbf{X}} \right) is the vector of unique elements of the covariance matrix of the regressor variables. The empirical sampling distribution of θ\boldsymbol{\theta} is generated using the Monte Carlo method, that is, random values of parameter estimates are sampled from the multivariate normal distribution using the estimated parameter vector as the mean vector and the specified sampling covariance matrix using the type argument as the covariance matrix. A replacement sampling approach is implemented to ensure that the model-implied covariance matrix is positive definite.

Value

Returns an object of class mc which is a list with the following elements:

call

Function call.

args

Function arguments.

lm_process

Processed lm object.

scale

Sampling variance-covariance matrix of parameter estimates.

location

Parameter estimates.

thetahatstar

Sampling distribution of parameter estimates.

fun

Function used ("MC").

Author(s)

Ivan Jacob Agaloos Pesigan

References

Dudgeon, P. (2017). Some improvements in confidence intervals for standardized regression coefficients. Psychometrika, 82(4), 928–951. doi:10.1007/s11336-017-9563-z

MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence limits for the indirect effect: Distribution of the product and resampling methods. Multivariate Behavioral Research, 39(1), 99-128. doi:10.1207/s15327906mbr3901_4

Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo confidence intervals for the indirect effect with missing data. Behavior Research Methods. doi:10.3758/s13428-023-02114-4

Preacher, K. J., & Selig, J. P. (2012). Advantages of Monte Carlo confidence intervals for indirect effects. Communication Methods and Measures, 6(2), 77–98. doi:10.1080/19312458.2012.679848

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MCMI(), PCorMC(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)
mc
# The `mc` object can be passed as the first argument
# to the following functions
#   - BetaMC
#   - DeltaRSqMC
#   - DiffBetaMC
#   - PCorMC
#   - RSqMC
#   - SCorMC

Generate the Sampling Distribution of Regression Parameters Using the Monte Carlo Method for Data with Missing Values

Description

Generate the Sampling Distribution of Regression Parameters Using the Monte Carlo Method for Data with Missing Values

Usage

MCMI(
  object,
  mi,
  R = 20000L,
  type = "hc3",
  g1 = 1,
  g2 = 1.5,
  k = 0.7,
  decomposition = "eigen",
  pd = TRUE,
  tol = 1e-06,
  fixed_x = FALSE,
  seed = NULL
)

Arguments

object

Object of class lm.

mi

Object of class mids (output of mice::mice()), object of class amelia (output of Amelia::amelia()), or a list of multiply imputed data sets.

R

Positive integer. Number of Monte Carlo replications.

type

Character string. Sampling covariance matrix type. Possible values are "mvn", "adf", "hc0", "hc1", "hc2", "hc3", "hc4", "hc4m", and "hc5". type = "mvn" uses the normal-theory sampling covariance matrix. type = "adf" uses the asymptotic distribution-free sampling covariance matrix. type = "hc0" through "hc5" uses different versions of heteroskedasticity-consistent sampling covariance matrix.

g1

Numeric. g1 value for type = "hc4m".

g2

Numeric. g2 value for type = "hc4m".

k

Numeric. Constant for type = "hc5"

decomposition

Character string. Matrix decomposition of the sampling variance-covariance matrix for the data generation. If decomposition = "chol", use Cholesky decomposition. If decomposition = "eigen", use eigenvalue decomposition. If decomposition = "svd", use singular value decomposition.

pd

Logical. If pd = TRUE, check if the sampling variance-covariance matrix is positive definite using tol.

tol

Numeric. Tolerance used for pd.

fixed_x

Logical. If fixed_x = TRUE, treat the regressors as fixed. If fixed_x = FALSE, treat the regressors as random.

seed

Integer. Seed number for reproducibility.

Details

Multiple imputation is used to deal with missing values in a data set. The vector of parameter estimates and the corresponding sampling covariance matrix are estimated for each of the imputed data sets. Results are combined to arrive at the pooled vector of parameter estimates and the corresponding sampling covariance matrix. The pooled estimates are then used to generate the sampling distribution of regression parameters. See MC() for more details on the Monte Carlo method.

Value

Returns an object of class mc which is a list with the following elements:

call

Function call.

args

Function arguments.

lm_process

Processed lm object.

scale

Sampling variance-covariance matrix of parameter estimates.

location

Parameter estimates.

thetahatstar

Sampling distribution of parameter estimates.

fun

Function used ("MCMI").

Author(s)

Ivan Jacob Agaloos Pesigan

References

Dudgeon, P. (2017). Some improvements in confidence intervals for standardized regression coefficients. Psychometrika, 82(4), 928–951. doi:10.1007/s11336-017-9563-z

MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence limits for the indirect effect: Distribution of the product and resampling methods. Multivariate Behavioral Research, 39(1), 99-128. doi:10.1207/s15327906mbr3901_4

Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo confidence intervals for the indirect effect with missing data. Behavior Research Methods. doi:10.3758/s13428-023-02114-4

Preacher, K. J., & Selig, J. P. (2012). Advantages of Monte Carlo confidence intervals for indirect effects. Communication Methods and Measures, 6(2), 77–98. doi:10.1080/19312458.2012.679848

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MC(), PCorMC(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")
nas1982_missing <- mice::ampute(nas1982)$amp # data set with missing values

# Multiple Imputation
mi <- mice::mice(nas1982_missing, m = 5, seed = 42, print = FALSE)

# Fit Model in lm ----------------------------------------------------------
## Note that this does not deal with missing values.
## The fitted model (`object`) is updated with each imputed data
## within the `MCMI()` function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982_missing)

# Monte Carlo --------------------------------------------------------------
mc <- MCMI(
  object,
  mi = mi,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)
mc
# The `mc` object can be passed as the first argument
# to the following functions
#   - BetaMC
#   - DeltaRSqMC
#   - DiffBetaMC
#   - PCorMC
#   - RSqMC
#   - SCorMC

1982 National Academy of Sciences Doctoral Programs Data

Description

1982 National Academy of Sciences Doctoral Programs Data

Usage

nas1982

Format

Ratings of 46 doctoral programs in psychology in the USA with the following variables:

QUALITY

Program quality ratings.

NFACUL

Number of faculty members in the program.

NGRADS

Number of program graduates.

PCTSUPP

Percentage of program graduates who received support.

PCTGRT

Percent of faculty members holding research grants.

NARTIC

Number of published articles attributed to program faculty member.

PCTPUB

Percent of faculty with one or more published article.

References

National Research Council. (1982). An assessment of research-doctorate programs in the United States: Social and behavioral sciences. doi:10.17226/9781. Reproduced with permission from the National Academy of Sciences, Courtesy of the National Academies Press, Washington, D.C.


Estimate Squared Partial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Squared Partial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

PCorMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

The vector of squared partial correlation coefficients (rp2r^{2}_{p}) is derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of rp2r^{2}_{p}, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of rp2r^{2}_{p}.

vcov

Sampling variance-covariance matrix of rp2r^{2}_{p}.

est

Vector of estimated rp2r^{2}_{p}.

fun

Function used ("PCorMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MC(), MCMI(), RSqMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# PCorMC -------------------------------------------------------------------
out <- PCorMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Print Method for an Object of Class betamc

Description

Print Method for an Object of Class betamc

Usage

## S3 method for class 'betamc'
print(x, alpha = NULL, digits = 4, ...)

Arguments

x

Object of Class betamc, that is, the output of the BetaMC(), RSqMC(), SCorMC(), DeltaRSqMC(), PCorMC(), or DiffBetaMC() functions.

alpha

Numeric vector. Significance level α\alpha. If alpha = NULL, use the argument alpha used in x.

digits

Digits to print.

...

additional arguments.

Value

Prints a matrix of estimates, standard errors, number of Monte Carlo replications, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Print Method for an Object of Class mc

Description

Print Method for an Object of Class mc

Usage

## S3 method for class 'mc'
print(x, ...)

Arguments

x

Object of Class mc.

...

additional arguments.

Value

Prints the first set of simulated parameter estimates and model-implied covariance matrix.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)
mc <- MC(object, R = 100)
print(mc)

Estimate Multiple Correlation Coefficients (R-Squared and Adjusted R-Squared) and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Multiple Correlation Coefficients (R-Squared and Adjusted R-Squared) and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

RSqMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

R-squared (R2R^{2}) and adjusted R-squared (Rˉ2\bar{R}^{2}) are derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of R2R^{2} and Rˉ2\bar{R}^{2}, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of R2R^{2} and Rˉ2\bar{R}^{2}.

vcov

Sampling variance-covariance matrix of R2R^{2} and Rˉ2\bar{R}^{2}.

est

Vector of estimated R2R^{2} and Rˉ2\bar{R}^{2}.

fun

Function used ("RSqMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MC(), MCMI(), PCorMC(), SCorMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# RSqMC --------------------------------------------------------------------
out <- RSqMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Estimate Semipartial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Description

Estimate Semipartial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

SCorMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level α\alpha.

Details

The vector of semipartial correlation coefficients (rsr_{s}) is derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to 100(1α)%100(1 - \alpha)\% from the generated sampling distribution of rsr_{s}, where α\alpha is the significance level.

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of rsr_{s}.

vcov

Sampling variance-covariance matrix of rsr_{s}.

est

Vector of estimated rsr_{s}.

fun

Function used ("SCorMC").

Author(s)

Ivan Jacob Agaloos Pesigan

See Also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MC(), MCMI(), PCorMC(), RSqMC()

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# SCorMC -------------------------------------------------------------------
out <- SCorMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
summary(out)
coef(out)
vcov(out)
confint(out, level = 0.95)

Summary Method for an Object of Class betamc

Description

Summary Method for an Object of Class betamc

Usage

## S3 method for class 'betamc'
summary(object, alpha = NULL, digits = 4, ...)

Arguments

object

Object of Class betamc, that is, the output of the BetaMC(), RSqMC(), SCorMC(), DeltaRSqMC(), PCorMC(), or DiffBetaMC() functions.

alpha

Numeric vector. Significance level α\alpha. If alpha = NULL, use the argument alpha used in object.

digits

Digits to print.

...

additional arguments.

Value

Returns a matrix of estimates, standard errors, number of Monte Carlo replications, and confidence intervals.

Author(s)

Ivan Jacob Agaloos Pesigan


Summary Method for an Object of Class mc

Description

Summary Method for an Object of Class mc

Usage

## S3 method for class 'mc'
summary(object, digits = 4, ...)

Arguments

object

Object of Class mc, that is, the output of the MC() function.

digits

Digits to print.

...

additional arguments.

Value

Returns a list with the following elements:

mean

Mean of the sampling distribution of θ^\boldsymbol{\hat{\theta}}.

var

Variance of the sampling distribution of θ^\boldsymbol{\hat{\theta}}.

bias

Monte Carlo simulation bias.

rmse

Monte Carlo simulation root mean square error.

location

Location parameter used in the Monte Carlo simulation.

scale

Scale parameter used in the Monte Carlo simulation.

Author(s)

Ivan Jacob Agaloos Pesigan

Examples

# Fit the regression model
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)
mc <- MC(object, R = 100)
summary(mc)

Sampling Variance-Covariance Matrix Method for an Object of Class betamc

Description

Sampling Variance-Covariance Matrix Method for an Object of Class betamc

Usage

## S3 method for class 'betamc'
vcov(object, ...)

Arguments

object

Object of Class betamc, that is, the output of the BetaMC(), RSqMC(), SCorMC(), DeltaRSqMC(), PCorMC(), or DiffBetaMC() functions.

...

additional arguments.

Value

Returns the variance-covariance matrix of estimates.

Author(s)

Ivan Jacob Agaloos Pesigan