predict.logreg {LogicReg} | R Documentation |
Predicted values Logic Regression
Description
Computes predicted values for one or more Logic
Regression models that were fitted by a single call to logreg
.
Usage
## S3 method for class 'logreg'
predict(object, msz, ntr, newbin, newsep, ...)
Arguments
object |
Object of class |
msz |
if |
ntr |
see |
newbin |
binary predictors to evaluate the logic trees at. If
|
newsep |
separate (linear) predictors. If |
... |
other options are ignored |
Details
This function calls frame.logreg
.
Value
If object$select = 1
, a vector with fitted values,
otherwise a data frame with fitted values, where columns correspond to
models.
Author(s)
Ingo Ruczinski ingo@jhu.edu and Charles Kooperberg clk@fredhutch.org.
References
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.
See Also
logreg
,
frame.logreg
,
logreg.testdat
Examples
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)