Hypothesis Test: Comparing Two Groups: Review: One-Sample Test
Hypothesis Test: Comparing Two Groups: Review: One-Sample Test
3. Choose a -level
typically .05, sometimes .10 or .01
5. Calculate the relevant test statistic 6. Compare test statistic to critical value
If test statistic is larger, we reject H0, and accept H1 If it is smaller, we fail to reject H0, and cannot accept H1
Small Sample
Two-sample Test
Hypothesis tests on the difference between
particular sample? Can we infer that the population means are different? Example: test scores for 20 boys, 20 girls
Y-barboys = 72.75, s = 8.80 Y-bargirls = 78.20, s = 9.5
Example: Hypothesis
Issue:
How likely is it to have sample means with a difference of -5.45, if population means are the same (difference=0)?
The C.L.T. defines how sample means (Y The center and width of the sampling distribution This tells us the range of values where Y-bars fall
Hypothesis:
OR
10
12
and 1, 2 for two sampling distributions, the sampling distribution for the difference of two means is normal, with a mean and S.D. The mean is the difference of the means of two sampling distributions
The variance is equal to the sum of variances of two
Data type:
Quantitative: comparing two means Qualitative: comparing two proportions
Sample size:
sampling distributions Large sample, use z test, calculate z-score Small sample, use t test, calculate t-score
One-tailed test:
H0: 1<=2 H1: 1>2 E.g. boys mean test score is higher than girls H0: 1>=2 H1: 1<2 E.g. boys mean test score is lower than girls
15 GOG 502/PLN 504 Youqin Huang 16
Hypotheses:
H0: 1=2 (or 1-2=0); H1: 12 (or 1-20);
Z-test, calculate z-score Q: In which case can we reject H0? When Z is large, it is highly unlikely that the
17
18
Example: Elements
Test score differences for boys and girls
n1=30, Y-barboys = 72.75, sboys = 8.80 n2=30, Y-bargirls = 78.20, sgirs = 9.55
Example: Z-value
Calculate Z-value:
Assume sample sizes are large, use z-test Choose =.05, two-tailed test
Critical Z = 1.96 P=2*0.0107 =0.0214< 0.05 (OR |Observed Z| = 2.30, critical Z = 1.96)
Hypotheses:
rejected, and we can accept that the two groups are different.
GOG 502/PLN 504 Youqin Huang 20
19
Example: T-test
Example setup
Boys: n1=15, Y-bar = 72.75, s1 = 8.80; Girls: n2=15, Y-bar = 78.20, s2 = 9.55 Hypothesis: -level: 0.1
spatial units
Use T-test
Calculate t-score
boys
The critical value for a=0.1, two-tailed t(28)=1.701 |Observed t-value| = 1.63 < Critical Value
Observed t =-1.63
|observed t| > Critical Value
Can we reject the null hypothesis (H0)? No! We fail to reject H0, and we cannot accept
GOG 502/PLN 504 Youqin Huang
Output
Two sample means are different (6 vs. 12.05) Are population means different?
Two-stage decision-making: 1) Levenes Test for Equal Variances (F-test) H0: 1= 2 H1: 1 2 0.121 > 0.05, fail to reject H0, equality of variance assumed, use the first row If Sig. < 0.05, reject H0, equality of variance not assumed, use the second row
about D , thus, reduces a two-sample problem to a one-sample problem Previous hypothesis: H0: 1=2; H1: 12 Now: H0: D=0; H1: D 0
GOG 502/PLN 504 Youqin Huang
32
Example
Critical value for two-tailed t-test at 0.05
level, with df=2? Observed t-score 6.9 > critical value 4.303
Reject H0; two therapies are different.
Benefits of using dependent samples: Many sources of potential bias are controlled
Same sample: same gender, personality Couples: same lifestyle When n1>30, z-score can substitute for the t-score
GOG 502/PLN 504 Youqin Huang 33 GOG 502/PLN 504 Youqin Huang 34
Hypotheses? Conclusion?
GOG 502/PLN 504 Youqin Huang 36
the H1 that two groups are different, develop onetailed H1 and conduct one-tailed test tests; difference is at the stage of finding out the critical value in Z or t-table based on predetermined significance level
One-tailed test:
H0: 1<=2 H1: 1>2 E.g. boys mean test score is higher than girls calculated t >0 and |t| > C.V., reject H0 H0: 1>=2 H1: 1<2 E.g. boys mean test score is lower than girls Calculated t < 0 and |t| > C.V., reject H0
37 GOG 502/PLN 504 Youqin Huang 38
Although we can use the sum of standard errors of two sampling distributions, its preferable to use the following pooled estimate
Calculate test statistic (z-score or t-score) Compare test statistic with the critical value Conclusion
GOG 502/PLN 504 Youqin Huang
10
Example
Do you agree or disagree that women
Example
H0: 1=2;
should take care of running their homes and leave running the country up to men? n1=345, 122 agree (0.35), 223 disagree n2=1900, 268 agree (0.14), 1632 disagree -hat1=0.35, -hat2=0.14; -hat=(122+268)/(345+1900)=0.174
H1: 1 2
Choose the -level=0.05; critical value=1.96 Calculate the z-score: z=-9.6 Significant at 0.05 level; reject H0, and
accept H1, which means two samples are from two different populations.
41
42
Example
H0: 1<=2;
H1: 1 > 2
Choose the -level=0.05; critical value=1.65 Calculate the z-score: z=-9.6 (same
calculation as two-tailed test) Significant at 0.05 level; reject H0, and accept H1, which means the second population is less likely to agree with the statement.
GOG 502/PLN 504 Youqin Huang 43
11
will be errors. Sometimes the null hypothesis is true, but we will reject it
Our alpha-level determines the probability of this
error
45
46
Summary
Type II Error Type I Error
Cannot minimize both types of error. In general, we are most concerned about Type I
Elements of two-sample test Corollary of C.L.T General steps Independent two-sample test of means Dependent two-sample test of means Two-sample test of proportions The issue of errors How to do these tests in SPSS
47
48
12