# NOT RUN {
y <- mtcars[,1] # make mpg the outcome
Xy <- as.data.frame(cbind(mtcars[,-1], y)) # make y column the last column
xvalPoly(Xy,2,use="lm") # not using pca
xvalPoly(Xy,2, use="lm", pcaMethod="prcomp", 0.8) # using pca on X first
# }
Run the code above in your browser using DataLab