2 Sample Tests - PowerPoint PPT Presentation

About This Presentation
Title:

2 Sample Tests

Description:

Test of equality of population variances ... Small samples, independent groups ... smallest number has rank 1, largest number has rank N (= sum of n1 and n2) ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 34
Provided by: patric53
Category:
Tags: rank1 | sample | tests

less

Transcript and Presenter's Notes

Title: 2 Sample Tests


1
2 Sample Tests Small Samples
  • Small sample, independent groups
  • Test of equality of population variances
  • If variances are equal, t-test
  • If variances are not equal, Wilcoxon Rank Sum
    Test
  • 2. Examples

2
1b. Small samples, independent groups
  • We now turn to the case of comparing means for
    two independent, small samples (ns lt 30).
  • There are 2 ways to do this depending upon
    whether the two population variances are equal or
    different.
  • In order to know which method we should use, we
    have to test the hypothesis H0 ?12 ?22
  • So for small, independent samples, there are
    always 2 steps test the variances, then test the
    means.

3
1b. Small samples, independent groups
  • VERY IMPORTANT POINT
  • We can only use the independent groups t-test
    when the two population variances are equal.
  • We must not assume that ?12 ?22.
  • We must test H0 ?12 ?22.
  • The test of hypothesis about the two population
    variances uses the ratio F (?12 / ?22).

4
1b. Small samples, independent groups
  • On an exam, you must test the hypothesis of equal
    variances before doing the independent groups
    t-test!
  • If H0 ?12 ?22 is rejected, we use the Wilcoxon
    Rank Sum test instead of the t-test.
  • Note before t-test only not before Z test.

5
Test of hypothesis of equal variances
  • Notes
  • Next slide shows a formal statement of test of
    hypothesis about two population variances.
  • Both one-tailed and two-tailed tests are shown.
  • When you test equality of variances before doing
    small sample, independent groups t-test, always
    do a two-tailed test.
  • One-tailed test of equality of variances has
    other uses.

6
Test of hypothesis of equal variances
  • H0 ?12 ?22 H0 ?12 ?22
  • HA ?12 lt ?22 HA ?12 ? ?22
  • or ?12 gt ?22
  • Test statistic F S12
  • S22

7
Test of hypothesis of equal variances
  • Rejection region
  • One-tailed Two-tailed
  • F gt Fa F gt Fa/2
  • d.f. (n1 1), (n2 1)
  • (See note on next slide.)

8
a given in F table is value for upper tail. Since
the F distribution is not symmetric, we have to
compute critical F for lower tail.
a
9
Computing critical F values for lower tail
  • Critical F for upper tail of distribution is
    found in Table VII, using a and d.f.
  • Critical F for lower tail of distribution
  • 1
  • Fa, n2-1, n1-1
  • Note that d.f. are inverted!

10
1b. Small samples, independent groups
  • Now back to our t-test.
  • If you do NOT reject H0 in the test of equality
    of variances, then you can pool the two sample
    variances
  • Sp2 (n1-1)s12 (n2-1)s22
  • n1 n2 - 2

11
1b. Small samples, independent groups
  • H0 ?1 ?2 D0 H0 ?1 ?2 D0
  • HA ?1 ?2 gt D0 HA ?1 ?2 ? D0
  • or ?1 ?2 lt D0
  • Test statistic t D0

Sp2 1 1 n1 n2
(
)
12
1b. Small samples, independent groups
  • Rejection region
  • One-tailed Two-tailed
  • t lt -ta tgtta/2
  • or t gt ta

13
1b. Small samples, independent groups
  • Wilcoxon Rank Sum Test
  • first, combine the two samples and rank order
    all the observations.
  • smallest number has rank 1, largest number has
    rank N ( sum of n1 and n2).
  • separate samples and add up the ranks for the
    smaller sample. (If n1 n2, choose either one.)
  • test statistic rank sum T for smaller sample.

14
1b. Small samples, independent groups
  • Wilcoxon One-tailed Hypotheses
  • H0 Prob. distributions for 2 sampled populations
    are identical.
  • HA Prob. distribution for Population A shifted
    to right of distribution for Population B. (Note
    could be to the left, but must be one or the
    other, not both.)

15
1b. Small samples, independent groups
  • Wilcoxon Two-tailed Hypotheses
  • H0 Prob. distributions for 2 sampled populations
    are identical.
  • HA Prob. distribution for Population A shifted
    to right or left of distribution for Population B.

