predict.icfit {icpack}R Documentation

Predict method for an object of class 'icfit'

Description

Predict method for an object of class 'icfit'

Usage

## S3 method for class 'icfit'
predict(object, newdata, nstep = 500, alpha = 0.05, ...)

Arguments

object

The object of class 'icfit' for which a prediction is to be made

newdata

A data frame containing covariate information for a new subject

nstep

Number of time steps used for calculating cumulative hazards (default is 500)

alpha

The alpha level for the (1-alpha)*100 percent confidence interval

...

Any other arguments

Value

An object of class 'predict.icfit', which is a data frame with time points and hazard, cumulative hazard and survival at those time points, along with standard errors and pointwise lower and upper confidence bounds, or a list of such data frames for each subject represented in 'newdata'

Examples


icf <- icfit(Surv(left, right, type='interval2') ~ period + gender + age, data=drugusers)
pred_icf <- predict(icf)
head(pred_icf)
ndata <- drugusers[1:4, ]
pred_nd_icf <- predict(icf, newdata=ndata)
lapply(pred_nd_icf, head)



[Package icpack version 0.1.0 Index]