pseudosurv              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 _K_a_p_l_a_n-_M_e_i_e_r _e_s_t_i_m_a_t_e

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

     Computes pseudo-observations for modeling survival function based
     on the Kaplan-Meier estimator.

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

     pseudosurv(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.

    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 value of
     the survival function at prespecified time-points for each
     individual. 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 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', 'pseudoci'

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

     library(KMsurv)
     data(bmt)

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

     #rearrange the data
     b <- NULL
     for(j in 3:ncol(pseudo)){
             b <- rbind(b,cbind(bmt,pseudo=pseudo[,j],tpseudo=cutoffs[j-2],
                  id=1:nrow(bmt)))
     }
     b <- b[order(b$id),]

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

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

