swaprinc: Swap Principal Components into Regression Models

Obtaining accurate and stable estimates of regression coefficients can be challenging when the suggested statistical model has issues related to multicollinearity, convergence, or overfitting. One solution is to use principal component analysis (PCA) results in the regression, as discussed in Chan and Park (2005) <doi:10.1080/01446190500039812>. The swaprinc() package streamlines comparisons between a raw regression model with the full set of raw independent variables and a principal component regression model where principal components are estimated on a subset of the independent variables, then swapped into the regression model in place of those variables. The swaprinc() function compares one raw regression model to one principal component regression model, while the compswap() function compares one raw regression model to many principal component regression models. Package functions include parameters to center, scale, and undo centering and scaling, as described by Harvey and Hansen (2022) <https://cran.r-project.org/package=LearnPCA/vignettes/Vig_03_Step_By_Step_PCA.pdf>. Additionally, the package supports using Gifi methods to extract principal components from categorical variables, as outlined by Rossiter (2021) <https://www.css.cornell.edu/faculty/dgr2/_static/files/R_html/NonlinearPCA.html#2_Package>.

Version: 1.0.1
Imports: broom, broom.mixed, dplyr, Gifi, lme4, magrittr, rlang, tidyselect
Suggests: testthat (≥ 3.0.0)
Published: 2023-04-17
DOI: 10.32614/CRAN.package.swaprinc
Author: Mackson Ncube [aut, cre, cph]
Maintainer: Mackson Ncube <macksonncube.stats at gmail.com>
BugReports: https://github.com/mncube/swaprinc/issues
License: MIT + file LICENSE
URL: https://github.com/mncube/swaprinc
NeedsCompilation: no
Materials: README
CRAN checks: swaprinc results

Documentation:

Reference manual: swaprinc.pdf

Downloads:

Package source: swaprinc_1.0.1.tar.gz
Windows binaries: r-devel: swaprinc_1.0.1.zip, r-release: swaprinc_1.0.1.zip, r-oldrel: swaprinc_1.0.1.zip
macOS binaries: r-release (arm64): swaprinc_1.0.1.tgz, r-oldrel (arm64): swaprinc_1.0.1.tgz, r-release (x86_64): swaprinc_1.0.1.tgz, r-oldrel (x86_64): swaprinc_1.0.1.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=swaprinc to link to this page.