Hypothesis testing for two large samples examines again if there is a difference between the two means. We infer that there is a difference between the population means by seeing if there is a difference between the sample means. The assumptions for testing for the difference between two means are below.
- Subjects are randomly selected and independently assigned to groups
- Population is normally distributed
- Sample size is greater than 30
The hypotheses can be stated as follows
- Null hypothesis: There is no difference between the population means of the two groups
- The technical way to say this is… H0: μ1 = μ2
- Alternative hypothesis: There is a difference between the population means of the two groups. One is greater or smaller than the other
- The technical way to say this is… H1: μ1≠ μ2 or μ1> μ2 or μ1< μ2
The process for conducting a z test for independent samples is provided below
- Develop your hypotheses
- Determine the level of significance (normally .1, .05, or .01)
- Decide if it is a one-tail or two tail test.
- Determine the critical value of z. This is found in chart in the back of most stat books common values include +1.64, +1.96, or +2.32
- Calculate the means and standard deviations of the two samples.
- Calculate the test for the two independent samples. Below is the formula
z = (sample mean 1 – sample mean 2)
√[(variance of sample 1 squared/ sample population 1) +
(variance of sample 2 squared/ sample population 2)]
7. If the computed z is less than the critical z then you do not reject your null hypothesis. This means there is no difference between the means. If the computed z is greater than the critical z then you reject the null hypothesis and this indicates that there is evidence that there is a difference.
Below is an example
A business man is comparing the price of buildings in two different provinces to see if there is a difference. Below are the results. Determine if the buildings in Bangkok cost more than the buildings in Saraburi.
Bangkok Saraburi
average price 2,140,000 1,970,000
variance 226,000 243,000
sample size 47 45
Now let us go through the steps
- Develop your hypotheses
- Null hypothesis: There is no difference between the average price of buildings in Bangkok and Saraburi
- In stat language, it would be
- H0: μ1 ≠ μ2
- Alternative hypothesis: The average price of buildings in Bangkok is higher than in Saraburi
- In stat language, it would be
- H1: μ1 > μ2
- Null hypothesis: There is no difference between the average price of buildings in Bangkok and Saraburi
- Determine the level of significance (normally .1, .05, or .01)
- We will select .05
- Decide if it is a one-tail or two tail test.
- This is a one-tail test. We want to know if one mean is greater than another. Therefore, to reject the null we need a z computed that is positive and larger than our z critical.
- Determine the critical value of z. This is found in chart in the back of most stat books common values include +1.64, +1.96, or +2.32 when it is a two tailed test
- Our z critical is + 1.64 since this is a one-tail test we only have one value so we do not split the probable and place have on one side and half on the other side. If this were two-tailed we would have -1.96 and +1.96 which indicates that the difference is greater or less
- Calculate the means and standard deviations of the two samples.
- Already done in the table above
- Calculate the test for the two independent samples. Below is the formula.
(2,140,000 – 1,970,000)
√[((226,000)²)/47) + ((243,000)²)/45)]
our final answer for are z computed is 3.47
Since 3.47 is greater than our z critical of +1.64 we reject the null hypothesis and state that there is evidence that building prices are higher in Bangkok than in Saraburi.
Pingback: Analyzing Quantitative Data: Inferential Statistics | educationalresearchtechniques
Pingback: Comparing Samples in R | educationalresearchtechniques