Description Usage Arguments Details Value Methods See Also
Given an stpm2
fit and an optional list of new data, return predictions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## S4 method for signature 'stpm2'
predict(object, newdata=NULL,
type=c("surv","cumhaz","hazard","density","hr","sdiff",
"hdiff","loghazard","link","meansurv","meansurvdiff",
"odds","or","margsurv","marghaz","marghr","meanhaz","af",
"fail","margfail","meanmargsurv","uncured"),
grid=FALSE,seqLength=300,
se.fit=FALSE,link=NULL,exposed=incrVar(var),var,
keep.attributes=TRUE, use.gr=TRUE,...)
## S4 method for signature 'pstpm2'
predict(object, newdata=NULL,
type=c("surv","cumhaz","hazard","density","hr","sdiff",
"hdiff","loghazard","link","meansurv","meansurvdiff",
"odds","or","margsurv","marghaz","marghr","meanhaz","af",
"fail","margfail","meanmargsurv"),
grid=FALSE,seqLength=300,
se.fit=FALSE,link=NULL,exposed=incrVar(var),var,
keep.attributes=TRUE, use.gr=TRUE,...)

object 
an 
newdata 
optional list of new data (required if type in
("hr","sdiff","hdiff","meansurvdiff","or","uncured")). For type in
("hr","sdiff","hdiff","meansurvdiff","or","af","uncured"), this defines the unexposed
newdata. This can be combined with 
type 
specify the type of prediction:

grid 
whether to merge newdata with a regular sequence of event times (default=FALSE) 
seqLength 
length of the sequence used when 
se.fit 
whether to calculate confidence intervals (default=FALSE) 
link 
allows a different link for the confidence interval calculation (default=NULL, such that switch(type,surv="cloglog",cumhaz="log",hazard="log",hr="log",sdiff="I", hdiff="I",loghazard="I",link="I",odds="log",or="log",margsurv="cloglog", marghaz="log",marghr="log")) 
exposed 
a function that takes newdata and returns a transformed dataframe for those exposed or the counterfactual (defaults to incrementing “var”) 
var 
specify the variable name or names for the exposed/unexposed (names are given as characters) 
keep.attributes 
Boolean to determine whether the output should include the newdata as an attribute (default=TRUE) 
use.gr 
Boolean to determine whether to use gradients in the variance calculations when they are available (default=TRUE) 
... 
additional arguments (for generic compatibility) 
The confidence interval estimation is based on the delta method using numerical differentiation.
A dataframe with components Estimate
, lower
and
upper
, with an attribute "newdata" for the newdata
dataframe.
an stpm2
fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.