CRAN/E | swaprinc

swaprinc

Swap Principal Components into Regression Models

Installation

About

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) . Additionally, the package supports using Gifi methods to extract principal components from categorical variables, as outlined by Rossiter (2021) .

github.com/mncube/swaprinc
Bug report File report

Key Metrics

Version 1.0.1
Published 2023-04-17 385 days ago
Needs compilation? no
License MIT
License File
CRAN checks swaprinc results

Downloads

Yesterday 4 0%
Last 7 days 45 -38%
Last 30 days 184 +1%
Last 90 days 504 -22%
Last 365 days 2.167 +1124%

Maintainer

Maintainer

Mackson Ncube

macksonncube.stats@gmail.com

Authors

Mackson Ncube

aut / cre / cph

Material

README
Reference manual
Package source

macOS

r-devel

arm64

r-release

arm64

r-oldrel

arm64

r-devel

x86_64

r-release

x86_64

r-oldrel

x86_64

Windows

r-develnot available

x86_64

r-releasenot available

x86_64

r-oldrelnot available

x86_64

Imports

broom
broom.mixed
dplyr
Gifi
lme4
magrittr
rlang
tidyselect

Suggests

testthat ≥ 3.0.0