groupkm                package:Design                R Documentation

_K_a_p_l_a_n-_M_e_i_e_r _E_s_t_i_m_a_t_e_s _v_s. _a _C_o_n_t_i_n_u_o_u_s _V_a_r_i_a_b_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     Function to divide 'x' (e.g. age, or predicted survival at time
     'u' created by 'survest') into 'g' quantile groups, get
     Kaplan-Meier estimates at time 'u' (a scaler), and to return a
     matrix with columns 'x'=mean 'x' in quantile, 'n'=number of
     subjects, 'events'=no. events, and  'KM'=K-M survival at time 'u',
     'std.err' = s.e. of log-log K-M.  Confidence intervals are based
     on  log-log S(t). Instead of supplying 'g', the user can supply
     the minimum number of subjects to have in the quantile group ('m',
     default=50). If 'cuts' is given (e.g.
     'cuts=c(0,.1,.2,...,.9,.1)'), it overrides 'm' and 'g'. Calls
     Therneau's 'survfit.km' to get Kaplan-Meiers estimates and
     standard errors.

_U_s_a_g_e:

     groupkm(x, Srv, m=50, g, cuts, u, 
             pl=FALSE, loglog=FALSE, conf.int=.95, xlab, ylab,
             lty=1, add=FALSE, cex.subtitle=.7, ...)

_A_r_g_u_m_e_n_t_s:

       x: variable to stratify

     Srv: a "Surv" object - n x 2 matrix containing survival time and
          event/censoring 1/0 indicator.  Units of measurement come
          from the "units" attribute of the survival time variable. 
          "Day" is the default. 

       m: desired minimum number of observations in a group 

       g: number of quantile groups 

    cuts: actual cuts in 'x', e.g. 'c(0,1,2)' to use [0,1), [1,2]. 

       u: time for which to estimate survival 

      pl: TRUE to plot results 

  loglog: set to 'TRUE' to plot 'log(-log(survival))' instead of
          survival 

conf.int: defaults to '.95' for 0.95 confidence bars.  Set to 'FALSE'
          to suppress bars. 

    xlab: if 'pl=TRUE', is x-axis label.  Default is 'label(x)' or name
          of calling argument 

    ylab: if 'pl=TRUE', is y of
          survival 

  any predictor has more than one value given, 'expand.grid' is
     called to generate all possible combinations of values.  If 'nobs'
     is given, a data frame is first generated which has 'nobs' of
     adjust-to values duplicated.  Then an editor window is opened
     which allows the user to subset the variable names down to ones
     which she intends to vary (this streamlines the 'data.ed' step). 
     Then, if any predictors kept are discrete and 'viewvals=TRUE', a
     window (using 'page') is opened defining the possible values of
     this subset, to facilitate data editing.  Then the 'data.ed'
     function is invoked to allow interactive overriding of predictor
     settings in the 'nobs' rows.  The subset of variables are combined
     with the other predictors which were not displayed with 'data.ed',
     and a final full data frame is returned. 'gendata' is most useful
     for creating a 'newdata' data frame to pass to 'predict'.

_U_s_a_g_e:

     gendata(fit, ...)
     ## S3 method for class 'Design':
     gendata(fit, nobs, viewvals=FALSE,
       editor=.Options$editor, ..., factors)
     ## Default S3 method:
     gendata(fit, ...)

_A_r_g_u_m