simulate-methods | R Documentation |
Given an stpm2
fit and a data-frame
of new data, return simulated values
## S4 method for signature 'stpm2'
simulate(object, nsim=1,
seed=NULL, newdata=NULL,
lower=1e-06, upper=1e+05, start=NULL, ...)
## S4 method for signature 'pstpm2'
simulate(object, nsim=1,
seed=NULL, newdata=NULL,
lower=1e-06, upper=1e+05, start=NULL, ...)
object |
an stpm2 or pstpm2 object |
nsim |
number of simulations per row in newdata |
seed |
optional random number seed |
newdata |
list of new data. If not specified, then defaults to object@data |
lower |
smallest possible time |
upper |
largest possible time |
start |
left truncated entry time (assumed to be zero if NULL) |
... |
additional arguments (for generic compatibility) |
an stpm2
fit
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.