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.0770 20000 0.1705 0.2285 0.2707 0.5723 0.6244 0.6898
#> PCTGRT 0.3430 0.0744 20000 0.1191 0.1573 0.1947 0.4857 0.5435 0.6031
#> PCTSUPP 0.2385 0.0701 20000 0.0265 0.0644 0.1013 0.3770 0.4287 0.4858
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.2103 0.2706 0.5477 0.5924 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.3689 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.0860 20000 0.0553 0.1454 0.2258 0.5654 0.6173 0.6797
#> PCTGRT 0.3430 0.0832 20000 0.0490 0.1077 0.1609 0.4885 0.5421 0.6048
#> PCTSUPP 0.2385 0.0789 20000 -0.0352 0.0247 0.0772 0.3897 0.4495 0.5207
vcov
Return the sampling covariance matrix.
vcov(mvn)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0059272821 -0.0012167694 -0.0008616098
#> PCTGRT -0.0012167694 0.0055337929 -0.0008326223
#> PCTSUPP -0.0008616098 -0.0008326223 0.0049179926
vcov(adf)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0049971396 0.0002631899 -0.0003698228
#> PCTGRT 0.0002631899 0.0050250993 -0.0005940763
#> PCTSUPP -0.0003698228 -0.0005940763 0.0048536905
vcov(hc3)
#> NARTIC PCTGRT PCTSUPP
#> NARTIC 0.0073916866 0.0007281651 -0.0002022310
#> PCTGRT 0.0007281651 0.0069252053 -0.0005981009
#> PCTSUPP -0.0002022310 -0.0005981009 0.0062233130
confint
Return confidence intervals.
confint(mvn, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.2706736 0.5723131
#> PCTGRT 0.1947400 0.4857045
#> PCTSUPP 0.1012615 0.3770397
confint(adf, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.27063965 0.5476799
#> PCTGRT 0.19156579 0.4687909
#> PCTSUPP 0.09507792 0.3688795
confint(hc3, level = 0.95)
#> 2.5 % 97.5 %
#> NARTIC 0.22582761 0.5653624
#> PCTGRT 0.16092780 0.4884945
#> PCTSUPP 0.07723053 0.3896925
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