predict.logreg: Predicted values Logic Regression

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/LogicReg.R

Description

Computes predicted values for one or more Logic Regression models that were fitted by a single call to logreg.

Usage

1
2
## S3 method for class 'logreg'
predict(object, msz, ntr, newbin, newsep, ...)

Arguments

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

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 [email protected] and Charles Kooperberg [email protected].

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

LogicReg documentation built on May 29, 2017, 12:17 p.m.