glm.pcr: Principal component generalised linear models

View source: R/glm.pcr.R

Principal component generalised linear modelsR Documentation

Principal component generalised linear models

Description

Principal component generalised linear models.

Usage

glm.pcr(y, x, k = 1, xnew = NULL)

Arguments

y

A numerical vector with 0 and 1 (binary) or a vector with discrete (count) data.

x

A matrix with the predictor variable(s), they have to be continuous.

k

A number greater than or equal to 1. How many principal components to use. You may get results for the sequence of principal components.

xnew

If you have new data use it, otherwise leave it NULL.

Details

Principal component regression is performed with binary logistic or Poisson regression, depending on the nature of the response variable. The principal components of the cross product of the independent variables are obtained and classical regression is performed. This is used in the function alfa.pcr.

Value

A list including:

model

The summary of the logistic or Poisson regression model as returned by the package Rfast.

per

The percentage of variance of the predictor variables retained by the k principal components.

vec

The principal components, the loadings.

est

The fitted or the predicted values (if xnew is not NULL). If the argument k is a vector then this is a matrix with the estimated values for each number of components.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

Aguilera A.M., Escabias M. and Valderrama M.J. (2006). Using principal components for estimating logistic regression with high-dimensional multicollinear data. Computational Statistics & Data Analysis 50(8): 1905-1924.

Jolliffe I.T. (2002). Principal Component Analysis.

See Also

alfa.pcr, alfapcr.tune

Examples

x <- as.matrix(iris[, 1:4])
y <- rbinom(150, 1, 0.6)
mod <- glm.pcr(y, x, k = 1)

Compositional documentation built on Oct. 9, 2024, 5:10 p.m.