Learn R Programming

Compositional (version 3.7)

Principal component generalised linear models: 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, either 0 and 1 (binary) or discrete (count) data.

x

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

k

A number at least equal to 1. How many principal components to use.

xnew

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

Value

A list including:

model

The summary of the logistic or Poisson regression model.

per

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

est

The fitted or the predicted values (if xnew is not NULL).

Details

Principal component regression is performed with binary logistic or Poisson regression, depending on the nature of the response variable.

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

pcr, alfa.pcr, alfapcr.tune, glm

Examples

Run this code
# NOT RUN {
library(MASS)
x <- as.matrix(iris[, 1:4])
y<- rbinom(150, 1, 0.6)
mod<- glm.pcr(y, x, k = 1)
# }

Run the code above in your browser using DataLab