Skip to contents

Summary method for an object of class 'probtrans'. It prints a selection of the estimated transition probabilities, and, if requested, also of the variances.

Usage

# S3 method for class 'probtrans'
summary(
  object,
  times,
  from = 1,
  to = 0,
  variance = TRUE,
  conf.int = 0.95,
  conf.type = c("log", "none", "plain"),
  extend = FALSE,
  ...
)

Arguments

object

Object of class 'probtrans', containing estimated transition probabilities from and to all states in a multi-state model

times

Time points at which to evaluate the transition probabilites

from

Specifies from which state the transition probabilities are to be printed. Should be subset of 1:S, with S the number of states in the multi-state model. Default is print from state 1 only. User can specify from=0 to print transition probabilities from all states

to

Specifies the transition probabilities to which state are to be printed. User can specify to=0 to print transition probabilities to all states. This is also the default

variance

Whether or not the standard errors of the estimated transition probabilities should be printed; default is TRUE

conf.int

The proportion to be covered by the confidence intervals, default is 0.95

conf.type

The type of confidence interval, one of "log", "none", or "plain". Defaults to "log"

extend

logical value: if TRUE, prints information for all specified times, even if there are no subjects left at the end of the specified times. This is only valid if the times argument is present

...

Further arguments to print

Value

Function summary.probtrans returns an object of class "summary.probtrans", which is a list (for each from state) of transition probabilities at the specified (or all) time points. The print method of a summary.probtrans doesn't return a value.

See also

Author

Hein Putter H.Putter@lumc.nl

Examples


# First run the example of probtrans
tmat <- trans.illdeath()
tg <- data.frame(illt=c(1,1,6,6,8,9),ills=c(1,0,1,1,0,1),
                 dt=c(5,1,9,7,8,12),ds=c(1,1,1,1,1,1),
                 x1=c(1,1,1,0,0,0),x2=c(6:1))
tglong <- msprep(time=c(NA,"illt","dt"),status=c(NA,"ills","ds"),
                 data=tg,keep=c("x1","x2"),trans=tmat)
tglong <- expand.covs(tglong,c("x1","x2"))
cx <- coxph(Surv(Tstart,Tstop,status)~x1.1+x2.2+strata(trans),
            data=tglong,method="breslow")
newdata <- data.frame(trans=1:3,x1.1=c(0,0,0),x2.2=c(0,1,0),strata=1:3)
HvH <- msfit(cx,newdata,trans=tmat)
pt <- probtrans(HvH,predt=0)

