Ivan Jacob Agaloos Pesigan 2024-05-05
Generates nonparametric bootstrap confidence intervals (Efron &
Tibshirani, 1993: https://doi.org/10.1201/9780429246593) 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()
.
You can install the CRAN release of betaNB
with:
install.packages("betaNB")
You can install the development version of betaNB
from
GitHub with:
if (!require("remotes")) install.packages("remotes")
remotes::install_github("jeksterslab/betaNB")
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 BetaNB()
function from
the betaNB
package.
library(betaNB)
df <- betaNB::nas1982
Fit the regression model using the lm()
function.
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
nb <- NB(object)
BetaNB(nb, alpha = 0.05)
#> Call:
#> BetaNB(object = nb, alpha = 0.05)
#>
#> Standardized regression slopes
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4951 0.0735 5000 0.3538 0.6383
#> PCTGRT 0.3915 0.0777 5000 0.2338 0.5400
#> PCTSUPP 0.2632 0.0787 5000 0.1130 0.4161
The betaNB
package also has functions to generate nonparametric
bootstrap confidence intervals for other effect sizes such as RSqNB()
for multiple correlation coefficients (R-squared and adjusted
R-squared), DeltaRSqNB()
for improvement in R-squared, SCorNB()
for
semipartial correlation coefficients, PCorNB()
for squared partial
correlation coefficients, and DiffBetaNB()
for differences of
standardized regression coefficients.
RSqNB(nb, alpha = 0.05)
#> Call:
#> RSqNB(object = nb, alpha = 0.05)
#>
#> R-squared and adjusted R-squared
#> type = "pc"
#> est se R 2.5% 97.5%
#> rsq 0.8045 0.0524 5000 0.6922 0.8948
#> adj 0.7906 0.0561 5000 0.6703 0.8872
DeltaRSqNB(nb, alpha = 0.05)
#> Call:
#> DeltaRSqNB(object = nb, alpha = 0.05)
#>
#> Improvement in R-squared
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.1859 0.0601 5000 0.0838 0.3154
#> PCTGRT 0.1177 0.0490 5000 0.0343 0.2231
#> PCTSUPP 0.0569 0.0338 5000 0.0098 0.1352
SCorNB(nb, alpha = 0.05)
#> Call:
#> SCorNB(object = nb, alpha = 0.05)
#>
#> Semipartial correlations
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4312 0.0703 5000 0.2894 0.5616
#> PCTGRT 0.3430 0.0735 5000 0.1852 0.4723
#> PCTSUPP 0.2385 0.0706 5000 0.0992 0.3677
PCorNB(nb, alpha = 0.05)
#> Call:
#> PCorNB(object = nb, alpha = 0.05)
#>
#> Squared partial correlations
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC 0.4874 0.0991 5000 0.2772 0.6681
#> PCTGRT 0.3757 0.1078 5000 0.1531 0.5809
#> PCTSUPP 0.2254 0.1140 5000 0.0457 0.4755
DiffBetaNB(nb, alpha = 0.05)
#> Call:
#> DiffBetaNB(object = nb, alpha = 0.05)
#>
#> Differences of standardized regression slopes
#> type = "pc"
#> est se R 2.5% 97.5%
#> NARTIC-PCTGRT 0.1037 0.1339 5000 -0.1532 0.3768
#> NARTIC-PCTSUPP 0.2319 0.1244 5000 -0.0060 0.4729
#> PCTGRT-PCTSUPP 0.1282 0.1276 5000 -0.1210 0.3735
See GitHub Pages for package documentation.
Efron, B., & Tibshirani, R. J. (1993). An introduction to the bootstrap. Chapman & Hall. https://doi.org/10.1201/9780429246593
National Research Council. (1982). An assessment of research-doctorate programs in the United States: Social and behavioral sciences. National Academies Press. https://doi.org/10.17226/9781
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 [PhD thesis]. University of Macau.