Learn R Programming

lbreg (version 1.3)

predict.lbreg: Predict method for Log-Binomial regression.

Description

Predicted values based on 'lbreg' object.

Usage

# S3 method for lbreg
predict(object, newdata, ...)

Arguments

object

Object of class inheriting from "lbreg"

newdata

a data frame with covariate values with which to predict. If omitted, the fitted probabilities are returned.

not used

Value

Active

active restrictions (taking newdata into account).

coef.pred

regression coefficients re-estimated to satisfy possibly new restrictions imposed by newdata. See reference below.

convergence

same as in the object supplied.

se.pred

estimated standard errors of predictions.

tol

same as in the object supplied.

ypred

predicted probabilities for newdata.

Details

If newdata is omitted the predictions are simply the fitted values stored in the object supplied.

References

Andrade, BB; Andrade JML (2018) Some results for Maximum Likelihood Estimation of Adjusted Relative Risks. Communications in Statistics - Theory and Methods.

Examples

Run this code
# NOT RUN {
require(lbreg)

# data preparation
data(PCS)
w <- PCS
w <- w[,-1]
w$race <- factor(w$race)
w$dpros <- factor(w$dpros)
w$dcaps <- factor(w$dcaps)

# log-binomial regression
fm <- lbreg(tumor ~ ., data=w)
novo <- data.frame(age=c(41, 32), race=c(1,2), dpros=c(2,4), 
                   dcaps=c(1,1), psa=c(7.24,3.25), vol=c(4.3,5.6), 
                   gleason=c(2,8))
predict(fm, newdata=novo)
# }

Run the code above in your browser using DataLab