# Default, prediction from state 1
summary(pt)
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2     pstate3        se1        se2        se3
#> 1    0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2    1 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3    5 0.9299816 0.00000000 0.070018378 0.08750408 0.00000000 0.08750408
#> 4    6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 5    7 0.6776902 0.12614570 0.196164083 0.22689332 0.12638316 0.14680748
#> 6    8 0.4757726 0.12614570 0.398081646 0.23614089 0.12638316 0.19877253
#> 7    9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 8   12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1      lower2       lower3 upper1    upper2    upper3
#> 1 1.0000000 0.000000000 0.000000e+00      1 0.0000000 0.0000000
#> 2 0.7733621 0.004579832 6.149053e-06      1 0.8406020 1.0000000
#> 3 0.7733621 0.000000000 6.045605e-03      1 0.0000000 0.8109318
#> 4 0.3515974 0.046014074 6.045605e-03      1 1.0000000 0.8109318
#> 5 0.3515974 0.017703886 4.524678e-02      1 0.8988274 0.8504549
#> 6 0.1798546 0.017703886 1.496046e-01      1 0.8988274 1.0000000
#> 7 0.0000000 0.053348184 7.195730e-02      0 1.0000000 1.0000000
#> 8 0.0000000 0.000000000 1.000000e+00      0 0.0000000 1.0000000
# Only from states 1 and 3
summary(pt, from=c(1, 3))
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2     pstate3        se1        se2        se3
#> 1    0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2    1 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3    5 0.9299816 0.00000000 0.070018378 0.08750408 0.00000000 0.08750408
#> 4    6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 5    7 0.6776902 0.12614570 0.196164083 0.22689332 0.12638316 0.14680748
#> 6    8 0.4757726 0.12614570 0.398081646 0.23614089 0.12638316 0.19877253
#> 7    9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 8   12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1      lower2       lower3 upper1    upper2    upper3
#> 1 1.0000000 0.000000000 0.000000e+00      1 0.0000000 0.0000000
#> 2 0.7733621 0.004579832 6.149053e-06      1 0.8406020 1.0000000
#> 3 0.7733621 0.000000000 6.045605e-03      1 0.0000000 0.8109318
#> 4 0.3515974 0.046014074 6.045605e-03      1 1.0000000 0.8109318
#> 5 0.3515974 0.017703886 4.524678e-02      1 0.8988274 0.8504549
#> 6 0.1798546 0.017703886 1.496046e-01      1 0.8988274 1.0000000
#> 7 0.0000000 0.053348184 7.195730e-02      0 1.0000000 1.0000000
#> 8 0.0000000 0.000000000 1.000000e+00      0 0.0000000 1.0000000
#> 
#> Prediction from state 3 :
#>   time pstate1 pstate2 pstate3 se1 se2 se3 lower1 lower2 lower3 upper1 upper2
#> 1    0       0       0       1   0   0   0      0      0      1      0      0
#> 2    1       0       0       1   0   0   0      0      0      1      0      0
#> 3    5       0       0       1   0   0   0      0      0      1      0      0
#> 4    6       0       0       1   0   0   0      0      0      1      0      0
#> 5    7       0       0       1   0   0   0      0      0      1      0      0
#> 6    8       0       0       1   0   0   0      0      0      1      0      0
#> 7    9       0       0       1   0   0   0      0      0      1      0      0
#> 8   12       0       0       1   0   0   0      0      0      1      0      0
#>   upper3
#> 1      1
#> 2      1
#> 3      1
#> 4      1
#> 5      1
#> 6      1
#> 7      1
#> 8      1
# Use from=0 for prediction from all states
summary(pt, from=0)
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2     pstate3        se1        se2        se3
#> 1    0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2    1 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3    5 0.9299816 0.00000000 0.070018378 0.08750408 0.00000000 0.08750408
#> 4    6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 5    7 0.6776902 0.12614570 0.196164083 0.22689332 0.12638316 0.14680748
#> 6    8 0.4757726 0.12614570 0.398081646 0.23614089 0.12638316 0.19877253
#> 7    9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 8   12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1      lower2       lower3 upper1    upper2    upper3
#> 1 1.0000000 0.000000000 0.000000e+00      1 0.0000000 0.0000000
#> 2 0.7733621 0.004579832 6.149053e-06      1 0.8406020 1.0000000
#> 3 0.7733621 0.000000000 6.045605e-03      1 0.0000000 0.8109318
#> 4 0.3515974 0.046014074 6.045605e-03      1 1.0000000 0.8109318
#> 5 0.3515974 0.017703886 4.524678e-02      1 0.8988274 0.8504549
#> 6 0.1798546 0.017703886 1.496046e-01      1 0.8988274 1.0000000
#> 7 0.0000000 0.053348184 7.195730e-02      0 1.0000000 1.0000000
#> 8 0.0000000 0.000000000 1.000000e+00      0 0.0000000 1.0000000
#> 
#> Prediction from state 2 :
#>   time pstate1 pstate2 pstate3 se1 se2 se3 lower1 lower2 lower3 upper1 upper2
#> 1    0       0       1       0   0   0   0      0      1      0      0      1
#> 2    1       0       1       0   0   0   0      0      1      0      0      1
#> 3    5       0       0       1   0   0   0      0      0      1      0      0
#> 4    6       0       0       1   0   0   0      0      0      1      0      0
#> 5    7       0       0       1   0   0   0      0      0      1      0      0
#> 6    8       0       0       1   0   0   0      0      0      1      0      0
#> 7    9       0       0       1   0   0   0      0      0      1      0      0
#> 8   12       0       0       1   0   0   0      0      0      1      0      0
#>   upper3
#> 1      0
#> 2      0
#> 3      1
#> 4      1
#> 5      1
#> 6      1
#> 7      1
#> 8      1
#> 
#> Prediction from state 3 :
#>   time pstate1 pstate2 pstate3 se1 se2 se3 lower1 lower2 lower3 upper1 upper2
#> 1    0       0       0       1   0   0   0      0      0      1      0      0
#> 2    1       0       0       1   0   0   0      0      0      1      0      0
#> 3    5       0       0       1   0   0   0      0      0      1      0      0
#> 4    6       0       0       1   0   0   0      0      0      1      0      0
#> 5    7       0       0       1   0   0   0      0      0      1      0      0
#> 6    8       0       0       1   0   0   0      0      0      1      0      0
#> 7    9       0       0       1   0   0   0      0      0      1      0      0
#> 8   12       0       0       1   0   0   0      0      0      1      0      0
#>   upper3
#> 1      1
#> 2      1
#> 3      1
#> 4      1
#> 5      1
#> 6      1
#> 7      1
#> 8      1
# Only to states 1 and 2
summary(pt, to=1:2)
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2        se1        se2    lower1      lower2 upper1
#> 1    0 1.0000000 0.00000000 0.00000000 0.00000000 1.0000000 0.000000000      1
#> 2    1 0.9299816 0.06204689 0.08750408 0.08250577 0.7733621 0.004579832      1
#> 3    5 0.9299816 0.00000000 0.08750408 0.00000000 0.7733621 0.000000000      1
#> 4    6 0.6776902 0.25229141 0.22689332 0.21903899 0.3515974 0.046014074      1
#> 5    7 0.6776902 0.12614570 0.22689332 0.12638316 0.3515974 0.017703886      1
#> 6    8 0.4757726 0.12614570 0.23614089 0.12638316 0.1798546 0.017703886      1
#> 7    9 0.0000000 0.47577265 0.00000000 0.53115171 0.0000000 0.053348184      0
#> 8   12 0.0000000 0.00000000 0.00000000 0.00000000 0.0000000 0.000000000      0
#>      upper2
#> 1 0.0000000
#> 2 0.8406020
#> 3 0.0000000
#> 4 1.0000000
#> 5 0.8988274
#> 6 0.8988274
#> 7 1.0000000
#> 8 0.0000000
# Default is 95% confidence interval, change here to 90% 
summary(pt, to=1:2, conf.int=0.90)
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2        se1        se2    lower1      lower2 upper1
#> 1    0 1.0000000 0.00000000 0.00000000 0.00000000 1.0000000 0.000000000      1
#> 2    1 0.9299816 0.06204689 0.08750408 0.08250577 0.7966352 0.006963449      1
#> 3    5 0.9299816 0.00000000 0.08750408 0.00000000 0.7966352 0.000000000      1
#> 4    6 0.6776902 0.25229141 0.22689332 0.21903899 0.3907183 0.060492876      1
#> 5    7 0.6776902 0.12614570 0.22689332 0.12638316 0.3907183 0.024275988      1
#> 6    8 0.4757726 0.12614570 0.23614089 0.12638316 0.2103026 0.024275988      1
#> 7    9 0.0000000 0.47577265 0.00000000 0.53115171 0.0000000 0.075840205      0
#> 8   12 0.0000000 0.00000000 0.00000000 0.00000000 0.0000000 0.000000000      0
#>      upper2
#> 1 0.0000000
#> 2 0.5528605
#> 3 0.0000000
#> 4 1.0000000
#> 5 0.6554930
#> 6 0.6554930
#> 7 1.0000000
#> 8 0.0000000
# Do not show variances (nor confidence intervals)
summary(pt, to=1:2, variance=FALSE)
#> 
#> Prediction from state 1 :
#>   time   pstate1    pstate2
#> 1    0 1.0000000 0.00000000
#> 2    1 0.9299816 0.06204689
#> 3    5 0.9299816 0.00000000
#> 4    6 0.6776902 0.25229141
#> 5    7 0.6776902 0.12614570
#> 6    8 0.4757726 0.12614570
#> 7    9 0.0000000 0.47577265
#> 8   12 0.0000000 0.00000000
# Transition probabilities only at specified time points
summary(pt, times=seq(0, 15, by=3))
#> 
#> Prediction from state 1 :
#>   times   pstate1    pstate2     pstate3        se1        se2        se3
#> 1     0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2     3 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3     6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 4     9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 5    12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1      lower2       lower3 upper1   upper2    upper3
#> 1 1.0000000 0.000000000 0.000000e+00      1 0.000000 0.0000000
#> 2 0.7733621 0.004579832 6.149053e-06      1 0.840602 1.0000000
#> 3 0.3515974 0.046014074 6.045605e-03      1 1.000000 0.8109318
#> 4 0.0000000 0.053348184 7.195730e-02      0 1.000000 1.0000000
#> 5 0.0000000 0.000000000 1.000000e+00      0 0.000000 1.0000000
# Last specified time point is larger than last observed, not printed
# Use extend=TRUE as in summary.survfit
summary(pt, times=seq(0, 15, by=3), extend=TRUE)
#> 
#> Prediction from state 1 :
#>   times   pstate1    pstate2     pstate3        se1        se2        se3
#> 1     0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2     3 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3     6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 4     9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 5    12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#> 6    15 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1      lower2       lower3 upper1   upper2    upper3
#> 1 1.0000000 0.000000000 0.000000e+00      1 0.000000 0.0000000
#> 2 0.7733621 0.004579832 6.149053e-06      1 0.840602 1.0000000
#> 3 0.3515974 0.046014074 6.045605e-03      1 1.000000 0.8109318
#> 4 0.0000000 0.053348184 7.195730e-02      0 1.000000 1.0000000
#> 5 0.0000000 0.000000000 1.000000e+00      0 0.000000 1.0000000
#> 6 0.0000000 0.000000000 1.000000e+00      0 0.000000 1.0000000
# Different types of confidence intervals, default is log
summary(pt, times=seq(0, 15, by=3), conf.type="plain")
#> 
#> Prediction from state 1 :
#>   times   pstate1    pstate2     pstate3        se1        se2        se3
#> 1     0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2     3 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3     6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 4     9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 5    12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
#>      lower1 lower2 lower3 upper1    upper2     upper3
#> 1 1.0000000      0      0      1 0.0000000 0.00000000
#> 2 0.7584768      0      0      1 0.2237552 0.06510579
#> 3 0.2329875      0      0      1 0.6815999 0.24152322
#> 4 0.0000000      0      0      0 1.0000000 1.00000000
#> 5 0.0000000      0      1      0 0.0000000 1.00000000
summary(pt, times=seq(0, 15, by=3), conf.type="no")
#> 
#> Prediction from state 1 :
#>   times   pstate1    pstate2     pstate3        se1        se2        se3
#> 1     0 1.0000000 0.00000000 0.000000000 0.00000000 0.00000000 0.00000000
#> 2     3 0.9299816 0.06204689 0.007971491 0.08750408 0.08250577 0.02915069
#> 3     6 0.6776902 0.25229141 0.070018378 0.22689332 0.21903899 0.08750408
#> 4     9 0.0000000 0.47577265 0.524227350 0.00000000 0.53115171 0.53115171
#> 5    12 0.0000000 0.00000000 1.000000000 0.00000000 0.00000000 0.00000000
# When the number of time points specified is larger than 12, head and tail is shown
x <- summary(pt, times=seq(5, 8, by=0.25))
x
#> 
#> Prediction from state 1 (head and tail):
#>   times   pstate1   pstate2    pstate3        se1      se2        se3    lower1
#> 1  5.00 0.9299816 0.0000000 0.07001838 0.08750408 0.000000 0.08750408 0.7733621
#> 2  5.25 0.9299816 0.0000000 0.07001838 0.08750408 0.000000 0.08750408 0.7733621
#> 3  5.50 0.9299816 0.0000000 0.07001838 0.08750408 0.000000 0.08750408 0.7733621
#> 4  5.75 0.9299816 0.0000000 0.07001838 0.08750408 0.000000 0.08750408 0.7733621
#> 5  6.00 0.6776902 0.2522914 0.07001838 0.22689332 0.219039 0.08750408 0.3515974
#> 6  6.25 0.6776902 0.2522914 0.07001838 0.22689332 0.219039 0.08750408 0.3515974
#>       lower2      lower3 upper1 upper2    upper3
#> 1 0.00000000 0.006045605      1      0 0.8109318
#> 2 0.00000000 0.006045605      1      0 0.8109318
#> 3 0.00000000 0.006045605      1      0 0.8109318
#> 4 0.00000000 0.006045605      1      0 0.8109318
#> 5 0.04601407 0.006045605      1      1 0.8109318
#> 6 0.04601407 0.006045605      1      1 0.8109318
#> 
#> ...
#>    times   pstate1   pstate2    pstate3       se1       se2        se3
#> 8   6.75 0.6776902 0.2522914 0.07001838 0.2268933 0.2190390 0.08750408
#> 9   7.00 0.6776902 0.1261457 0.19616408 0.2268933 0.1263832 0.14680748
#> 10  7.25 0.6776902 0.1261457 0.19616408 0.2268933 0.1263832 0.14680748
#> 11  7.50 0.6776902 0.1261457 0.19616408 0.2268933 0.1263832 0.14680748
#> 12  7.75 0.6776902 0.1261457 0.19616408 0.2268933 0.1263832 0.14680748
#> 13  8.00 0.4757726 0.1261457 0.39808165 0.2361409 0.1263832 0.19877253
#>       lower1     lower2      lower3 upper1    upper2    upper3
#> 8  0.3515974 0.04601407 0.006045605      1 1.0000000 0.8109318
#> 9  0.3515974 0.01770389 0.045246782      1 0.8988274 0.8504549
#> 10 0.3515974 0.01770389 0.045246782      1 0.8988274 0.8504549
#> 11 0.3515974 0.01770389 0.045246782      1 0.8988274 0.8504549
#> 12 0.3515974 0.01770389 0.045246782      1 0.8988274 0.8504549
#> 13 0.1798546 0.01770389 0.149604637      1 0.8988274 1.0000000