Package: swaprinc 1.0.1.9000

Mackson Ncube

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

Authors:Mackson Ncube [aut, cre, cph]

swaprinc_1.0.1.9000.tar.gz
swaprinc_1.0.1.9000.zip(r-4.5)swaprinc_1.0.1.9000.zip(r-4.4)swaprinc_1.0.1.9000.zip(r-4.3)
swaprinc_1.0.1.9000.tgz(r-4.4-any)swaprinc_1.0.1.9000.tgz(r-4.3-any)
swaprinc_1.0.1.9000.tar.gz(r-4.5-noble)swaprinc_1.0.1.9000.tar.gz(r-4.4-noble)
swaprinc_1.0.1.9000.tgz(r-4.4-emscripten)swaprinc_1.0.1.9000.tgz(r-4.3-emscripten)
swaprinc.pdf |swaprinc.html
swaprinc/json (API)
NEWS

# Install 'swaprinc' in R:
install.packages('swaprinc', repos = c('https://mncube.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/mncube/swaprinc/issues

On CRAN:

3 exports 0.63 score 45 dependencies 2 scripts 215 downloads

Last updated 1 years agofrom:9d9ef19b7c. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 10 2024
R-4.5-winOKSep 10 2024
R-4.5-linuxOKSep 10 2024
R-4.4-winOKSep 10 2024
R-4.4-macOKSep 10 2024
R-4.3-winOKSep 10 2024
R-4.3-macOKSep 10 2024

Exports:%>%compswapswaprinc

Dependencies:backportsbootbroombroom.mixedclicodacodetoolscolorspacecpp11digestdplyrfansiforcatsfurrrfuturegenericsGifiglobalsgluelatticelifecyclelistenvlme4magrittrMASSMatrixminqanlmenloptrparallellypillarpkgconfigpurrrR6RcppRcppEigenrlangstringistringrtibbletidyrtidyselectutf8vctrswithr