Debian Codegraph @

man/events.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/events.R
3 \name{events}
4 \alias{events}
5 \title{Count number of observed transitions}
6 \usage{
7 events(msdata)
8 }
9 \arguments{
10 \item{msdata}{An object of class \code{"msdata"}, such as output by
11 \code{\link{msprep}}}
12 }
13 \value{
14 A list containing two tables, the first, called \code{Frequencies},
15 with the number of observed transitions in the multi-state model occurring
16 in \code{msdata}, the second, called \code{Proportions}, with the
17 corresponding proportions.
18 }
19 \description{
20 Given a dataset in long format, for instance generated by
21 \code{\link{msprep}}, and a transition matrix for the multi-state model,
22 this function counts the number of observed transitions in the multi-state
23 model and gives their percentages.
24 }
25 \details{
26 Although \code{msdata} does not need to be the result of a call to
27 \code{\link{msprep}}, it does need to be an object of class \code{"msdata"},
28 which is essentially a data frame in long format, with one row for each
29 transition for which the subject is at risk. The columns \code{from},
30 \code{to}, and \code{status} need to be present, with appropriate meaning,
31 see \code{\link{msprep}}. The \code{msdata} argument needs to have a
32 \code{"trans"} attributes, which holds the transition matrix of the
33 multi-state model.
34 }
35 \examples{
36
37 tmat <- trans.illdeath(names=c("Tx","PR","RelDeath"))
38 data(ebmt3) # data from Section 4 of Putter, Fiocco & Geskus (2007)
39 msebmt <- msprep(time=c(NA,"prtime","rfstime"),status=c(NA,"prstat","rfsstat"),
40 data=ebmt3,trans=tmat)
41 events(msebmt) # see Fig 13 of Putter, Fiocco & Geskus (2007)
42
43 }
44 \author{
45 Hein Putter \email{[email protected]}
46 }
47 \keyword{univar}