Ivan Jacob Agaloos Pesigan 2023-05-07
Description
Generates Monte Carlo confidence intervals for standardized regression coefficients (beta) and other effect sizes, including multiple correlation, semipartial correlations, improvement in R-squared, squared partial correlations, and differences in standardized regression coefficients, for models fitted by lm()
. betaMC
combines ideas from Monte Carlo confidence intervals for the indirect effect (Preacher and Selig, 2012: http://doi.org/10.1080/19312458.2012.679848) and the sampling covariance matrix of regression coefficients (Dudgeon, 2017: http://doi.org/10.1007/s11336-017-9563-z) to generate confidence intervals effect sizes in regression.
Installation
You can install the CRAN release of betaMC
with:
install.packages("betaMC")
You can install the development version of betaMC
from GitHub with:
if (!require("remotes")) install.packages("remotes")
remotes::install_github("jeksterslab/betaMC")
Example
In this example, a multiple regression model is fitted using program quality ratings (QUALITY
) as the regressand/outcome variable and number of published articles attributed to the program faculty members (NARTIC
), percent of faculty members holding research grants (PCTGRT
), and percentage of program graduates who received support (PCTSUPP
) as regressor/predictor variables using a data set from 1982 ratings of 46 doctoral programs in psychology in the USA (National Research Council, 1982). Confidence intervals for the standardized regression coefficients are generated using the BetaMC()
function from the betaMC
package.
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")
Standardized Regression Slopes
Normal-Theory Approach
BetaMC(mvn)
#> Call:
#> BetaMC(object = mvn)
#>
#> Standardized regression slopes
#> type = "mvn"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0753 20000 0.2427 0.2920 0.3389 0.6328 0.6743 0.7225
#> PCTGRT 0.3915 0.0770 20000 0.1427 0.1933 0.2380 0.5383 0.5833 0.6435
#> PCTSUPP 0.2632 0.0745 20000 0.0214 0.0754 0.1187 0.4092 0.4600 0.5185
Asymptotic distribution-free Approach
BetaMC(adf)
#> Call:
#> BetaMC(object = adf)
#>
#> Standardized regression slopes
#> type = "adf"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0674 20000 0.2590 0.3088 0.3521 0.6138 0.6564 0.6907
#> PCTGRT 0.3915 0.0704 20000 0.1338 0.1982 0.2432 0.5204 0.5602 0.5972
#> PCTSUPP 0.2632 0.0768 20000 -0.0041 0.0495 0.1058 0.4076 0.4517 0.5058
Heteroskedasticity Consistent Approach (HC3)
BetaMC(hc3)
#> Call:
#> BetaMC(object = hc3)
#>
#> Standardized regression slopes
#> type = "hc3"
#> est se R 0.05% 0.5% 2.5% 97.5% 99.5% 99.95%
#> NARTIC 0.4951 0.0794 20000 0.2111 0.2701 0.3235 0.6350 0.6798 0.7241
#> PCTGRT 0.3915 0.0819 20000 0.0938 0.1631 0.2159 0.5386 0.5882 0.6433
#> PCTSUPP 0.2632 0.0852 20000 -0.0419 0.0342 0.0911 0.4263 0.4800 0.5413
Other Effect Sizes
The betaMC
package also has functions to generate Monte Carlo confidence intervals for other effect sizes such as RSqMC()
for multiple correlation coefficients (R-squared and adjusted R-squared), DeltaRSqMC()
for improvement in R-squared, SCorMC()
for semipartial correlation coefficients, PCorMC()
for squared partial correlation coefficients, and DiffBetaMC()
for differences of standardized regression coefficients.
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
National Research Council. (1982). An assessment of research-doctorate programs in the United States: Social and behavioral sciences. https://doi.org/10.17226/9781. Reproduced with permission from the National Academy of Sciences, Courtesy of the National Academies Press, Washington, D.C.
Pesigan, I. J. A. (2022). Confidence intervals for standardized coefficients: Applied to regression coefficients in primary studies and indirect effects in meta-analytic structural equation modeling [Unpublished doctoral dissertation]. University of Macau.
Preacher, K. J., & Selig, J. P. (2012). Advantages of Monte Carlo confidence intervals for indirect effects. Communication Methods and Measures, 6(2), 77-98. https://doi.org/10.1080/19312458.2012.679848
Documentation
See GitHub Pages for package documentation.