gpcr: Generalized Principal Components Regression

Description Usage Arguments Value Examples

View source: R/gpcr.R

Description

Principal Components Regression utilizes PCA to decompose a model matrix of numeric predictors into its principal components and then fits a linear model to the components. Afterwards, the coefficients are projected back to obtain the coefficients for the original set of variables. Here this process is extended to generalized linear models, allowing for non-Gaussian outcomes in the exponential family.
Principal Components Regression, like any method, has both advantages and disadvantages. One advantage is that coefficients reflecting the original predictors are returned, while still only having to perform regression on k principal components. This obviates the sometimes difficult and awkward task of interpreting the principal components. The selection of the leading k principal components is based on the assumption that components which explain a lot of variance in the design matrix will also explain variance in the outcome variable. This is not always the case. Furthermore as a regularization method, PCR lacks a smooth relationship of the coefficients to the coefficients of the unpenalized model when compared to methods like ridge regression.

An alternative method known as projection to latent structures (or partial least squares), available in this package via the function gpls, is an approach more closely related to factor analysis than to PCA. Other good alternatives include any of the functions available for sufficient dimension reduction (see sdr) and the envelope methods available in ENV and GLENV.

Usage

1
gpcr(formula, data, ncomp = NULL, family = gaussian())

Arguments

formula

a model formula

data

a data frame

ncomp

The number of principal components to retain. If left as NULL the minimum of P-1 and the number of non-zero eigenvalues will be returned.

family

one of the glm families supported by R's glm function.

Value

an object with classes "gpcr".

Examples

1
gpcr(prog ~ ., diabetes)

abnormally-distributed/cvreg documentation built on May 3, 2020, 3:45 p.m.