powered by
Given an stpm2 fit and a data-frame of new data, return simulated values
stpm2
# S4 method for stpm2 simulate(object, nsim=1, seed=NULL, newdata=NULL, lower=1e-06, upper=1e+05, start=NULL, ...) # S4 method for pstpm2 simulate(object, nsim=1, seed=NULL, newdata=NULL, lower=1e-06, upper=1e+05, start=NULL, ...)
an stpm2 fit
an stpm2 or pstpm2 object
number of simulations per row in newdata
optional random number seed
list of new data. If not specified, then defaults to object@data
smallest possible time
largest possible time
left truncated entry time (assumed to be zero if NULL)
additional arguments (for generic compatibility)
set.seed(1002) fit1 <- gsm(Surv(rectime,censrec==1)~hormon,data=brcancer,df=3) simulate(fit1, nsim=10, newdata=data.frame(hormon=1)) simulate(fit1, newdata=data.frame(hormon=0:1))
Run the code above in your browser using DataLab