plot.swReg: Plot forward stagewise regression path

Description Usage Arguments Value Examples

Description

plot.swReg plots non-zero coefficients for each iterations of forward stagewise regression.

Usage

1
2
## S3 method for class 'swReg'
plot(x, legend = TRUE, ...)

Arguments

x

an R object resulting from application of swReg

legend

logical. Should a legend be printed? Defaults to TRUE

...

not used

Value

A plot with iteration numbers on the x-axis and coefficient values on the y-axis,

Examples

 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)
 

marjoleinF/swReg documentation built on May 21, 2019, 11:47 a.m.