IntegrateAUC           package:risksetROC           R Documentation

_I_n_c_i_d_e_n_t/_D_y_n_a_m_i_c (_I/_D) _R_O_C _c_u_r_v_e, _A_U_C _a_n_d _i_n_t_e_g_r_a_t_e_d _A_U_C (_i_A_U_C)
_e_s_t_i_m_a_t_i_o_n _o_f _c_e_n_s_o_r_e_d _s_u_r_v_i_v_a_l _d_a_t_a

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

     This function integrates AUC using weights w(t) = 2*f(t)*S(t) as
     discussed in Heagerty and Zheng, 2005.

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

     IntegrateAUC(AUC, utimes, St, tmax, weight="rescale")

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

     AUC: Area under ROC curve at utimes

  utimes: Unique event times for subjects

      St: Estimated survival probability at utimes

    tmax: Maximum time length to be considered

  weight: Either of "rescale" or "conditional"

_D_e_t_a_i_l_s:

     This function estimates time-dependent concordance measure 

                  P(M_i>M_j|T_i<t, T_i<tmax, T_j>t)

     as discussed in the paper from AUC and weights derived from  the
     survival time distribution. The concordance measure is estimated
     under the assumption that smaller of the two event times happened
     before time _tmax_. The resulting measure is an weighted sum of
     estimated AUC at each unique failure time where weights are
     proportional to 2*f(t)*S(t), and T is failure time of interest. 
     If weight="rescale", then the weights are rescaled so that the sum
     of the weights is one. If weight="conditional", it is assumed that
     both the events happened before _tmax_.

_V_a_l_u_e:

     Returns the following item: 

    iAUC: Integrated AUC using w(t) as above as weights

_A_u_t_h_o_r(_s):

     Patrick J. Heagerty

_R_e_f_e_r_e_n_c_e_s:

     Heagerty, P.J., Zheng Y. (2005) Survival Model Predictive Accuracy
     and ROC curves _Biometrics_, *61*, 92 - 105

_E_x_a_m_p_l_e_s:

     library(MASS)
     data(VA)
     survival.time <- VA$stime
     survival.status <- VA$status
     score <- VA$Karn
     cell.type <- factor(VA$cell )
     tx <- as.integer( VA$treat==1 )
     age <- VA$age
     survival.status[VA$stime > 500 ] <- 0
     survival.time[VA$stime > 500 ] <- 500
     library(survival)
     ## first find the estimated survival probabilities at unique failure times
     surv.prob <- unique(survfit(Surv(survival.time,survival.status)~1)$surv)
     fit0 <- coxph( Surv(survival.time,survival.status)
             ~ score + cell.type + tx + age, na.action=na.omit )
     eta <- fit0$linear.predictor
     model.score <- eta

     utimes <- unique( survival.time[ survival.status == 1 ] )
     utimes <- utimes[ order(utimes) ]

     ## find AUC at unique failure times
     AUC <- rep( NA, length(utimes) )
     for( j in 1:length(utimes) )
     {
     out <- CoxWeights( eta, survival.time, survival.status,utimes[j])
     AUC[j] <- out$AUC
     }
     ## integrated AUC to get concordance measure
     iAUC <- IntegrateAUC( AUC, utimes, surv.prob, tmax=365 )

