Description Usage Arguments Value Examples
plot.swReg
plots non-zero coefficients for each iterations of forward stagewise regression.
1 2 |
x |
an R object resulting from application of |
legend |
logical. Should a legend be printed? Defaults to TRUE |
... |
not used |
A plot with iteration numbers on the x-axis and coefficient values on the y-axis,
1 2 3 4 5 6 7 8 9 10 11 12 | ## Example using Boston Housing data:
library(MASS)
X <- as.matrix(Boston[,-14])
Y <- Boston$medv
swReg1 <- swReg(X, Y, stepsize = .01)
swReg2 <- swReg(X, Y, stepsize = .01, standardizeY = FALSE)
## Plot coefficient paths:
par(mfrow=c(1,2))
plot.swReg(swReg1)
plot.swReg(swReg2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.