Skip to contents

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\).

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 \(r^{2}_{p}\).

vcov

Sampling variance-covariance matrix of \(r^{2}_{p}\).

est

Vector of estimated \(r^{2}_{p}\).

fun

Function used ("PCorMC").

Details

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

See also

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

Author

Ivan Jacob Agaloos Pesigan

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)
#> Call:
#> PCorMC(object = mc, alpha = 0.05)
#> 
#> Squared partial correlations
#> type = "hc3"
#>            est     se   R   2.5%  97.5%
#> NARTIC  0.4874 0.1228 100 0.1690 0.6040
#> PCTGRT  0.3757 0.1085 100 0.1102 0.5049
#> PCTSUPP 0.2254 0.1035 100 0.0274 0.4129
summary(out)
#> Call:
#> PCorMC(object = mc, alpha = 0.05)
#> 
#> Squared partial correlations
#> type = "hc3"
#>            est     se   R   2.5%  97.5%
#> NARTIC  0.4874 0.1228 100 0.1690 0.6040
#> PCTGRT  0.3757 0.1085 100 0.1102 0.5049
#> PCTSUPP 0.2254 0.1035 100 0.0274 0.4129
coef(out)
#>    NARTIC    PCTGRT   PCTSUPP 
#> 0.4874382 0.3757383 0.2253739 
vcov(out)
#>              NARTIC      PCTGRT     PCTSUPP
#> NARTIC  0.015070964 0.005353598 0.002240937
#> PCTGRT  0.005353598 0.011763713 0.001066046
#> PCTSUPP 0.002240937 0.001066046 0.010704482
confint(out, level = 0.95)
#>             2.5 %    97.5 %
#> NARTIC  0.1689777 0.6039797
#> PCTGRT  0.1102259 0.5049136
#> PCTSUPP 0.0273768 0.4128501