Kul 4 2012 t Test Student.1

download Kul 4 2012 t Test Student.1

of 21

Transcript of Kul 4 2012 t Test Student.1

  • 7/29/2019 Kul 4 2012 t Test Student.1

    1/21

    The t- test

    This test was invented by a called WS Gosset (1867-1937), but preferred to keep anonymous so wrote

    under the name Student.

    require 2 samples which may be from the same

    population.

    These samples need not be of equal #, nor are

    they paired.

    H0: The 2 samples are from the same

    population - any differences are due to chance

    H1: The 2 samples come from different

    populations.

  • 7/29/2019 Kul 4 2012 t Test Student.1

    2/21

    2

    Perbandingan dua nilai tengan (means) Goal: to compare the mean of a numerical variable for

    different groups. Tests one categorical vs. one numerical variable

    Example:

    gender (M, F) vs. height

    Paired vs. 2 samplecomparisons

    Data from the two groups are

    paired

    There is a one-to-onecorrespondence between the

    individuals in the two groups

    Paired designs

  • 7/29/2019 Kul 4 2012 t Test Student.1

    3/21

    Paired designs

    Each member of the pair shares much in common with the

    other, exceptfor the tested categorical variable Example: identical twins raised in different environments

    Can use the same individual at different points in time

    Example: before, after medical treatment

    We have many pairs

    In each pair, there is one member that has one treatmentand another who has another treatment

    Treatment can mean group

    Paired comparisons - setup

    To compare two groups, we use the mean of the

    difference between the two members of each pair

  • 7/29/2019 Kul 4 2012 t Test Student.1

    4/21

    STUDENTS T TEST

    The students t test is used to see if to sets of data differ significantly.

    The method assumes that the results follow the normal distribution (also

    called student's t-distribution) if the null hypothesis is true.

    This null hypothesis will usually stipulate that there is no significant

    difference between the means of the two data sets.

    It is best used to try and determine whether there is a difference between

    two independent sample groups. For the test to be applicable, the sample

    groups must be completely independent, and it is best used when the sample

    size is too small to use more advanced methods.

    Before using this type of test it is essential to plot the sample data from he

    two samples and make sure that it has a reasonably normal distribution, or

    the students t test will not be suitable.

    It is also desirable to randomly assign samples to the groups, whereverpossible.

    http://www.experiment-resources.com/significance-test.htmlhttp://www.experiment-resources.com/null-hypothesis.htmlhttp://www.experiment-resources.com/null-hypothesis.htmlhttp://www.experiment-resources.com/significance-test.html
  • 7/29/2019 Kul 4 2012 t Test Student.1

    5/21

    The Use of the Null Hypothesis Is the difference in two sample populations due to chance or a

    real statistical difference? The null hypothesis assumes that there will be no difference

    or no change or no effect of the experimental treatment.

    If treatment A is no better than treatment B then the nullhypothesis is supported.

    If there is a significant difference between A and B then thenull hypothesis is rejected...

    Test statistic > critical value

    P < alpha

    Reject the null hypothesis

    Statistically significant

  • 7/29/2019 Kul 4 2012 t Test Student.1

    6/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    7/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    8/21

    Sample

    Null hypothesis

    The population mean

    is equal to o

    One-sample t-test

    Test statistic

    t= Yo

    s /n

    Null distribution

    t with n-1 dfcompare

    How unusual is this test statistic?

    P < 0.05 P > 0.05

    Reject Ho Fail to reject Ho

  • 7/29/2019 Kul 4 2012 t Test Student.1

    9/21

    T-test

    T-test determines the probability that the null

    hypothesis concerning the means of two small

    samples is correct

    The probability that two samples are

    representative of a single population

    (supporting null hypothesis) OR two different

    populations (rejecting null hypothesis)

  • 7/29/2019 Kul 4 2012 t Test Student.1

    10/21

    The theory...You have 2 samples which may be from 1

    distribution or 2. To assess the likelihood, find

    how many s.d.s the means of the 2 populations

    are apart:

    How many S.D.s?

    Calculate t = (1 - 2) / pooled sd

    12

    The t test is a parametric test - it

    assumes the data are normally

    distributed.

  • 7/29/2019 Kul 4 2012 t Test Student.1

    11/21

    21

    21

    2

    21

    22

    2

    11

    21

    2

    )1()1(

    nn

    nn

    nn

    snsn

    XXt

    Two Sample Difference of Means T-Test

    2

    21

    22

    2

    11

    2

    )1()1(

    nn

    snsnSp2 =Pooled variance of the two groups

    21

    21

    nnnn = common standard deviation of two groups

    The nominator of the equation captures difference in

    means,

    while the denominator captures the variation within

    and between each group

  • 7/29/2019 Kul 4 2012 t Test Student.1

    12/21

    Contoh

    Test on verbal test scores by gender:Females: mean = 50.9, variance = 47.553, n=6

    Males: mean =41.5, variance = 49.544, n=10

    )10(6

    106

    2106

    544.49)110(553.47)16(

    5.419.50t

    )26667(.826.484.9

    t

    02.134.9t 605.2

    608.34.9 t

    Now what do we do with this obtained

    value?

  • 7/29/2019 Kul 4 2012 t Test Student.1

    13/21

    Steps of Testing and Significance

    1. Statement of null hypothesis: if there is not one then how can you be

    wrong?

    2. Set Alpha Level of Risk: .10, .05, .01

    3. Selection of appropriate test statistic: T-test.

    4. Computation of statistical value: get obtained value.

    5. Compare obtained value to critical value:6. Comparison of the obtained and critical values.

    7. If obtained value is more extreme than critical value, you may reject

    the null hypothesis. In other words, you have significant results.

    8. If point seven above is not true, obtained is lower than critical, then

    null is not rejected.

  • 7/29/2019 Kul 4 2012 t Test Student.1

    14/21

    T table of values (5% = 0.05)For example:For 10 degrees of freedom

    (2N-2)

    The chart value to compare

    your t value to is 2.228

    If your calculated t value is

    between

    +2.228 and -2.228

    Then accept the null

    hypothesis the mean are

    similar

    If your t value falls outside

    +2.228 and -2.228 (larger

    than 2.228 or smaller than -

    2.228)

    Fail to reject the null

    hypothesis (accept the

    alternative hypothesis) there

    is a significant difference.

  • 7/29/2019 Kul 4 2012 t Test Student.1

    15/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    16/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    17/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    18/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    19/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    20/21

  • 7/29/2019 Kul 4 2012 t Test Student.1

    21/21