Estimate Semipartial Correlation Coefficients and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method
Source:R/betaMC-s-cor-mc.R
SCorMC.RdEstimate 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 theMC()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_{s}\).
- vcov
Sampling variance-covariance matrix of \(r_{s}\).
- est
Vector of estimated \(r_{s}\).
- fun
Function used ("SCorMC").
Details
The vector of semipartial correlation coefficients (\(r_{s}\)) 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_{s}\), where \(\alpha\) is the significance level.
See also
Other Beta Monte Carlo Functions:
BetaMC(),
DeltaRSqMC(),
DiffBetaMC(),
FSqMC(),
MC(),
MCMI(),
PCorMC(),
RSqMC(),
SCorSqMC()
Examples
# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")
# Fit Model in lm ----------------------------------------------------------
object <- stats::lm(
formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP,
data = nas1982
)
# MC -----------------------------------------------------------------------
mc <- MC(
object = object,
R = 100, # use a large value e.g., 20000L for actual research
seed = 0508
)
# SCorMC -------------------------------------------------------------------
out <- SCorMC(object = mc, alpha = 0.05)
## Methods -----------------------------------------------------------------
print(x = out)
#> Call:
#> SCorMC(object = mc, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "hc3"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0904 100 0.2101 0.5414
#> PCTGRT 0.3430 0.0883 100 0.1165 0.4722
#> PCTSUPP 0.2385 0.0660 100 0.1155 0.3567
summary(object = out)
#> Call:
#> SCorMC(object = mc, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "hc3"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0904 100 0.2101 0.5414
#> PCTGRT 0.3430 0.0883 100 0.1165 0.4722
#> PCTSUPP 0.2385 0.0660 100 0.1155 0.3567
coef(object = out)
#> NARTIC PCTGRT PCTSUPP
#> 0.4311525 0.3430075 0.2384789
vcov(object = out)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0081718086 1.533084e-03 -1.363309e-04
#> PCTGRT 0.0015330842 7.803924e-03 3.933106e-05
#> PCTSUPP -0.0001363309 3.933106e-05 4.350514e-03
confint(object = out, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.2101302 0.5414426
#> PCTGRT 0.1164884 0.4722133
#> PCTSUPP 0.1154947 0.3566907