| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/msboot.R |
| 3 |
\name{msboot} |
| 4 |
\alias{msboot} |
| 5 |
\title{Bootstrap function in multi-state models} |
| 6 |
\usage{ |
| 7 |
msboot(theta, data, B = 5, id = "id", verbose = 0, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{theta}{A function of \code{data} and perhaps other arguments, |
| 11 |
returning the value of the statistic to be bootstrapped; the output of theta |
| 12 |
should be a scalar or numeric vector} |
| 13 |
|
| 14 |
\item{data}{An object of class 'msdata', such as output from |
| 15 |
\code{\link{msprep}}} |
| 16 |
|
| 17 |
\item{B}{The number of bootstrap replications; the default is taken to be |
| 18 |
quite small (5) since bootstrapping can be time-consuming} |
| 19 |
|
| 20 |
\item{id}{Character string indicating which column identifies the subjects |
| 21 |
to be resampled} |
| 22 |
|
| 23 |
\item{verbose}{The level of output; default 0 = no output, 1 = print the |
| 24 |
replication} |
| 25 |
|
| 26 |
\item{...}{Any further arguments to the function \code{theta}} |
| 27 |
} |
| 28 |
\value{ |
| 29 |
Matrix of dimension (length of output of theta) x B, with b'th |
| 30 |
column being the value of theta for the b'th bootstrap dataset |
| 31 |
} |
| 32 |
\description{ |
| 33 |
A generic nonparametric bootstrapping function for multi-state models. |
| 34 |
} |
| 35 |
\details{ |
| 36 |
The function \code{msboot} samples randomly with replacement subjects from |
| 37 |
the original dataset \code{data}. The individuals are identified with |
| 38 |
\code{id}, and bootstrap datasets are produced by concatenating all selected |
| 39 |
rows. |
| 40 |
} |
| 41 |
\examples{ |
| 42 |
|
| 43 |
tmat <- trans.illdeath() |
| 44 |
data(ebmt1) |
| 45 |
covs <- c("score","yrel") |
| 46 |
msebmt <- msprep(time=c(NA,"rel","srv"),status=c(NA,"relstat","srvstat"), |
| 47 |
data=ebmt1,id="patid",keep=covs,trans=tmat) |
| 48 |
# define a function (this one returns vector of regression coef's) |
| 49 |
regcoefvec <- function(data) { |
| 50 |
cx <- coxph(Surv(Tstart,Tstop,status)~score+strata(trans), |
| 51 |
data=data,method="breslow") |
| 52 |
return(coef(cx)) |
| 53 |
} |
| 54 |
regcoefvec(msebmt) |
| 55 |
set.seed(1234) |
| 56 |
msboot(theta=regcoefvec,data=msebmt,id="patid") |
| 57 |
|
| 58 |
} |
| 59 |
\references{ |
| 60 |
Fiocco M, Putter H, van Houwelingen HC (2008). Reduced-rank |
| 61 |
proportional hazards regression and simulation-based prediction for |
| 62 |
multi-state models. \emph{Statistics in Medicine} \bold{27}, 4340--4358. |
| 63 |
} |
| 64 |
\author{ |
| 65 |
Marta Fiocco, Hein Putter <[email protected]> |
| 66 |
} |
| 67 |
\keyword{datagen} |