1
$\begingroup$

in the formula for t test, t = (mean1 - mean2)/sqrt[(var1 + var2)/N]

  1. is N the total number of subjects in both groups being compared or the number of subjects in each group or condition?

  2. df = N-2 is N the total number of subjects in both groups being compared or the number of subjects in each group or condition?

$\endgroup$
2
  • $\begingroup$ Where did you get those formulas? The one for $t$ is not consistent with the one for $df$. $\endgroup$
    – whuber
    Commented Jun 11, 2014 at 22:12
  • $\begingroup$ from a statistician, but the p value obtained through excel differs. what is the correct formula? $\endgroup$
    – gliadoc
    Commented Jun 11, 2014 at 23:41

1 Answer 1

3
$\begingroup$

There are two fairly common forms for the independent-samples two-sample t-test:

  1. The assumed-equal-variance form:

    $$t = \frac{\bar {X}_1 - \bar{X}_2}{s_p \cdot \sqrt{\frac{1}{n_1}+\frac{1}{n_2}}}\,,\quad$$ where $s_p = \sqrt{\frac{(n_1-1)s_{1}^2+(n_2-1)s_{2}^2}{n_1+n_2-2}}\,$, with df $\nu=n_1+n_2-2$.

  2. The Welch (unequal variance) approximation:

    $$t = {\overline{X}_1 - \overline{X}_2 \over s_d}\,,$$ where $s_d = \sqrt{{s_1^2 \over n_1} + {s_2^2 \over n_2}}$, with approximate df $\nu= \frac{(s_1^2/n_1 + s_2^2/n_2)^2}{(s_1^2/n_1)^2/(n_1-1) + (s_2^2/n_2)^2/(n_2-1)}.$.


The equation you have is for equal-n, equal-variance and is a simplified version of the first form.

The $N$ in your first formula is the sample size in each group, $n=n_1=n_2$. Your df is then $2n-2$.

The $N$ in your second equation is inconsistent with the $N$ in your first equation - they seem to be being used for different things. Specifically, in the second equation, it seems to represent the total sample size, $n_1+n_2$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.