## Pages

### Hypothesis Testing got simple ! Part 2

So we are done with One Sample T-test, now as a next step let's learn :

2.  Two Sample T-test

In this test, we hypothesize the mean of two samples to be equal.  In this case the sample are independent e.g.
a. Score of students in English and Maths
b. Score of Male and Female students' population in Maths

We are using the same data as we have used for One sample T-test. Download the data using following link, if haven't already.

## Data for tests

Download the data, keep it at a location and assign the location to library "a" in SAS.

Suppose our null hypothesis is Writing score of Male and Female population is same.

H0   :   Mean (male) = Mean (female)
H1  :   Mean (male) ~= Mean (female)

So Alternative Hypothesis would be scores are not equal.

Let's learn how to test these two samples using T-Test in SAS.

Proc ttest data= a.sample_1 ;
Class female;
Var write;
Run;

As you can see in the above result's picture of T-test, first we need to see the equality of variance - Block # 1. A check of null hypothesis of two samples' variance equality is done. We take a very stringent cut off alpha level of 0.01 here. As p value of this > 0.01,  we are not able to reject the null hypothesis, hence we go with it. There is no issue if you take a relax cut-off of 0.05, then you could reject the null hypothesis.

Now look in the Block # 2. If the variance has been found equal, we follow Pooled test stats, else we go with Satterthwaite stats.

In this case as we say that the variance is equal we check Pooled one.

Now both pooled and Satterthwaite check the null hypothesis of equal mean. p value as for pooled is much less that 0.01, we can reject the null hypothesis and can say that mean is not equal.

In other words, the score of male and female are different.