poolVar                package:limma                R Documentation

_P_o_o_l _S_a_m_p_l_e _V_a_r_i_a_n_c_e_s _w_i_t_h _U_n_e_q_u_a_l _V_a_r_i_a_n_c_e_s

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

     Compute the Satterthwaite (1946) approximation to the distribution
     of a weighted sum of sample variances.

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

     poolVar(var, df=n-1, multiplier=1/n, n)

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

     var: numeric vector of independent sample variances

      df: numeric vector of degrees of freedom for the sample variances

multiplier: numeric vector giving multipliers for the sample variances

       n: numeric vector of sample sizes

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

     The sample variances 'var' are assumed to follow scaled chi-square
     distributions. A scaled chi-square approximation is found for the
     distribution of 'sum(multiplier * var)' by equating first and
     second moments. On output the sum to be approximated is equal to
     'multiplier * var' which follows approximately a scaled chisquare
     distribution on 'df' degrees of freedom. The approximation was
     proposed by Satterthwaite (1946).

     If there are only two groups and the degrees of freedom are one
     less than the sample sizes then this gives the denominator of
     Welch's t-test for unequal variances.

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

     A list with components 

     var: effective pooled sample variance

      df: effective pooled degrees of freedom

multiplier: pooled multiplier

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

     Gordon Smyth

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

     Welch, B. L. (1938). The significance of the difference between
     two means when the population variances are unequal. _Biometrika_
     *29*, 350-362.

     Satterthwaite, F. E. (1946). An approximate distribution of
     estimates of variance components. _Biometrics Bulletin_ *2*,
     110-114.

     Welch, B. L. (1947). The generalization of 'Student's' problem
     when several different population variances are involved.
     _Biometrika_ *34*, 28-35.

     Welch, B. L. (1949). Further note on Mrs. Aspin's tables and on
     certain approximations to the tabled function. _Biometrika_ *36*,
     293-296.

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

     #  Welch's t-test with unequal variances
     x <- rnorm(10,mean=1,sd=2)
     y <- rnorm(20,mean=2,sd=1)
     s2 <- c(var(x),var(y))
     n <- c(10,20)
     out <- poolVar(var=s2,n=n)
     tstat <- (mean(x)-mean(y)) / sqrt(out$var*out$multiplier)
     pvalue <- 2*pt(-abs(tstat),df=out$df)
     #  Equivalent to t.test(x,y)

