betaMC: Example Using the SCorMC Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-s-cor-mc.Rmd
example-s-cor-mc.Rmd
Confidence intervals for semipartial correlation coefficients are
generated using the SCorMC()
function from the
betaMC
package. In this example, we use the data set and
the model used in betaMC: Example Using
the BetaMC Function.
df <- betaMC::nas1982
Regression
Fit the regression model using the lm()
function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
Monte Carlo Sampling Distribution of Parameters
Normal-Theory Approach
mvn <- MC(object, type = "mvn")
Asymptotic distribution-free Approach
adf <- MC(object, type = "adf")
Heteroskedasticity Consistent Approach (HC3)
hc3 <- MC(object, type = "hc3")
Semipartial Correlation Coefficients
Normal-Theory Approach
mvn <- SCorMC(mvn)
Asymptotic distribution-free Approach
adf <- SCorMC(adf)
Heteroskedasticity Consistent Approach (HC3)
hc3 <- SCorMC(hc3)
Methods
summary
Summary of the results of SCorMC()
.
summary(mvn)
#> Call:
#> SCorMC(object = mvn)
#>
#> Semipartial correlations
#> type = "mvn"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4312 0.0771 20000 0.1836 0.2291 0.2719 0.5722 0.6260 0.6888
#> PCTGRT 0.3430 0.0734 20000 0.1112 0.1545 0.1943 0.4825 0.5330 0.5784
#> PCTSUPP 0.2385 0.0700 20000 0.0262 0.0673 0.1028 0.3783 0.4359 0.4887
summary(adf)
#> Call:
#> SCorMC(object = adf)
#>
#> Semipartial correlations
#> type = "adf"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4312 0.0707 20000 0.0893 0.2105 0.2707 0.5476 0.5922 0.6456
#> PCTGRT 0.3430 0.0709 20000 0.0766 0.1453 0.1916 0.4688 0.5152 0.5804
#> PCTSUPP 0.2385 0.0697 20000 0.0013 0.0502 0.0951 0.3688 0.4170 0.4716
summary(hc3)
#> Call:
#> SCorMC(object = hc3)
#>
#> Semipartial correlations
#> type = "hc3"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4312 0.0863 20000 0.0551 0.1480 0.2241 0.5685 0.6203 0.6857
#> PCTGRT 0.3430 0.0821 20000 0.0456 0.1036 0.1630 0.4840 0.5430 0.6027
#> PCTSUPP 0.2385 0.0788 20000 -0.0418 0.0266 0.0792 0.3902 0.4456 0.5160
vcov
Return the sampling covariance matrix.
vcov(mvn)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0059396222 -0.0012894115 -0.0008667068
#> PCTGRT -0.0012894115 0.0053818999 -0.0006991077
#> PCTSUPP -0.0008667068 -0.0006991077 0.0048956256
vcov(adf)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0049939665 0.0002605552 -0.0003686549
#> PCTGRT 0.0002605552 0.0050259666 -0.0005947590
#> PCTSUPP -0.0003686549 -0.0005947590 0.0048520808
vcov(hc3)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0074450889 0.0006620586 -0.0001435567
#> PCTGRT 0.0006620586 0.0067474631 -0.0005242356
#> PCTSUPP -0.0001435567 -0.0005242356 0.0062043043
confint
Return confidence intervals.
confint(mvn, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.2719481 0.5721936
#> PCTGRT 0.1943133 0.4825255
#> PCTSUPP 0.1027590 0.3783105
confint(adf, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.27071131 0.5475904
#> PCTGRT 0.19156579 0.4687980
#> PCTSUPP 0.09507793 0.3688376
confint(hc3, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.22405462 0.5684939
#> PCTGRT 0.16300705 0.4840342
#> PCTSUPP 0.07924023 0.3902249
References
Dudgeon, P. (2017). Some improvements in confidence intervals for
standardized regression coefficients. Psychometrika,
82(4), 928–951. https://doi.org/10.1007/s11336-017-9563-z
Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo
confidence intervals for the indirect effect with missing data.
Behavior Research Methods, 56(3), 1678–1696. https://doi.org/10.3758/s13428-023-02114-4