betaMC: Example Using the RSqMC Function
Ivan Jacob Agaloos Pesigan
Source:vignettes/example-r-sq-mc.Rmd
example-r-sq-mc.Rmd
Confidence intervals for multiple correlation coefficients (R-squared
and adjusted R-squared) are generated using the RSqMC()
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")
Multiple Correlation Coefficients
Normal-Theory Approach
mvn <- RSqMC(mvn)
Asymptotic distribution-free Approach
adf <- RSqMC(adf)
Heteroskedasticity Consistent Approach (HC3)
hc3 <- RSqMC(hc3)
Methods
summary
Summary of the results of RSqMC()
.
summary(mvn)
#> Call:
#> RSqMC(object = mvn)
#>
#> R-squared and adjusted R-squared
#> type = "mvn"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> rsq 0.8045 0.0557 20000 0.5187 0.5989 0.6633 0.8801 0.9013 0.9260
#> adj 0.7906 0.0597 20000 0.4843 0.5703 0.6392 0.8715 0.8942 0.9207
summary(adf)
#> Call:
#> RSqMC(object = adf)
#>
#> R-squared and adjusted R-squared
#> type = "adf"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> rsq 0.8045 0.0546 20000 0.5430 0.6174 0.6661 0.8797 0.902 0.9217
#> adj 0.7906 0.0585 20000 0.5104 0.5901 0.6423 0.8711 0.895 0.9161
summary(hc3)
#> Call:
#> RSqMC(object = hc3)
#>
#> R-squared and adjusted R-squared
#> type = "hc3"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> rsq 0.8045 0.0621 20000 0.4830 0.5818 0.6465 0.8875 0.9101 0.9382
#> adj 0.7906 0.0665 20000 0.4461 0.5520 0.6212 0.8795 0.9037 0.9338
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