WLR.flowcytest           package:rflowcyt           R Documentation

_W_e_i_g_h_t_e_d _L_o_g_r_a_n_k _T_e_s_t _f_o_r _t_e_s_t_i_n_g _t_h_e _d_i_f_f_e_r_e_n_c_e_s _b_e_t_w_e_e_n
_t_i_m_e-_t_o-_e_v_e_n_t, _s_u_r_v_i_v_a_l _c_u_r_v_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Using a survival method developed by Flemming and Harrington, this
     function examines the difference in the survival curves of two
     samples in order to determine a distribution difference between
     the two samples. A plot of the two super-imposed survival curves
     is displayed.

_U_s_a_g_e:

     WLR.flowcytest(controldata, stimuldata, title = "", varname = "",
                    na.action.WLR = options()$na.action, rho.test = 0,
                    WLR.plotted=TRUE, MY.DEBUG=TRUE)

_A_r_g_u_m_e_n_t_s:

controldata: numerical vector of observations of the control data for
          one variable 

stimuldata: numerical vector of observations of the stimulated data for
          the same variable as the control 

   title: character string describing the title 

 varname: character string describing the name of the variable 

na.action.WLR: a missing-data filter function.  This is applied to the
          'model.frame' after any subset argument has been used. 
          Default is 'options()$na.action' (as quoted from the
          'survdiff' documentation from the 'survival' package.) 

rho.test: the exponent, $\rho$ in $S(t)^\rho$, where S is the
          Kaplan-Meier estimate of survival; A $\rho$ value of 0
          specifies using the weighted log-rank test, and a value of 1
          specifies using the Peto & Peto modification of the
          Gehan-Wilcoxon test. 

WLR.plotted: boolean; if TRUE, then plot is made; otherwise if FALSE,
          plotting is surpressed; default=TRUE

MY.DEBUG: boolean; if TRUE, the test is printed out with comments; if
          FALSE then these comments are surpressed

_D_e_t_a_i_l_s:

     The null hypothesis is that the two survival curves are the same
     in both samples.  If there is a significant difference then a
     large chi-squared one statistic corresponding to a small p-value
     (usually $<$ 0.05, where the Type I error rate=alpha=0.05) will
     suggest this significance.

     This function uses 'survdiff' in the 'survival' package. The
     following is a direct quote from the 'survdiff' documentation:
     "This function (survdiff) implements the G-rho family of
     Harrington and Fleming (1982), with weights on each death of
     $S(t)^\rho$, where S is the Kaplan-Meier estimate of survival.With
     `$\rho = 0$' this is the log-rank or Mantel-Haenszel test, and
     with `$\rho = 1$' it is equivalent to the Peto & Peto modification
     of the Gehan-Wilcoxon test."

     In this flowcytometry analysis, we are not dealing with the
     proportion of survival, persay, but instead in terms of the
     proportion of observations/cells beyond a certain value of the
     interferon gamma variable.

_V_a_l_u_e:

p.val.1sid.chisq.WLR: p-value associated with a chi-squared statistic
          with one degree of freedom 

chisq.WLR: the chi-squared statistic in the test of the difference in
          survival curves 

   n.WLR: a numeric vector of the number of subjects in the control and
          the stimulated samples, respectively 

 obs.WLR: numeric vector of the weighted observed number of events in
          each sample, control and stimulated, respectively 

 exp.WLR: numeric vector of the weighted expected number of events in
          each sample, control and stimulated, respectively 

 var.WLR: the variance matrix of the test (control, stimulated) 


     A survival plot is also made with the two survival curves, labeled
     "Control" and "Stimulated" and super-imposed on one plot.

_W_A_R_N_I_N_G:

     Usually the FCS object is gated and subset prior to this testing
     and analysis.  Also this function requires the library 'survival'.

_N_o_t_e:

     Other flowcytests are available such as 'pkci2.flowcytest',
     'ProbBin.flowcytest', 'KS.flowcytest', which test the equivalence
     of two sample distributions. Generally, comparing the control and
     stimulated samples of the interferon gamma variable is of
     interest.

_A_u_t_h_o_r(_s):

     A.J. Rossini and J.Y. Wan

_R_e_f_e_r_e_n_c_e_s:

     Harrington, D. P. and Fleming, T. R. (1982). A class of rank test
     procedures for censored survival data. Biometrika 69, 553-566.

_S_e_e _A_l_s_o:

     'pkci2.flowcytest', 'ProbBin.flowcytest', 'KS.flowcytest',
     'runflowcytests',  the function 'survdiff' in the 'survival'
     package.

_E_x_a_m_p_l_e_s:

     if (require(rfcdmin)){

     data.there<-is.element(c("st.1829", "unst.1829", "st.DRT", "unst.DRT"),objects())
     if ( ( sum(data.there) != length(data.there) )){
     ## obtaining the FCS objects from VRC data
     data(VRCmin)
     }

     ## This only serves as an example.  Usually the FCS object is
     ## gated and then subset

     ## HIV negative individual 1829
       IFN.control<-unst.1829@data[1:2000,4]
       IFN.stimul<-st.1829@data[1:2000,4]


     if (interactive()==TRUE){
     par(mfrow=c(2,2))
     WLR.flowcytest(IFN.control, IFN.stimul,
     title="HIV negative individual 1829",
     varname="Interferon Gamma")
     }
     ## HIV positive individual DRT
       IFN.control2<-unst.DRT@data[1:2000,4]
       IFN.stimul2<-st.DRT@data[1:2000,4]

     if (interactive()==TRUE){
     WLR.flowcytest(IFN.control2, IFN.stimul2,
     title="HIV positive individual DRT",
     varname="Interferon Gamma")
     }
     ## This is an artifical example, but one would expect the
     ## distributions of the stimulated and control samples
     ## to be the same in the HIV negative individual 1829
     ## and to be different in the HIV positive individual DRT
     ## The test in this example is a bit contrived but
     ## the bigger picture is achieved.
     }

