predict.logreg {LogicReg} | R Documentation |
Computes predicted values for one or more Logic
Regression models that were fitted by a single call to logreg
.
## S3 method for class 'logreg': predict(object, msz, ntr, newbin, newsep, ...)
object |
Object of class logreg , that resulted from
applying the function logreg
with
select = 1 (single model fit),
select = 2 (multiple model fit), or
select = 6 (greedy stepwise fit). |
msz |
if predict.logreg is executed on an object of class
logreg , that resulted from applying the function logreg
with select = 2 (multiple model fit)
or select = 6 (greedy stepwise fit) all logic trees for all
fitted models are returned. To restrict the model size and the number
of trees to some models, specify msz and ntr
(for select = 2 ) or just msz (for select = 6 ). |
ntr |
see msz |
newbin |
binary predictors to evaluate the logic trees at. If
newbin is omitted, the original (training) data is used. |
newsep |
separate (linear) predictors. If newbin is
omitted, the original (training) predictors are used, even if
newsep is specified. |
... |
other options are ignored |
This function calls frame.logreg
.
If object$select = 1
, a vector with fitted values,
otherwise a data frame with fitted values, where columns correspond to
models.
Ingo Ruczinski ingo@jhu.edu and Charles Kooperberg clk@fhcrc.org.
Ruczinski I, Kooperberg C, LeBlanc ML (2003). Logic Regression, Journal of Computational and Graphical Statistics, 12, 475-511.
Ruczinski I, Kooperberg C, LeBlanc ML (2002). Logic Regression - methods and software. Proceedings of the MSRI workshop on Nonlinear Estimation and Classification (Eds: D. Denison, M. Hansen, C. Holmes, B. Mallick, B. Yu), Springer: New York, 333-344.
logreg
,
frame.logreg
,
logreg.testdat
data(logreg.savefit1,logreg.savefit2,logreg.savefit6,logreg.testdat) # # myanneal <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 1000) # logreg.savefit1 <- logreg(resp = logreg.testdat[,1], bin=logreg.testdat[, 2:21], type = 2, # select = 1, ntrees = 2, anneal.control = myanneal) z1 <- predict(logreg.savefit1) plot(z1, logreg.testdat[,1]-z1, xlab="fitted values", ylab="residuals") # myanneal2 <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 0) # logreg.savefit2 <- logreg(select = 2, nleaves =c(1,7), oldfit = logreg.savefit1, # anneal.control = myanneal2) z2 <- predict(logreg.savefit2) # logreg.savefit6 <- logreg(select = 6, ntrees = 2, nleaves =c(1,12), oldfit = logreg.savefit1) z6 <- predict(logreg.savefit6, msz = 3:5)