predict.coxph            package:survival            R Documentation

_P_r_e_d_i_c_t_i_o_n_s _f_o_r _a _C_o_x _m_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     Compute fitted values and regression terms for a model fitted by
     'coxph'

_U_s_a_g_e:

     ## S3 method for class 'coxph':
     predict(object, newdata,
     type=c("lp", "risk", "expected", "terms"),
     se.fit=FALSE, terms=names(object$assign), collapse,
     safe=FALSE, ...)

_A_r_g_u_m_e_n_t_s:

  object: the results of a coxph fit.  

 newdata: Optional new data at which to do predictions. If absent
          predictions are for the  data frame used in the original fit.            

    type: the type of predicted value.  Choices are the linear
          predictor ('"lp"'), the risk score exp(lp) ('"risk"'),  the
          expected number of events given the covariates and follow-up
          time  ('"expected"'), and the terms of the linear predictor
          ('"terms"').  

  se.fit: if TRUE, pointwise standard errors are produced for the
          predictions.  

   terms: if type="terms", this argument can be used to specify which
          terms should be  included; the default is all.  

collapse: optional vector of subject identifiers.   If specified, the
          output will contain one entry per subject rather than one 
          entry per observation.  

    safe: not used in R

     ...: For future methods

_V_a_l_u_e:

     a vector or matrix of predictions, or a list containing the
     predictions  (element "fit") and their standard errors (element
     "se.fit") if the se.fit  option is TRUE.

_S_e_e _A_l_s_o:

     'predict','coxph','termplot'

_E_x_a_m_p_l_e_s:

     fit <- coxph(Surv(time, status) ~ age + ph.ecog + strata(inst), lung) 
     mresid <- lung$status - predict(fit, type='expected') #Martingale resid 
     predict(fit,type="lp")
     predict(fit,type="risk")
     predict(fit,type="expected")
     predict(fit,type="terms")
     predict(fit,type="lp",se.fit=TRUE)
     predict(fit,type="risk",se.fit=TRUE)
     predict(fit,type="expected",se.fit=TRUE)
     predict(fit,type="terms",se.fit=TRUE)

