580 likes | 654 Views
Session 7: Two Sample Hypotheses (Zar, Chapter 8). Two-Sample Hypotheses:. The General Setting: Two Populations:. H o : Population 1 = Population 2. Alternatives can be (1) Specific: Pop 1 = 2 x Pop 2. H A : ?. (2) General: Pop 1 > Pop 2 Pop 1 < Pop 2
E N D
Session 7: Two Sample Hypotheses (Zar, Chapter 8)
Two-Sample Hypotheses: The General Setting: Two Populations: Ho : Population1 = Population2 Alternatives can be (1) Specific: Pop1 = 2 x Pop2 HA: ? • (2) General: Pop1 > Pop2 • Pop1 < Pop2 • Pop1 ≠ Pop2
Two-tailed Hypothesis Two one-tailed Hypotheses Question: What facet of the populations are we to compare? • (1) Compare Means Indep. Samples Indep. Statistics Recall: Test:
Reformulate: Two-Tailed: One-tailed: Assumption: s1and s2 unknown! • How to set up the statistic? • Form a t-test!
C1 C2 a/2 a/2 H0:m1=m2 versus HA:m1m2 Reject H0 Reject H0 Accept H0 0
or Summarize: Accept H0 Reject H0
Two-sided: Accept H0 One-sided: Accept H0 Accept H0
Example 8.2 Two fertilizers: Is the newer better than the present?
Problem is that the simple estimate of is What if we can’t assume s1=s2? can’t be transformed into a c2 like Problem known as the Behrens-Fisher Problem • Solution: the Welsh approximate t • (The Separate Variance Estimate) • Satterthwaite’s approximate t
Form: which should be approximated by a t-distribution with some number of degrees o freedom! The question was how to determine the number of degrees of freedom? Welsh did it! Satterthwaite!
So what is the d.f.? Problem for class: • Note: n will not usually be an integer. Use • (1) [n] for d.f. and ta,[n] or • (2) interpolate t between [n] and [n+1].
Power and Sample size – 2 Means Pooled t-test (n1=n2) So
Separate Variance t-test (n1=n2) or where
Two-sided Two One-sided Tests of Variance: Recall: Under H0:
The “F” distribution • Attributed to Fisher by Snedecor in 1934.
Two-sided Two One-sided Rewrite:
Reject H0 Reject H0 C2 C1 Accept H0 F(24,24)
Under H0 , s12=s22 and test If either inequality is true Reject H0
A second look: So the two-sided test of H0 becomes: For the one-sided tests:
Test s12=s22 Yes No N m1=m2 pooled Y m1=m2 Welsh N Y Problem with this test procedure:
Rule of Thumb: 1) If there is no more than a 2-10 times difference, Use pooled. 2) If the mean and variance (or sd) vary together, Use a transformation of the data.
Test of ranks: Developed simultaneously by Wilcoxon and Mann&Whitney 1947. The Mann-Whitney version is easier to explain and implement: • H0: Ranks of group 1 = Ranks of group 2 • HA: Ranks of group 1 Ranks of group 2 • (1) Order (rank) the data without regard to group, either • (a) smallest to largest • (b) largest to smallest (2) Assign the ranks to the groups and sum:
If max {n1,n2}>40 or • min {n1,n2}>20, • Use
Example 8.13: • H0: Male and female students are the same height. • HA: Male and female students are not the same height. • or • H0:Ranks males = Ranks females • HA: Ranks males ≠ Ranks females Rank from Largest to Smallest
Males Females Male Rank Female Rank n1 =7 n2 =5 L S R1=30 R2=48 S L R1=61
The one-sided tests: The Appropriate Test Statistic for the One-Tailed Mann-Whitney Test
If max{n1,n2}> 40 or min{n1,n2}>20, choose U or U’ from table and call it U*, and calculate • Example 8.14 – One-sided test of typing speed • Ho: Typing speed is not greater in college students having • had high school typing training. • HA: Typing speed is greater in college students having had • high school typing training. • a = 0.05
Ranking from low to high HA:data of group 1 > data of group 2 Use U’ as the test statistic (Table 8.2)
Tied ranks • Average the ranks of the tied!
Normal Approximation with tied groups: • Then test z as for the no-tied case: • 1-sided: z> Ka(1) (Table B.2) , reject • 2-sided |z| > Ka/2 (Table B.2), reject A continuity correction can be used: Mann-Whitney can be used on any data that is ordered (See Ex 8.15)
1) Calculate median of both groups combined Test of Medians: 2) Calculate # above and # below median in each group 3) Calculate the 2 by 2 table: And Fisher-exact or c2
Example 8.18 • The two-sample median test, using the data of Example 8.17. • Ho: the median performance is the same under the • two teaching assistants). • HA: The medians of the two sampled populations are not equal. Median is the 13th lowest (C+):
Test of Proportions: Binomial Data Calculate c2