6
$\begingroup$

From the description: "This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values."

Taken literally, this seems to be saying that we're testing $H_0: \bar{x} = \bar{y}$, but since we know both $\bar{x}$ and $\bar{y}$, it doesn't make sense.

Therefore I'm thinking what they really mean is that the Null Hypothesis is that both samples come from the same distribution, or that the mean of the respective populations is the same. Is that correct?

$\endgroup$
5
$\begingroup$

The quoted sentence:

This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values.

is a reference to the population means not the sample means; it is otherwise misleading and should certainly be clearer but they do t least say "(expected) values", which can only be a reference to population means from which the samples were drawn.

However, you were understandably misled by it and if a student wrote that I would certainly mark it wrong (since it does seem to suggest that it is the sample means being tested for equality, just as it did to you).

Therefore I'm thinking what they really mean is that the Null Hypothesis is that both samples come from the same distribution. Is that correct?

Usually the hypothesis that people wish to test with this hypothesis test is $H_0: \mu_X=\mu_Y$, but when accompanied by the assumptions of the usual equal variance two sample t-test, that's the same as saying they come from the same distribution. The assumption of equal variances is the default for the scipy implementation of this test, but set otherwise it doesn't assume equal variances and then the null doesn't imply that distributions are the same.

That's true of many of the commonly used hypothesis tests -- that the null (when combined with the assumptions) amounts to assuming equal distributions.

$\endgroup$
  • $\begingroup$ Thank you, I didn't know that expected value could only be used in reference to a population. I guess it makes sense since EV is defined as $x \cdot P(X = x)$ and you can't speak of $P(X = x)$ just given a sample. Is it ok to think of populations as Random Variables, then? Or is it not ok because for example in a population you could be sampling without replacement? $\endgroup$ – jeremy radcliff Sep 18 '16 at 23:50
  • $\begingroup$ "...but set otherwise it doesn't assume equal variances and then the null doesn't imply that distributions are the same.". What is the Null Hypothesis in such a case? $\endgroup$ – jeremy radcliff Sep 18 '16 at 23:54
  • $\begingroup$ Values sampled from a population can sometimes be regarded as random variables; you often see statements like "Let $X_1, X_2, ,,,, X_n$ be a set of independent identically distributed values drawn from some distribution $F$"... if your population has distribution $F$ and you're using random sampling, the above statement is talking about the random variables representing your (future) first observation, second observation and so on. $\endgroup$ – Glen_b -Reinstate Monica Sep 18 '16 at 23:55
  • $\begingroup$ @jeremyradcliff In that case the null is just as stated -- it's still equality of means. $\endgroup$ – Glen_b -Reinstate Monica Sep 18 '16 at 23:56
  • $\begingroup$ Ah...yes of course (re: "still equality of means"), equal distributions in the first case because equal means + equal SD's are sufficient to determine that they are equal distributions. Thanks again. $\endgroup$ – jeremy radcliff Sep 18 '16 at 23:58
1
$\begingroup$

A bit more exact, see the docs you quoted

equal_var : bool, optional

If True (default), perform a standard independent 2 sample test that assumes equal population variances [R263]. If False, perform Welch’s t-test, which does not assume equal population variance [R264].

So it either performs student's or Welch's t-test for independent samples. BTW, Welch's test is recommended as of When conducting a t-test why would one prefer to assume (or test for) equal variances rather than always use a Welch approximation of the df?.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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