Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pcreg

Principal Component and Partial Least Squares Regression


Description

Regression using the principal components or latent variables as inputs. The best model is selected using components 1, 2, ..., r, where r, the number of components to use is determined by the AIC or BIC.

Usage

pcreg(Xy, scale = TRUE, method = c("PC", "LV"), ic = c("BIC", "AIC"))

Arguments

Xy

dataframe with variable names in columns

scale

Whether or not to scale. Default is TRUE.

method

either principal components, "PC", or partial least squares latent variables, "LV"

ic

"BIC" or "AIC"

Value

An S3 class list "pcreg" with components

lmfit

lm model

PLSFit

column sd

Z

matrix of principal components or latent vector

method

'pcr' or 'pls'

Author(s)

A. I. McLeod

See Also

Examples

pcreg(mcdonald, scale=TRUE, method="PC")
pcreg(mcdonald, scale=TRUE, method="LV")

bestglm

Best Subset GLM and Regression Utilities

v0.37.3
GPL (>= 2)
Authors
A.I. McLeod, Changjiang Xu and Yuanhao Lai
Initial release
2020-03-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.