home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / survival4 / survfit < prev    next >
Encoding:
Text File  |  1997-09-13  |  8.2 KB  |  183 lines

  1.     
  2.     _C_o_m_p_u_t_e _a _s_u_r_v_i_v_a_l _C_u_r_v_e _f_o_r _C_e_n_s_o_r_e_d _D_a_t_a _C_o_m_p_u_t_e_s _a_n _e_s_t_i_-
  3.     _m_a_t_e _o_f _a _s_u_r_v_i_v_a_l _c_u_r_v_e _f_o_r _c_e_n_s_o_r_e_d _d_a_t_a _u_s_i_n_g _e_i_t_h_e_r _t_h_e
  4.     _K_a_p_l_a_n-_M_e_i_e_r _o_r _t_h_e _F_l_e_m_i_n_g-_H_e_r_r_i_n_g_t_o_n _m_e_t_h_o_d _o_r _c_o_m_p_u_t_e_s
  5.     _t_h_e _p_r_e_d_i_c_t_e_d _s_u_r_v_i_v_o_r _f_u_n_c_t_i_o_n _f_o_r _a _c_o_x _p_r_o_p_o_r_t_i_o_n_a_l
  6.     _h_a_z_a_r_d_s _m_o_d_e_l.
  7.     
  8.          survfit( object, data=sys.parent(), weights, subset, na.action,
  9.                    newdata, individual=F, conf.int=.95, se.fit=T,
  10.                type=c("kaplan-meier","flemington-harrington", "fh2"),
  11.                    error=c("greenwood","tsiatis"),
  12.                conf.type=c("log","log-log","plain","none"),
  13.                conf.lower=c("usual", "peto", "modified"))
  14.     
  15.     _A_r_g_u_m_e_n_t_s:
  16.     
  17.            object:
  18.          A formula object or a coxph object.  If a formula
  19.          object is supplied it must have a Surv object as the
  20.          response on the left of the ~ operator and, if desired,
  21.          terms separated by + operators on the right.  One of
  22.          the terms may be a strata object.  For a single sur-
  23.          vival curve the "~ 1" part of the formula is not
  24.          required.
  25.     
  26.              data:
  27.          a data.frame in which to interpret the variables named
  28.          in the formula, or in the subset and the weights argu-
  29.          ment.
  30.     
  31.           weights:
  32.          The weights must be nonnegative and it is strongly
  33.          recommended that they be strictly positive, since zero
  34.          weights are ambiguous, compared to use of the subset
  35.          argument.
  36.     
  37.            subset:
  38.          expression saying that only a subset of the rows of the
  39.          data should be used in the fit.
  40.     
  41.         na.action:
  42.          a missing-data filter function, applied to the
  43.          model.frame, after any subset argument has been used.
  44.          Default is options()a.action.
  45.     
  46.           newdata:
  47.          a data.frame with the same variable names as those that
  48.          appear in the coxph formula.  The curve(s) produced
  49.          will be representative of a cohort who's covariates
  50.          correspond to the values in newdata.  Default is the
  51.          mean of the covariates used in the coxph fit.
  52.     
  53.        individual:
  54.          a logical value indicating whether the data frame
  55.          represents different time epochs for only one indivi-
  56.          dual (T), or whether multiple rows indicate multiple
  57.          individuals (F, the default).  If the former only one
  58.          curve will be produced; if the latter there will be one
  59.          curve per row in newdata.
  60.     
  61.          conf.int:
  62.          The level for a two-sided confidence interval on  the
  63.          survival curve(s).  Default is 0.95.
  64.     
  65.            se.fit:
  66.          a logical value indicating whether standard errors
  67.          should be computed.  Default is true.
  68.     
  69.              type:
  70.          either "kaplan-meier" , "fleming-harrington" or "fh2",
  71.          (only the   first  two characters  are  necessary).
  72.          The  default  is "fleming-harrington" when a coxph
  73.          object is given,  and  it  is "kaplan-meier" otherwise.
  74.     
  75.     _A_r_g_u_m_e_n_t_s:
  76.     
  77.             error:
  78.          either the string "greenwood" for the Greenwood formula
  79.          or  "tsiatis"  for  the  Tsiatis  formula, (only the
  80.          first character  is  necessary).   The  default  is
  81.          "tsiatis"  when a coxph object is given, and it is
  82.          "greenwood" otherwise.
  83.     
  84.         conf.type:
  85.          One of "none", "plain", "log" (the default), or "log-
  86.          log".  Only enough of the string to uniquely identify
  87.          it is necessary.  The first option causes confidence
  88.          intervals not to be generated.  The second causes the
  89.          standard intervals "curve +- k *se(curve)", where k is
  90.          determined from conf.int.  The log option calculates
  91.          intervals based on the cumulative hazard or
  92.          log(survival). The last option bases intervals on the
  93.          log hazard or log(-log(survival)).  These last will
  94.          never extend past 0 or 1.
  95.     
  96.        conf.lower:
  97.          controls modified lower limits to the curve, the upper
  98.          limit remains unchanged.  The modified lower limit is
  99.          based on an `effective n' argument.  The confidence
  100.          bands will agree with the usual calculation at each
  101.          death time, but unlike the usual bands the confidence
  102.          interval becomes wider at each censored observation.
  103.          The extra width is obtained by multiplying the usual
  104.          variance by a factor m/n, where n is the number
  105.          currently at risk and m is the number at risk at the
  106.          last death time.  (The bands thus agree with the un-
  107.          modified bands at each death time.) This is especially
  108.          useful for survival curves with a long flat tail.  The
  109.          Peto lower limit is based on the same effective n argu-
  110.          ment as the modified limit, but also replaces the usual
  111.          Greenwood variance term with a simple approximation.
  112.          It is known to be conservative.
  113.     
  114.          Value:
  115.     
  116.          a survfit object. Methods defined for survfit objects
  117.          are print, plot, lines, and points.  Actually, the
  118.          estimates used are the Kalbfleisch-Prentice
  119.          (Kalbfleisch and Prentice, 1980, p.86) and the
  120.          Tsiatis/Link/Breslow, which reduce to the Kaplan-Meier
  121.          and Fleming-Harrington estimates, respectively, when
  122.          the weights are unity.  When curves are fit for a Cox
  123.          model, subject weights of exp(sum(coef*(x-center))) are
  124.          used, ignoring any value for wt input by the user.
  125.          There is also an extra term in the variance of the
  126.          curve, due to the variance of coef and hence variance
  127.          in the computed weights.  The Greenwood formula for the
  128.          variance is a sum of terms d/(n*(n-m)), where d is the
  129.          number of deaths at a given time point, n is the sum of
  130.          wt for all individuals still at risk at that time, and
  131.          m is the sum of weights for the deaths at that time.
  132.          The justification is based on a binomial argument when
  133.          weights are all equal to one; extension to the weighted
  134.          case is ad hoc.  Tsiatis (1981) proposes a sum of terms
  135.          d/(n*n), based on a counting process argument which
  136.          includes the weighted case.  The two variants of the
  137.          F-H estimate have to do with how ties are handled.  If
  138.          there were 3 deaths out of 10 at risk, then the first
  139.          would increment the hazard by 3/10 and the second by
  140.          1/10 + 1/9 + 1/8.  For curves created after a Cox model
  141.          these correspond to the Breslow and Efron estimates,
  142.          respectively, and the proper choice is made automati-
  143.          cally.  The fh2 method will give results closer to the
  144.          Kaplan-Meier.  Based on the work of Link (1984), the
  145.          log transform is expected to produce the most accurate
  146.          confidence intervals.  If there is heavy censoring,
  147.          then based on the work of Dorey and Korn (1987) the
  148.          modified estimate will give a more reliable confidence
  149.          band for the tails of the curve.
  150.     
  151.          References:
  152.     
  153.          Terry Therneau, author of local function.  Dorey, F.J.
  154.          and Korn, E.L. (1987).  Effective sample sizes for con-
  155.          fidence intervals for survival probabilities.  Statis-
  156.          tics in Medicine 6, 679-87.  Fleming, T. H. and Har-
  157.          rington, D.P. (1984).  Nonparametric estimation of the
  158.          survival distribution in censored data.  Comm. in
  159.          Statistics 13, 2469-86.  Kablfleisch, J. D. and Pren-
  160.          tice, R. L. (1980).   The Statistical Analysis of
  161.          Failure Time Data.  Wiley, New York.  Link, C. L.
  162.          (1984). Confidence intervals for the survival function
  163.          using Cox's proportional hazards model with covariates.
  164.          Biometrics 40, 601-610.  Tsiatis, A. (1981). A large
  165.          sample study of the estimate for the integrated hazard
  166.          function in Cox's regression model for survival data.
  167.          Annals of Statistics 9, 93-108.
  168.     
  169.          print, plot, lines, coxph, Surv, strata.
  170.     
  171.     _E_x_a_m_p_l_e_s:
  172.     
  173.          #fit a Kaplan-Meier and plot it
  174.          fit <- survfit(Surv(time, status) ~ x, data=aml)
  175.          plot(fit)
  176.          # plot only 1 of the 2 curves from above
  177.          plot(fit[2])
  178.          #fit a cox proportional hazards model and plot the
  179.          #predicted survival curve
  180.          fit <- coxph( Surv(admlfuhr, dead) ~ gcs.12, rochadm)
  181.          plot( survfit( fit))
  182.     
  183.