Skip to content
jeksterslabPublic

About

betaNB: Generates nonparametric bootstrap confidence intervals for standardized regression coefficients and other effect sizes for models fitted by lm().

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

betaNB

Ivan Jacob Agaloos Pesigan 2026-12-04 05:18:21

CRAN Status R-Universe Status pages-build-deployment codecov Make Project (make all) Make Project R-CMD-check-full R-CMD-check-oldrel R-CMD-check-standard Compile LaTeX Lint R Package Non-ASCII Check Package Website (GitHub Pages) rhub 1 (essential) rhub 2 (memory) rhub 3 (numerics), review only rhub 4 (compilers), review only Shell Check Source Code R Package Test Coverage

Description

Generates nonparametric bootstrap confidence intervals (Efron and Tibshirani, 1993, doi:10.1201/9780429246593) for standardized regression coefficients (beta) and other effect sizes, including multiple correlation, semipartial correlations, squared semipartial correlations, improvement in R-squared, squared partial correlations, Cohen’s f-squared, and differences in standardized regression coefficients, for models fitted by lm(). Pairs and wild bootstrap samples are supported, with percentile, bias-corrected, bias-corrected and accelerated, and modified percentile intervals.

Installation

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("pak")) install.packages("pak")
pak::pkg_install("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 (National Research Council, 1982). Confidence intervals for the standardized regression coefficients are generated using the BetaNB() function from the betaNB package following Efron & Tibshirani (1993).

library(package = betaNB)
df <- betaNB::nas1982

Fit the regression model using the lm() function.

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

Generate the sampling distribution using nonparametric bootstrapping.

nb <- NB(object = object, R = 5000L, seed = 0508)

Estimate the standardized regression slopes and the corresponding confidence intervals.

BetaNB(object = 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.3567 0.6369
#> PCTGRT  0.3915 0.0766 5000 0.2349 0.5340
#> PCTSUPP 0.2632 0.0786 5000 0.1064 0.4135

Other Features

The package provides the following functions.

Function Purpose
NB() Nonparametric bootstrap (pairs or wild) of a fitted lm model
BetaNB() Standardized regression coefficients
RSqNB() R-squared and adjusted R-squared
DiffBetaNB() Differences of standardized regression coefficients
SCorNB() Semipartial correlations
SCorSqNB() Squared semipartial correlations (squared signed interval)
PCorNB() Squared partial correlations
DeltaRSqNB() Improvement in R-squared (adjusted differences and modified percentile intervals available)
FSqNB() Cohen’s f-squared and local f-squared

The coef(), vcov(), confint(), summary(), and print() methods are available for the returned objects. Percentile, bias-corrected, and bias-corrected and accelerated intervals are available through the type argument of summary() and confint(). Examples for each function are in the package vignettes.

Effect Sizes

The definitions, formulas, and notes on the intervals are in the help pages of the functions and in the vignette betaNB: Example Using the SCorSqNB and FSqNB Functions.

Documentation

See GitHub Pages for package documentation.

Citation

To cite betaNB in publications, please cite Pesigan (2022).

References

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.

R Core Team. (2026). R: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org/

About

betaNB: Generates nonparametric bootstrap confidence intervals for standardized regression coefficients and other effect sizes for models fitted by lm().

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages