# Load Boston housing data
library(MASS)
data(Boston)
y <- Boston[, 14]
X <- Boston[, -14]
X <- X[, -4] # remove categorical variable
X <- as.matrix(X)
# Plot with variable selection and original data
graphic.ppls.splines(
X, y, lambda = 100, ncomp = 5,
add.data = TRUE, select = TRUE, window.size = c(3, 4)
)
# Plot without variable selection and without data
graphic.ppls.splines(
X, y, lambda = 100, ncomp = 5,
add.data = FALSE, select = FALSE, window.size = c(3, 4)
)
Run the code above in your browser using DataLab