Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeksterslab/betanb
betaNB: Generates nonparametric bootstrap confidence intervals for standardized regression coefficients and other effect sizes for models fitted by lm().
https://github.com/jeksterslab/betanb
confidence-intervals nonparametric-bootstrap r r-package regression-effect-sizes standardized-regression-coefficients
Last synced: 15 days ago
JSON representation
betaNB: Generates nonparametric bootstrap confidence intervals for standardized regression coefficients and other effect sizes for models fitted by lm().
- Host: GitHub
- URL: https://github.com/jeksterslab/betanb
- Owner: jeksterslab
- License: other
- Created: 2023-04-08T11:34:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-09T03:46:09.000Z (7 months ago)
- Last Synced: 2024-04-09T04:24:32.187Z (7 months ago)
- Topics: confidence-intervals, nonparametric-bootstrap, r, r-package, regression-effect-sizes, standardized-regression-coefficients
- Language: TeX
- Homepage: https://jeksterslab.github.io/betaNB/
- Size: 15.2 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
betaNB
================
Ivan Jacob Agaloos Pesigan
2024-10-22[![CRAN
Status](https://www.r-pkg.org/badges/version/betaNB)](https://cran.r-project.org/package=betaNB)
[![R-Universe
Status](https://jeksterslab.r-universe.dev/badges/betaNB)](https://jeksterslab.r-universe.dev/betaNB)
[![Make
Project](https://github.com/jeksterslab/betaNB/actions/workflows/make.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/make.yml)
[![R-CMD-check](https://github.com/jeksterslab/betaNB/actions/workflows/check-full.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/check-full.yml)
[![R Package Test
Coverage](https://github.com/jeksterslab/betaNB/actions/workflows/test-coverage.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/test-coverage.yml)
[![Lint R
Package](https://github.com/jeksterslab/betaNB/actions/workflows/lint.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/lint.yml)
[![Package Website (GitHub
Pages)](https://github.com/jeksterslab/betaNB/actions/workflows/pkgdown-gh-pages.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/pkgdown-gh-pages.yml)
[![Compile
LaTeX](https://github.com/jeksterslab/betaNB/actions/workflows/latex.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/latex.yml)
[![Shell
Check](https://github.com/jeksterslab/betaNB/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/shellcheck.yml)
[![pages-build-deployment](https://github.com/jeksterslab/betaNB/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/jeksterslab/betaNB/actions/workflows/pages/pages-build-deployment)
[![codecov](https://codecov.io/gh/jeksterslab/betaNB/branch/main/graph/badge.svg?token=KVLUET3DJ6)](https://codecov.io/gh/jeksterslab/betaNB)## Description
Generates nonparametric bootstrap confidence intervals (Efron &
Tibshirani, 1993: ) 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:
``` r
install.packages("betaNB")
```You can install the development version of `betaNB` from
[GitHub](https://github.com/jeksterslab/betaNB) with:``` r
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 (National
Research Council, 1982). Confidence intervals for the standardized
regression coefficients are generated using the `BetaNB()` function from
the `betaNB` package.``` r
library(betaNB)
`````` r
df <- betaNB::nas1982
```### Regression
Fit the regression model using the `lm()` function.
``` r
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = df)
```### Nonparametric Bootstrap
``` r
nb <- NB(object)
```### Standardized Regression Slopes
``` r
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.0729 5000 0.3541 0.6392
#> PCTGRT 0.3915 0.0771 5000 0.2405 0.5417
#> PCTSUPP 0.2632 0.0791 5000 0.1036 0.4116
```### 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)
``` r
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.0537 5000 0.6902 0.8984
#> adj 0.7906 0.0576 5000 0.6681 0.8912
```#### Improvement in R-squared
``` r
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.0599 5000 0.0792 0.3135
#> PCTGRT 0.1177 0.0487 5000 0.0359 0.2248
#> PCTSUPP 0.0569 0.0336 5000 0.0083 0.1369
```#### Semipartial Correlation Coefficients
``` r
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.2814 0.5599
#> PCTGRT 0.3430 0.0727 5000 0.1895 0.4742
#> PCTSUPP 0.2385 0.0712 5000 0.0914 0.3700
```#### Squared Partial Correlation Coefficients
``` r
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.0997 5000 0.2853 0.6760
#> PCTGRT 0.3757 0.1082 5000 0.1620 0.5806
#> PCTSUPP 0.2254 0.1135 5000 0.0413 0.4731
```#### Differences of Standardized Regression Coefficients
``` r
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.1330 5000 -0.1510 0.3739
#> NARTIC-PCTSUPP 0.2319 0.1237 5000 0.0004 0.4940
#> PCTGRT-PCTSUPP 0.1282 0.1279 5000 -0.1146 0.3891
```## Documentation
See [GitHub Pages](https://jeksterslab.github.io/betaNB/index.html) for
package documentation.## References
Efron, B., & Tibshirani, R. J. (1993). *An introduction to the
bootstrap*. Chapman & Hall.National Research Council. (1982). *An assessment of research-doctorate
programs in the United States: Social and behavioral sciences*. National
Academies Press.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.