16
1b. Small samples, independent groups
  • Wilcoxon Rejection region
  • (With Sample taken from Population A being
    smaller than sample for Population B) reject H0
    if
  • TA TU or TA TL

17
1b. Small samples, independent groups
  • Wilcoxon for n1 10 and n2 10
  • Test statistic
  • Z TA n1(n1 n2 1)
  • 2
  • n1n2(n1 n2 1)
  • 12

18
Wilcoxon for n1 10 and n2 10
  • Rejection region
  • One-tailed Two-tailed
  • Z gt Za Z gt Za/2
  • Note use this only when n1 10 and n2 10

19
Example 1
  • A retail store sales consultant is asked to
    determine whether customers at stores which
    require memberships spend more on average than
    customers at ordinary stores where you dont have
    to buy a membership to shop. She surveys as group
    of 7 randomly selected customers leaving
    no-membership-required stores and 8 different
    randomly selected customers leaving
    membersip-required stores, recording the amount
    of their purchases shown on their sales receipts.
    The data are shown below. Is there evidence that
    customers at the membership-required stores, on
    average, spend more money on a single trip to the
    store than customers at no-membership-required
    stores? (a .05)

20
Example 1
  • Amount spent
  • No membership required Membership required
  • 41 44
  • 28 36
  • 38 35
  • 32 43
  • 24 39
  • 36 36
  • 29 50
  • 37

21
Example 1
  • This question involves a test of hypothesis about
    2 population means, using the means of two small,
    independent samples.
  • Thus, the first step is the test of hypothesis
    about the population variances, s12 and s22.

22
Example 1
  • No membership required
  • X 32.57
  • s2 7646 7426.29 36.62
  • 6
  • Membership required
  • X 40.0
  • s2 12992 12800 27.42
  • 7

23
Example 1
  • HO s12 s22
  • HA s12 ? s22
  • F critical F (6, 7, .025) 5.12 (from table)
  • Fobt 36.62 1.355 lt 5.12
  • 27.42
  • Therefore, we can do a t-test.

24
Example 1
  • HO µnon2 µmem2
  • HA µnon2 lt µmem2
  • t critical t (n 2, a) t (13, .05) 1.771
  • s2p 6 (36.62) 7 (27.42) 31.67
  • 13

25
Example 1
  • tobt 40 32.57
  • 31.67 31.67
  • 7 8
  • 7.43
  • 4.524 3.959
  • 7.43 2.55 ? reject HO.
  • 2.913

26
Example 2
  • Many people are confused about the distinction
    between Cajun and Creole cooking. One possible
    distinction is that Cajun food contains more
    cayenne and other peppers and is thus hotter
    than Creole food. To test this hypothesis, the
    heat (measured in Scoville Units) of random
    samples of Cajun and Creole dishes is compared,
    yielding the data on the next slide. Do these
    data support the hypothesis that Cajun dishes are
    hotter than Creole dishes (a .05)?

27
Example 2
  • Scoville Heat Units
  • Cajun Dishes Creole Dishes
  • 3500 3100
  • 4200 4700
  • 4100 2700
  • 4700 3500
  • 4200 2000
  • 3705 3100
  • 4100 1550

28
Example 2
  • Cajun
  • s2 890592.8572 148432.14
  • 6
  • Membership required
  • s2 66334999.98 1055833.33
  • 7

29
Example 2
  • HO s12 s22
  • HA s12 ? s22
  • F critical F (6, 6, .025) 5.82 (from table)
  • Fobt 1055833.33 7.11 gt 5.82
  • 148432.14
  • Therefore, we cannot do a t-test. We do a
    Wilcoxon.

30
Example 2
  • HO Cajun distribution and Creole distribution
    are identical.
  • HA Cajun distribution is shifted to the right
    relative to the Creole distribution.
  • Test statistic T (rank sum total) for Cajun
    dishes
  • T critical TU 66 or TL 39

31
Example 2
  • Scoville Heat Units
  • Cajun Rank Creole Rank
  • 3500 6.5 3100 4.5
  • 4200 11.5 4700 13.5
  • 4100 9.5 2700 3
  • 4700 13.5 3500 6.5
  • 4200 11.5 2000 2
  • 3705 8 3100 4.5
  • 4100 9.5 1550 1
  • 70 35

32
Example 2
  • Check accuracy of rank sum total T
  • TA TB 105 n(n1) 1415 105
  • 2 2
  • TA gt TU 70. Reject HO Cajun dishes are hotter
    than Creole dishes.

33
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com