| pcr {plsdof} | R Documentation |
This function computes the Principal Components Regression (PCR) fit.
pcr(X,y,scale,m,eps,supervised)
X |
matrix of predictor observations. |
y |
vector of response observations. The length of |
scale |
Should the predictor variables be scaled to unit variance? Default is |
m |
maximal number of principal components. Default is |
eps |
precision. Eigenvalues of the correlation matrix of |
supervised |
Should the principal components be sorted by decreasing squared correlation to the response? Default is FALSE. |
The function first scales all predictor variables to unit variance, and then computes the PCR fit for all components. Is supervised=TRUE, we sort the principal correlation according to the squared correlation to the response.
coefficients |
matrix of regression coefficients, including the coefficients of the null model, i.e. the constant model |
intercept |
vector of intercepts, including the intercept of the null model, i.e. the constant model |
Nicole Kraemer
n<-50 # number of observations p<-15 # number of variables X<-matrix(rnorm(n*p),ncol=p) y<-rnorm(n) my.pcr<-pcr(X,y,m=10)