pseudoci               package:pseudo               R Documentation

_P_s_e_u_d_o-_o_b_s_e_r_v_a_t_i_o_n_s _f_o_r _t_h_e _c_u_m_u_l_a_t_i_v_e _i_n_c_i_d_e_n_c_e _f_u_n_c_t_i_o_n

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

     Computes pseudo-observations for modeling competing risks based on
     the cumulative incidence function.

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

     pseudoci(time,event, tmax)

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

    time: the follow up time. 

   event: the status indicator: 0=alive, 1=dead (risk 1), 2= dead (risk
          2).

    tmax: a vector of time points at which the pseudo-observations are
          to be computed. If missing, the pseudo-observations are
          reported at each event time. 

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

     The function calculates the pseudo-observations for the cumulative
     incidence function for each individual and each risk at all the
     required time points.  The pseudo-observations can be used for
     fitting a regression model with a generalized estimating equation.

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

     A data frame. The first two columns contain the follow up time and
     the status indicator as given by the user. The following columns
     present the pseudo-observations for each of the risks at all the
     required (sorted) time points.

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

     Klein J.P., Gerster M., Andersen P.K., Tarima S.: "SAS and R
     Functions to Compute Pseudo-values for Censored Data Regression."
     _Department of Biostatistics, University of Copenhagen,_ research
     report 07/11.

_S_e_e _A_l_s_o:

     'pseudomean', 'pseudosurv'

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

     library(KMsurv)
     data(bmt)

     #calculate the pseudo-observations
     cutoffs <- c(50,105,170,280,530)
     bmt$icr <- bmt$d1 +  bmt$d3
     pseudo <- pseudoci(time=bmt$t2,event=bmt$icr,tmax=cutoffs)

     #rearrange the data, use only pseudo-observations for relapse
     rel_mask <- c(-1,50,-1,105,-1,170,-1,280,-1,530)
     b <- NULL
     for(j in 3:ncol(pseudo)){
             b <- rbind(b,cbind(bmt,pseudo = pseudo[,j],
                  tpseudo = rel_mask[j-2],id=1:nrow(bmt)))
     }
     b <- b[order(b$id),]
     b <- b[b$tpseudo != -1,]

     # fit the model
     library(geepack)
     fit <- geese(pseudo ~ as.factor(tpseudo) + as.factor(group) + as.factor(z8) +
             z1 - 1, data =b, id=id, jack = TRUE, scale.fix=TRUE, family=gaussian,
             mean.link = "cloglog", corstr="independence")

     #The results using the AJ variance estimate
     cbind(mean = round(fit$beta,4), SD = round(sqrt(diag(fit$vbeta.ajs)),4),
             Z = round(fit$beta/sqrt(diag(fit$vbeta.ajs)),4),
             PVal = round(2-2*pnorm(abs(fit$beta/sqrt(diag(fit$vbeta.ajs)))),4))

