varbin                  package:aod                  R Documentation

_M_e_a_n, _V_a_r_i_a_n_c_e _a_n_d _C_o_n_f_i_d_e_n_c_e _I_n_t_e_r_v_a_l _o_f _a _P_r_o_p_o_r_t_i_o_n

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

     This function computes the mean and variance of a proportion from
     clustered binomial data (n, y), using various  methods. Confidence
     intervals are computed using a normal approximation, which might
     be inappropriate when the  proportion is close to 0 or 1.

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

     varbin(n, y, data, alpha = 0.05, R = 5000)

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

       n: The denominator of the proportion.

       y: The numerator of the proportion.

    data: A data frame containing the data.

   alpha: The significance level for the confidence intervals. Default
          to 0.05, providing 95% CI's.

       R: The number of bootstrap replicates to compute the bootstrap
          mean and variance.

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

     Five methods are used for the estimations. Let us consider N
     clusters of sizes n_1, ..., n_N with observed responses (counts)
     y_1, ..., y_N. We note p_i = y_i / n_i the observed proportions (i
     = 1, ..., N). An underlying assumption is that the theoretical
     proportion is homogeneous across the clusters.

     *Binomial method:* the proportion and its variance are estimated
     as p = sum(y_i) / sum(n_i) and p * (1 - p) / sum(n_i - 1),
     respectively.

     *Ratio method:* the one-stage cluster sampling formula is used to
     estimate the variance of the ratio estimate (see Cochran, 1999, p.
     32 and p. 66). The proportion is estimated as above (p).

     *Arithmetic method:* the proportion is estimated as p_A = sum(y_i
     / n_i) / N, with estimated variance [1/(N * (N - 1))] sum((p_i -
     p_A)^2).

     *Jackknife method:* the proportion p_J is the arithmetic mean of
     the pseudovalues pv_i, with estimated variance [1/(N * (N -
     1))]sum((pv_i - p_J)^2) (Gladen, 1977, Paul, 1982).

     *Bootstrap method:* R samples of size N are drawn with equal
     probability from the initial sample (p_1, ... , p_N) (Efron and
     Tibshirani, 1993). The bootstrap estimate p_B and its estimated
     variance  are the arithmetic mean and the empirical variance
     (computed with denominator R - 1) of the R binomial  estimates,
     respectively.

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

     An object of formal class "varbin", with 5 slots: 

    CALL: The call of the function.

     tab: A 4-column data frame giving for each estimation method the
          mean, variance, upper and lower limits of the (1 - alpha)
          confidence interval.

    boot: A numeric vector containing the R bootstrap replicates of the
          proportion. Might be used to compute other kinds of CI's for
          the proportion.

   alpha: The significance level used to compute the (1 - alpha)
          confidence intervals.

features: A numeric vector with 3 components summarizing the main
          features of the data: 'N' = number  of clusters, 'n' = number
          of subjects, 'y' = number of cases.


     The "show" method displays the slot 'tab' described above,
     substituting the standard error to the variance.

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

     Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot
     renaud.lancelot@cirad.fr

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

     Cochran, W.G., 1999, 3th ed. _Sampling techniques_. Wiley, New
     York.
      Efron, B., Tibshirani, R., 1993. _An introduction to the
     bootstrap_. Chapman and Hall, London.
      Gladen, B., 1977. _The use of the jackknife to estimate
     proportions from toxicological data in the presence  of litter
     effects_. JASA 74(366), 278-283.
      Paul, S.R., 1982. _Analysis of proportions of affected foetuses
     in teratological experiments_.  Biometrics 38, 361-370.

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

     'varbin-class', 'boot'

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

       data(rabbits)
       varbin(n, y, rabbits[rabbits$group == "M", ])
       by(rabbits,
          list(group = rabbits$group),
          function(x) varbin(n = n, y = y, data = x, R = 1000))
       

