plot.surv               package:Zelig               R Documentation

_P_l_o_t_t_i_n_g _C_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l_s _f_o_r _S_u_r_v_i_v_a_l _C_u_r_v_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     The 'plot.surv' command generates confidence intervals for
     Kaplan-Meier survival curves

_U_s_a_g_e:

          plot.surv(x, duration, censor, type = "line", plotcensor=TRUE,
                    plottimes = FALSE, int = c(0.025,0.975), ...) 

_A_r_g_u_m_e_n_t_s:

       x: output from 'sim' stored as a list.  Each element of the list
          is the 'sim' output for a particular survival curve.

duration: the duration variable (e.g. lifetime, survival, etc.).

  censor: the censored data

    type: the type of confidence interval.  Defaults to '"line"', which
          draws vertical confidence intervals at observed event times. 
          '"poly"' draws confidence regions using polygons.

plotcensor: default is 'TRUE'. Plots censoring times as a 'rug' object.

plottimes: default is 'FALSE'. Plots step function with indicators at
          observed event times.

     int: vector of quantile limits for the confidence interval. 
          Default is 95% interval.

     ...: Additional parameters passed to 'plot'.

_V_a_l_u_e:

     For survival models, 'plot.surv()' returns vertical confidence
     intervals or polygon survival regions for Kaplan-Meier survival
     curves.  You may save this plot using the commands described in
     the Zelig manual (<URL: http://gking.harvard.edu/zelig>).

_A_u_t_h_o_r(_s):

     John A. Graves <graveja0@gmail.com>

_S_e_e _A_l_s_o:

     The full Zelig manual is available at <URL:
     http://gking.harvard.edu/zelig>, and users may also wish to see
     'plot', 'lines'.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     data(coalition)
     z.out1 <- zelig(Surv(duration,ciep12)~invest+numst2+crisis,
     robust=TRUE,cluster="polar",model="coxph",data=coalition)
     low <- setx(z.out1,numst2=0)
     high <- setx(z.out1,numst2=1
     # Simulate Survival Curves for Each Group
     s.out1 <- sim(z.out1,x=low) 
     s.out2 <- sim(z.out1,x=high)

     # Organize simulated output as a list
     out <- list(s.out1,s.out2)

     plot.surv(x = out, duration = coalition$duration, censor=coalition$ciep12,
               type="line", plottimes=FALSE, plotcensor=FALSE,
               main="Survival", xlab="Time", ylab="Survival")
     ## End(Not run)

