Debian Codegraph @

man/print.msdata.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/print.msdata.R
3 \name{print.msdata}
4 \alias{print.msdata}
5 \title{Print method for a msdata object}
6 \usage{
7 \method{print}{msdata}(x, trans = FALSE, ...)
8 }
9 \arguments{
10 \item{x}{Object of class 'msdata', as prepared for instance by
11 \code{\link{msprep}}}
12
13 \item{trans}{Boolean specifying whether or not the transition matrix should
14 be printed as well; default is \code{FALSE}}
15
16 \item{\dots}{Further arguments to print}
17 }
18 \value{
19 No return value
20 }
21 \description{
22 Print method for an object of class 'msdata'
23 }
24 \examples{
25
26 # transition matrix for illness-death model
27 tmat <- trans.illdeath()
28 # some data in wide format
29 tg <- data.frame(stt=rep(0,6),sts=rep(0,6),
30 illt=c(1,1,6,6,8,9),ills=c(1,0,1,1,0,1),
31 dt=c(5,1,9,7,8,12),ds=c(1,1,1,1,1,1),
32 x1=c(1,1,1,2,2,2),x2=c(6:1))
33 tg$x1 <- factor(tg$x1,labels=c("male","female"))
34 tg$patid <- factor(2:7,levels=1:8,labels=as.character(1:8))
35 # define time, status and covariates also as matrices
36 tt <- matrix(c(rep(NA,6),tg$illt,tg$dt),6,3)
37 st <- matrix(c(rep(NA,6),tg$ills,tg$ds),6,3)
38 keepmat <- data.frame(gender=tg$x1,age=tg$x2)
39 # data in long format using msprep
40 msp <- msprep(time=tt,status=st,trans=tmat,keep=as.matrix(keepmat))
41 print(msp)
42 print(msp, trans=TRUE)
43
44 }
45 \seealso{
46 \code{\link{probtrans}}
47 }
48 \author{
49 Hein Putter \email{[email protected]}
50 }
51 \keyword{hplot}