Debian Codegraph @

man/LMAJ.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/LMAJ.R
3 \name{LMAJ}
4 \alias{LMAJ}
5 \title{Landmark Aalen-Johansen method}
6 \usage{
7 LMAJ(msdata, s, from, method = c("aalen", "greenwood"))
8 }
9 \arguments{
10 \item{msdata}{An \code{"msdata"} object, as for instance prepared by
11 \code{link{msprep}}}
12
13 \item{s}{The prediction time point s from which transition probabilities are
14 to be obtained}
15
16 \item{from}{Either a single state or a set of states in the state space
17 1,...,S}
18
19 \item{method}{The method for calculating variances, as in
20 \code{\link{probtrans}}}
21 }
22 \value{
23 A data frame containing estimates and associated standard errors of
24 the transition probabilities P(X(t)=k | X(s) in \code{from}) with \code{s}
25 and \code{from} the arguments of the function.
26 }
27 \description{
28 This function implements the landmark Aalen-Johansen method of Putter &
29 Spitoni (2016) for non-parametric estimation of transition probabilities in
30 non-Markov models.
31 }
32 \examples{
33
34 data(prothr)
35 tmat <- attr(prothr, "trans")
36 pr0 <- subset(prothr, treat=="Placebo")
37 attr(pr0, "trans") <- tmat
38 pr1 <- subset(prothr, treat=="Prednisone")
39 attr(pr1, "trans") <- tmat
40 c0 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data=pr0)
41 c1 <- coxph(Surv(Tstart, Tstop, status) ~ strata(trans), data=pr1)
42 msf0 <- msfit(c0, trans=tmat)
43 msf1 <- msfit(c1, trans=tmat)
44 # Comparison as in Figure 2 of Titman (2015)
45 # Aalen-Johansen
46 pt0 <- probtrans(msf0, predt=1000)[[2]]
47 pt1 <- probtrans(msf1, predt=1000)[[2]]
48 par(mfrow=c(1,2))
49 plot(pt0$time, pt0$pstate1, type="s", lwd=2, xlim=c(1000,4000), ylim=c(0,0.61),
50 xlab="Time since randomisation (days)", ylab="Probability")
51 lines(pt1$time, pt1$pstate1, type="s", lwd=2, lty=3)
52 legend("topright", c("Placebo", "Prednisone"), lwd=2, lty=1:2, bty="n")
53 title(main="Aalen-Johansen")
54 # Landmark Aalen-Johansen
55 LMpt0 <- LMAJ(msdata=pr0, s=1000, from=2)
56 LMpt1 <- LMAJ(msdata=pr1, s=1000, from=2)
57 plot(LMpt0$time, LMpt0$pstate1, type="s", lwd=2, xlim=c(1000,4000), ylim=c(0,0.61),
58 xlab="Time since randomisation (days)", ylab="Probability")
59 lines(LMpt1$time, LMpt1$pstate1, type="s", lwd=2, lty=3)
60 legend("topright", c("Placebo", "Prednisone"), lwd=2, lty=1:2, bty="n")
61 title(main="Landmark Aalen-Johansen")
62
63 }
64 \references{
65 H. Putter and C. Spitoni (2016). Estimators of transition
66 probabilities in non-Markov multi-state models. Submitted.
67 }
68 \author{
69 Hein Putter \email{[email protected]}
70
71 Edouard F. Bonneville \email{[email protected]}
72 }
73 \keyword{survival}