week 8 - two sample t-test

Upload: jeff-green

Post on 14-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Week 8 - Two Sample T-Test

    1/13

  • 7/27/2019 Week 8 - Two Sample T-Test

    2/13

    Review

    Previously, we looked at 1 sample of data at a time, representing 1 level

    of an IV

    e.g., does a drug for depression reduce feelings of sadness?

    We knew how sad depressed people are in thepopulation.

    We used either aZ-testor a t-test:

    1 sample z-test 1 sample t-test

    1 sample 1 sample

    m for known population m for known population

    s for known population estimate s using s

  • 7/27/2019 Week 8 - Two Sample T-Test

    3/13

    Transition to Two-SampleProblems

    Goal: compare responses of two treatments orcompare the characteristics of two groups.

    We have a separate (i.e. independent) sample fromeach treatment or each population.

    We have neither nor

  • 7/27/2019 Week 8 - Two Sample T-Test

    4/13

    Independent t-test

    The independent t uses the difference between twosample means (i.e. ) to evaluate the differencebetween two population s. The formula for t is:

    t=[( ) (m1m2)]/s( )

    t=(sample mean difference population meandifference)/(estimated standard error)

    Remember: H0 says that the population meandifference is equal to zero (i.e., m1m2 = 0), so theformula can be simplified:

    t=( )/s( )

    sX'

    21XX

    21XX

    21XX

    21XX

  • 7/27/2019 Week 8 - Two Sample T-Test

    5/13

  • 7/27/2019 Week 8 - Two Sample T-Test

    6/13

  • 7/27/2019 Week 8 - Two Sample T-Test

    7/13

  • 7/27/2019 Week 8 - Two Sample T-Test

    8/13

    Question We Are Asking

    Do women flirt more when men think they are attractive thanwhen they think the woman is unattractive?

    Do these groups belong to 2 separate populations (different),

    or the same population (no difference)If H0 is true and we draw pairs of samples from 1

    population with 1 , then we would expect the differences inmeans between the groups to be = 0

    H0: 1 = 2 or12 = 0

    attr - unattr= 0

    H1: 1 > 2 or12 > 0

    attr - unattr> 0

    X X

    X X

  • 7/27/2019 Week 8 - Two Sample T-Test

    9/13

  • 7/27/2019 Week 8 - Two Sample T-Test

    10/13

    Pooled Variance

    A survey wants to know how much your householdspends on groceries each week. Both you and yoursignificant other go shopping, but you go twice a week

    and they go only once a week. You spend $50 eachtime, and he or she spends $100 each time. Thinkingabout this, you know that you dont spend less moneyper week than your significant other. You had to

    weight the amount you spent based on how frequentlyyou went to the store.

  • 7/27/2019 Week 8 - Two Sample T-Test

    11/13

    oo e ar ance an an ar Error of the Difference in

    Means The pooled variance gives us a single value for thestandard error of the mean for our samples. It is notthe same as a combined variance (s21 + s

    22).

    pooled variance = s2p = (SS1 + SS2)/(df1+df2)

    s2p= [(Xi1 1)2 + (Xi2 2)2 ] / [(n1 1) + (n2 1)]

    But, we dont use the pooled variance in the t-formula,we use a pooled standard error:

    s( )= [(s2p/n1) + (s2p/n2)]

    Now you can get your t-statistic

    X X

    21XX

  • 7/27/2019 Week 8 - Two Sample T-Test

    12/13

    Calculate Obtained t

    2

    2

    1

    2

    21

    2

    2

    1

    2

    21212121

    21

    n

    s

    n

    s

    XX

    n

    s

    n

    s

    XX

    s

    XXdft

    pp

    ppxx

    )(

    )()()()()(

    m

    df = (n1 - 1) + (n2 - 1)

  • 7/27/2019 Week 8 - Two Sample T-Test

    13/13

    Calculate Obtained t

    In our example, we get:

    t(21) = (5.64.9) / [(1.662/12) + (1.662/11)]

    = 1.01