7 the t-test

Upload: pratham130

Post on 05-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 7 The t-test

    1/22

    The t-test

    Inferences about Population Means

  • 8/2/2019 7 The t-test

    2/22

    Questions

    How are the distributions ofz and trelated?

    Given that

    construct a rejection region. Draw a pictureto illustrate.

    What is the standard error of the difference

    between means? What are the factors that

    influence its size?

    01.2;49;14;75:;75: )48,05(.10 tNsHH y

  • 8/2/2019 7 The t-test

    3/22

    Questions (2)

    What are the main uses of the t-test?

    Give a concrete example of the use of the

    {one sample, independent samples, dependent

    samples} t-test. State why the particular testis the right one to choose.

    What is the importance of variance accounted

    for?

  • 8/2/2019 7 The t-test

    4/22

    Confidence intervals in z

    For large samples (N>100) can use z.

    Suppose

    Then

    If

    M

    Mest

    yz

    .

    )(

    N

    N

    yy

    N

    sest

    y

    M1

    )(

    .

    2

    200;5;10:;10:10

    NsHH y

    35.

    14.14

    5

    200

    5.

    N

    sest

    y

    M

    05.96.183.2;83.235.

    )1011(11

    pzy

  • 8/2/2019 7 The t-test

    5/22

    The tDistributionWe use twhen the population variance is unknown (the

    usual case) and sample size is small (N

  • 8/2/2019 7 The t-test

    6/22

    Degrees of Freedom

    For the tdistribution, degrees of freedom are always asimple function of the sample size, e.g., (N-1).

    One way of explaining dfis that if we know the total or

    mean, and all but one score, the last (N-1) score is not free to

    vary. It is fixed by the other scores. 4+3+2+X = 10. X=1.

  • 8/2/2019 7 The t-test

    7/22

    Confidence Intervals in t

    With a small sample size, we compute the same numbers

    as we did for z, but we compare them to the tdistribution

    instead of thez distribution.

    25;5;10:;10: 10 NsHH y

    125

    5.

    N

    sest

    y

    M1

    1

    )1011(11

    ty

    064.2)24,05(. t 1

  • 8/2/2019 7 The t-test

    8/22

    Review

    How are the distributions ofz and trelated?

    Given that

    construct a rejection region. Draw a pictureto illustrate.

    01.2;49;14;75:;75: )48,05(.10 tNsHH y

  • 8/2/2019 7 The t-test

    9/22

    Difference Between Means (1)

    Most studies have at least 2 groups(e.g., M vs. F, Exp vs. Control)[1 v 2sample]

    If we want to know diff in populationmeans, best guess is diff in samplemeans.

    Unbiased:

    Variance of the Difference:

    Standard Error:

    2

    2

    2

    121)var(

    MMyy

    212121 )()()( yEyEyyE

    2

    2

    2

    1 MMdiff

  • 8/2/2019 7 The t-test

    10/22

    Difference Between Means (2)

    We can estimate the standard error of

    the difference between means.

    For large samples, can use z

    2

    2

    2

    1... MMdiff estestest

    diffest

    yy

    diffz 2121 )(

    3;100;12

    2;100;10

    0:;0:

    222

    111

    211210

    SDNy

    SDNy

    HH

    36.100

    13

    100

    9

    100

    4. diffest

    05.;56.5

    36.

    2

    36.

    0)1210(

    pzdiff

  • 8/2/2019 7 The t-test

    11/22

    Independent Samples t (1)

    Looks just like z:

    df=N1-1+N2-1=N1+N2-2

    If SDs are equal, estimate is:

    diffestyy

    difft 2121 )(

    21

    2

    2

    2

    1

    211

    NNNNdiff

    Pooled variance estimate is weighted average:

    )]2/[(])1()1[( 212222112 NNsNsNestPooled Standard Error of the Difference (computed):

    21

    21

    21

    2

    22

    2

    11

    2

    )1()1(.

    NN

    NN

    NN

    sNsN

    est diff

  • 8/2/2019 7 The t-test

    12/22

    Independent Samples t(2)

    21

    21

    21

    2

    22

    2

    11

    2

    )1()1(. NN

    NN

    NN

    sNsNest diff

    diffest

    yy

    difft 2121 )(

    7;83.5;20

    5;7;18

    0:;0:

    2222

    1

    2

    11

    211210

    Nsy

    Nsy

    HH

    47.135

    12

    275

    )83.5(6)7(4.

    diffest

    ..;36.147.1

    2

    47.1

    0)2018(sntdiff

    tcrit= t(.05,10)=2.23

  • 8/2/2019 7 The t-test

    13/22

    Assumptions

    The t-test is based on assumptions of

    normality and homogeneity of variance.

    You can test for both these (make sure

    you learn the SAS methods).

    As long as the samples in each group

    are large and nearly equal, the t-test is

    robust, that is, still good, even thoassumptions are not met.

  • 8/2/2019 7 The t-test

    14/22

    Review

    What is the standard error of the

    difference between means? What are

    the factors that influence its size?

    What are the assumptions of the t-test?

  • 8/2/2019 7 The t-test

    15/22

    Strength of Association (1)

    Scientific purpose is to predict orexplain variation.

    Our variable Y has some variance that

    we would like to account for. There arestatistical indexes of how well our IVaccounts for variance in the DV. Theseare measures of how strongly or closely

    associated our IVs and DVs are. Variance accounted for:

    2

    2

    21

    2

    2

    |

    2

    2

    4

    )(

    YY

    XYY

  • 8/2/2019 7 The t-test

    16/22

    Strength of Association (2)

    How much of variance in Y is

    associated with the IV?2

    2

    21

    2

    2

    |

    2

    2

    4

    )(

    YY

    XYY

    6420-2-4

    0.4

    0.3

    0.2

    0.1

    0.0

    Compare the 1st (left-most) curve with the curve in the

    middle and the one on the right.

    In each case, how

    much of the variance

    in Y is associated

    with the IV, groupmembership? More

    in the second

    comparison. As

    mean diff gets big, so

    does variance acct.

  • 8/2/2019 7 The t-test

    17/22

    Association & Significance

    Power increaseswith association

    (effect size) and

    sample size.

    Effect size:

    Significance =

    effect size X sample

    size.

    pyy /)( 21

    21

    2

    21

    11

    )(

    NN

    yyt

    p

    Increasing sample size does not increase effect size

    (strength of association). It decreases the standard

    error so power is greater. Widely misunderstood.

    N

    yt

    2

    )(

    pooledSD

    XXd 21

  • 8/2/2019 7 The t-test

    18/22

    Estimating Power (1)

    If the null is false, the statistic is nolonger distributed as t, but rather as

    noncentral t. This makes power

    computation difficult. Hays (p. 334) presents an alternative

    method based on strength of

    association, that is, on

    2

    2

    21

    2

    2

    |

    2

    2

    4

    )(

    YY

    XYY

  • 8/2/2019 7 The t-test

    19/22

    Estimating Power (2)

    Based on Hayss method, we find:

    35.22)25(.2

    )75(.]58.228.1[2

    gn

    Suppose alpha is .01, power

    desired is .90, and variance

    accounted for is .25. What is

    n per group? Its 24 (23?) per

    group or 48 all together.

    (Hays says add one moreperson for luck. its wise

    28.1)90(.)1( zz

    58.2)005(.)2/( zz

    Same problem, but variance a/c is .10, need 68/group.

    Same again, but .15, need 43 per group. What if alpha =

    .05?

    2

    22

    )2/()1(

    2

    )1(][

    zzng

  • 8/2/2019 7 The t-test

    20/22

    Dependent t(1)

    Observations come in pairs. Brother, sister, repeated measure.

    ),cov(2 212

    2

    2

    1

    2 yyMMdiff

    Problem solved by finding diffs between pairs Di=yi1-yi2.

    1

    )(2

    2

    N

    DDs

    i

    D

    N

    sest DMD .N

    DD

    i )(

    MDest

    DEDt

    .

    )( df=N(pairs)-1

  • 8/2/2019 7 The t-test

    21/22

    Dependent t (2)

    Brother Sister

    5 7

    7 8

    3 35y 6y

    Diff2 1

    1 0

    0 1

    1D

    58.3/1. MD

    est

    72.158.

    1

    .

    )(

    MDest

    DEDt

    1

    1

    )(2

    N

    DDsD

    2)( DD

    df=2; n.s.

  • 8/2/2019 7 The t-test

    22/22

    Review

    What are the main uses of the t-test?

    Give a concrete example of the use of the

    {one sample, independent samples, dependent

    samples} t-test. State why the particular testis the right one to choose.

    What is the importance of variance accounted

    for?