Learn R Programming

stepPlr (version 0.90)

predict.stepplr: prediction function for step.plr

Description

This function computes the linear predictors, probability estimates, or the class labels for new data, using a stepplr object.

Usage

predict.stepplr(object, x = NULL, newx = NULL,
                  type = c("link", "response", "class"), ...)

Arguments

References

Mee Young Park and Trevor Hastie (2006) Penalized Logistic Regression for Detecting Gene Interactions - available at the authors' websites, http://www.stanford.edu/~mypark or http://stat.stanford.edu/~hastie/pub.htm.

See Also

stepplr

Examples

Run this code
n <- 100
p <- 5
x0 <- matrix(sample(seq(3),n*p,replace=TRUE),nrow=n)
x0 <- cbind(rnorm(n),x0)
y <- sample(c(0,1),n,replace=TRUE)
level <- vector("list",length=6)
for (i in 2:6) level[[i]] <- seq(3)
fit <- step.plr(x0,y,level=level)
x1 <- matrix(sample(seq(3),n*p,replace=TRUE),nrow=n)
x1 <- cbind(rnorm(n),x1)
pred1 <- predict(fit,x0,x1,type="link")
pred2 <- predict(fit,x0,x1,type="response")
pred3 <- predict(fit,x0,x1,type="class")

Run the code above in your browser using DataLab