Skip to contents

CRAN Status R-Universe Status Make Project R-CMD-check R Package Test Coverage Lint R Package Package Website (GitHub Pages) Compile LaTeX Shell Check pages-build-deployment codecov

Description

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().

Installation

You can install the CRAN release of betaNB with:

You can install the development version of betaNB from GitHub with:

if (!require("remotes")) install.packages("remotes")
remotes::install_github("jeksterslab/betaNB")

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 [@NationalResearchCouncil-1982]. Confidence intervals for the standardized regression coefficients are generated using the BetaNB() function from the betaNB package.

df <- betaNB::nas1982

Regression

Fit the regression model using the lm() function.

object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)

Nonparametric Bootstrap

nb <- NB(object)

Standardized Regression Slopes

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.0718 5000 0.3541 0.6390
#> PCTGRT  0.3915 0.0768 5000 0.2350 0.5349
#> PCTSUPP 0.2632 0.0797 5000 0.0986 0.4104

Other Effect Sizes

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.

Multiple Correlation Coefficients (R-squared and adjusted R-squared)

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.0522 5000 0.6966 0.8994
#> adj 0.7906 0.0559 5000 0.6750 0.8922

Improvement in R-squared

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.0592 5000 0.0804 0.3143
#> PCTGRT  0.1177 0.0485 5000 0.0353 0.2216
#> PCTSUPP 0.0569 0.0337 5000 0.0077 0.1336

Semipartial Correlation Coefficients

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.0695 5000 0.2835 0.5606
#> PCTGRT  0.3430 0.0728 5000 0.1878 0.4707
#> PCTSUPP 0.2385 0.0716 5000 0.0879 0.3654

Squared Partial Correlation Coefficients

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.0994 5000 0.281 0.6699
#> PCTGRT  0.3757 0.1089 5000 0.159 0.5877
#> PCTSUPP 0.2254 0.1151 5000 0.040 0.4769

Differences of Standardized Regression Coefficients

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.1311 5000 -0.1437 0.3710
#> NARTIC-PCTSUPP 0.2319 0.1240 5000 -0.0070 0.4873
#> PCTGRT-PCTSUPP 0.1282 0.1281 5000 -0.1189 0.3814

Documentation

See GitHub Pages for package documentation.

References