betasandwich

betaSandwich: Robust Confidence Intervals for Standardized Regression Coefficients

https://github.com/jeksterslab/betasandwich

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 13 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary

Keywords

confidence-intervals heteroskedasticity-consistent-standard-errors r r-package standardized-regression-coefficients
Last synced: 6 months ago · JSON representation ·

Repository

betaSandwich: Robust Confidence Intervals for Standardized Regression Coefficients

Basic Info
Statistics
  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
confidence-intervals heteroskedasticity-consistent-standard-errors r r-package standardized-regression-coefficients
Created over 3 years ago · Last pushed 7 months ago
Metadata Files
Readme Changelog License Citation

README.md

betaSandwich

Ivan Jacob Agaloos Pesigan 2025-07-22

CRAN
Status R-Universe
Status DOI Make
Project R-CMD-check R Package Test
Coverage Lint R
Package Package Website (GitHub
Pages) Compile
LaTeX Shell
Check pages-build-deployment codecov <!-- badges: end -->

Description

Generates robust confidence intervals for standardized regression coefficients using heteroskedasticity-consistent standard errors for models fitted by lm() as described in Dudgeon (2017: http://doi.org/10.1007/s11336-017-9563-z). The package can also be used to generate confidence intervals for R-squared, adjusted R-squared, and differences of standardized regression coefficients. A description of the package and code examples are presented in Pesigan, Sun, and Cheung (2023: https://doi.org/10.1080/00273171.2023.2201277).

Installation

You can install the CRAN release of betaSandwich with:

r install.packages("betaSandwich")

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

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

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). Robust confidence intervals for the standardized regression coefficients are generated using the BetaHC() function from the betaSandwich package following Dudgeon (2017).

r library(betaSandwich)

r df <- betaSandwich::nas1982

Fit the regression model using the lm() function.

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

Estimate the standardized regression slopes and the corresponding robust sampling covariance matrix.

``` r BetaHC(object, type = "hc3", alpha = 0.05)

> Call:

> BetaHC(object = object, type = "hc3", alpha = 0.05)

>

> Standardized regression slopes with HC3 standard errors:

> est se t df p 2.5% 97.5%

> NARTIC 0.4951 0.0786 6.3025 42 0.0000 0.3366 0.6537

> PCTGRT 0.3915 0.0818 4.7831 42 0.0000 0.2263 0.5567

> PCTSUPP 0.2632 0.0855 3.0786 42 0.0037 0.0907 0.4358

```

Other Features

The package can also be used to generate confidence intervals for R-squared, adjusted R-squared, and differences of standardized regression coefficients.

Documentation

See GitHub Pages for package documentation.

Citation

To cite betaSandwich in publications, please cite Pesigan et al. (2023).

References

Dudgeon, P. (2017). Some improvements in confidence intervals for standardized regression coefficients. *Psychometrika*, *82*(4), 928–951.
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., Sun, R. W., & Cheung, S. F. (2023). betaDelta and betaSandwich: Confidence intervals for standardized regression coefficients in R. *Multivariate Behavioral Research*, *58*(6), 1183–1186.

Owner

  • Name: Ivan Jacob Agaloos Pesigan
  • Login: jeksterslab
  • Kind: user
  • Company: University of Macau

Citation (CITATION.cff)

# --------------------------------------------
# CITATION file created with {cffr} R package
# See also: https://docs.ropensci.org/cffr/
# --------------------------------------------
 
cff-version: 1.2.0
message: 'To cite package "betaSandwich" in publications use:'
type: software
license: MIT
title: 'betaSandwich: Robust Confidence Intervals for Standardized Regression Coefficients'
version: 1.0.8
doi: 10.1080/00273171.2023.2201277
identifiers:
- type: doi
  value: 10.32614/CRAN.package.betaSandwich
abstract: Generates robust confidence intervals for standardized regression coefficients
  using heteroskedasticity-consistent standard errors for models fitted by lm() as
  described in Dudgeon (2017) <https://doi.org/10.1007/s11336-017-9563-z>. The package
  can also be used to generate confidence intervals for R-squared, adjusted R-squared,
  and differences of standardized regression coefficients. A description of the package
  and code examples are presented in Pesigan, Sun, and Cheung (2023) <https://doi.org/10.1080/00273171.2023.2201277>.
authors:
- family-names: Pesigan
  given-names: Ivan Jacob Agaloos
  email: r.jeksterslab@gmail.com
  orcid: https://orcid.org/0000-0003-4818-8420
preferred-citation:
  type: article
  title: 'betaDelta and betaSandwich: Confidence intervals for standardized regression
    coefficients in R'
  authors:
  - family-names: Pesigan
    given-names: Ivan Jacob Agaloos
    email: r.jeksterslab@gmail.com
    orcid: https://orcid.org/0000-0003-4818-8420
  - family-names: Sun
    given-names: Rongwei
    email: irissun_s@hotmail.com
    orcid: https://orcid.org/0000-0003-0034-1422
  - family-names: Cheung
    given-names: Shu Fai
    email: shufai.cheung@gmail.com
    orcid: https://orcid.org/0000-0002-9871-9448
  year: '2023'
  doi: 10.1080/00273171.2023.2201277
  journal: Multivariate Behavioral Research
repository: https://CRAN.R-project.org/package=betaSandwich
repository-code: https://github.com/jeksterslab/betaSandwich
url: https://jeksterslab.github.io/betaSandwich/
contact:
- family-names: Pesigan
  given-names: Ivan Jacob Agaloos
  email: r.jeksterslab@gmail.com
  orcid: https://orcid.org/0000-0003-4818-8420
keywords:
- confidence-intervals
- heteroskedasticity-consistent-standard-errors
- r
- r-package
- standardized-regression-coefficients

GitHub Events

Total
  • Push event: 45
Last Year
  • Push event: 45

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 217
  • Total Committers: 2
  • Avg Commits per committer: 108.5
  • Development Distribution Score (DDS): 0.286
Past Year
  • Commits: 64
  • Committers: 2
  • Avg Commits per committer: 32.0
  • Development Distribution Score (DDS): 0.484
Top Committers
Name Email Commits
jeksterslab l****b@g****m 155
jeksterslab j****b 62

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • methods * depends
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/check-full.yml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/latex.yml actions
  • actions/checkout v4 composite
  • s0/git-publish-subdir-action develop composite
.github/workflows/lint.yml actions
  • actions/checkout v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/make-all.yml actions
  • actions/checkout v4 composite
.github/workflows/make.yml actions
  • actions/checkout v4 composite
  • devops-infra/action-commit-push master composite
.github/workflows/pkgdown-gh-pages.yml actions
  • JamesIves/github-pages-deploy-action v4 composite
  • actions/checkout v4 composite
.github/workflows/rhub.yml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
.github/workflows/shellcheck.yml actions
  • actions/checkout v4 composite
  • ludeeus/action-shellcheck master composite
.github/workflows/source.yml actions
  • actions/checkout v4 composite
  • s0/git-publish-subdir-action develop composite
.github/workflows/test-coverage.yml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.devcontainer/Dockerfile docker
  • ijapesigan/r2u-r-project latest build