Hypothesis Testing Review by ubb16013

VIEWS: 6 PAGES: 40

									Hypothesis Testing Review


           χ2 & GAMMA
Example: Men and Women and support for
             Gun Control
 H0 : No difference between men and women
 in support for gun control.
 H1 : Men are not equal to women , men
 could be more or less supportive, at one tail
 of the distribution or the other.
 H2: Men > Women; men more favorable
 than women
 H3: Men < Women; men less favorable.
Compute the Critical Ratio Test
                   ( X 1  X 2)
                t
                        SE

            N1 s12  N 2 s2  N1  N 2 
                           2

            N  N  2  N  N 
      SE                             
            1        2       1 2 

Note the similarities between this t score and
the t score we used to compute confidence
intervals for means
                   Make a Decision
•   Determine which is greater– the t score from the
    table or the t score from your sample computations
•   If the t from your sample is greater than the t* from
    the table, you are significant at the level of α (risk)
    chosen


                     State Results

•   State results in terms of the Null Hypothesis
•   If t* < t, we can reject the null hypothesis
•   If t* > t, we fail to reject the null
Example: Are Conservative parents more strict with
  their children than liberal parents? A study surveyed
  25 Liberal parents and 25 Conservative parents.
  Parents were rated on a scale from 1 (strict) to 100
  (permissive) . Liberal parents had a mean
  permissiveness score of 60 with a std. dev. of 12.
  Conservative Parents have a mean score of 49 with
  a std. dev. of 14.

  Liberal              Conservative
  X1 = 60              X2 = 49
  s1 = 12              s2 = 14
  N1 = 25              N2 = 35
          Decision making steps
•   Step 1: State Hypothesis.
•   What is the null?
    • The null hypothesis is Liberal and
      Conservative parents are not different.
•   What is the Alternative?
    • The null hypothesis is Liberal Parents are
      more permissive (t* < t)
Step 2: Determine Distribution. When
  comparing Sample Means, use t distribution
  (normal distribution for difference of means).
Step 3: Determine Critical Value For the
  Distribution. Set critical value t* at 95%,
  alpha = 5%.
Step 4: Compute the Critical Ratio Test.
  To test the difference between the
  sample mean and the null hypothesis
  we first compute the deviation by the
  standard error of the sample mean.
    Xlib  Xcon        N1s12  N 2 s2  N1  N 2 
                                     2
t              SE   N  N  2  N  N 
                                                 
        SE             1       2       1 2 
Step 4 Continued: (Compute)
                                     60  49  0
                     t
                            25 *12 2  35 *14 2  25  35 
                           
                                                
                                                  25 * 35 
                                25  35  2              
                            11
              t
                    3,600  6,860  60 
                                       
                         58        875 
                  11
        t
           (180.3448)(.0686)

       11     11
  t              3.13
     12.3717 3.52
Step 5: Make Decision-
  Recall Ha was t* < t (one-tailed) with df = n1 + n2 - 2
  = 60 – 2  58 at .05 level
  Computed t was 3.12
  t* from t-table at .05 is 1.671

Step 6: State Conclusion
  1.671 < 3.12
  Therefore, we can reject the null hypothesis that
  liberals and conservatives are equally permissive,
  since t-value of 3.12 is greater than the critical value
  of t of 1.68
CHI SQUARE (χ2)
Why Chi ? (χ2)
   We want to compare two variables,
    but…
   Not all variables are interval-level, so
    we cannot use regression.
   Hypothesis Tests for Difference of
    Means and Difference of Proportions
    only allow us to compare two groups
    with one value.
   We need something else. . .
Imagine a a bag that contained 90 white
marbles and 10 black marbles.
If you drew 10 marbles, how many would you
expect to come up white, and how many
black?
We expect 9 white marbles and 1 black. But
there is some probability that we will get 8/2
and some probability we will get 7/3 …
  What do we do?
• We can compare what we would expect by chance to what we
actually observed.
• We can make a probabilistic statement about the chances of
observing what we did based on our expectations.
• Finally, we test the hypothesis that there is no real difference
between what we observed and what we expected (using the 6 steps
of hypothesis testing.

                        Expected             Observed

   White                9                    ???

   Black                1                    ???
Basic Assumption of the Null
Hypothesis

• There is no difference in the population, the
difference you observe is just the chance variation of
your sample.
•We are comparing observed values (“frequency
actually observed in our sample, written “fo”) to some
set of expected by chance frequencies (written “fe”).
The expected values being chance – with the null
hypothesis holding that the difference between fo
minus fe is really zero and the observed vs. expected
difference is due to sampling error.
 Chi Square (χ2)


• The test statistic for testing hypothesis comparing 2
or more nominal categories
• The Chi Square Statistic compares nominal values in
a cross-tabulation table, making what are called row
by column comparisons or “r x c” tables.
A Nominal variable …
… is a categorical variable with mutually exclusive
categories. For example gender where male = 1 and
female = 2.
Approval for President Clinton by Race


                BLACKS        WHITES


 APPROVE           69            156


DISAPPROVE         21            144
The formula for c2 is:

                                ( fo  fe )
                                              2

                         c 
                         2

                                     fe
OR, sometimes written:

                          (O  E )        2
                     c 2

                             E
Where fo is the observed frequency of each
category in each cell of a table.
 O or fo is what we observe from our sample, the
observed frequency. NOTE that c2 works with
frequencies in each cell.

E or fe is the expected frequency, the number of
people who would show up in each cell IF the null
hypothesis were true, if there was no racial
difference in approval, if the frequencies were due
solely to chance.
    For each cell in the table we compare what
    we observe to what we expect by chance:

   Subtract the value of the hypothetical
    expectancy (fe) from the observed frequency
    (fo) for each cell.
   Square each of these deviations.
   Divide each of the squared differences by the
    expected value of each cell.
   Finally, take the sum of the squared fo- f e
    differences to get χ2 .
The Chi Square statistic tests :
   Whether the difference between what
    you observe and what chance would
    predict is due to sampling error.
   The greater the deviation of what we
    observe to what we would expect by
    chance, the greater the probability that
    the difference is NOT due to chance.
Testing for a Gender Effect for
Approval of Clinton


              Women   Men   Row
                            Marginal
   Oppose
   Approve
   Column
   Marginal
Hypothesis Testing
   Step 1: State Hypothesis
     What is the Null?

     What is the Alternative (Research)
      Hypothesis?
Frequency Table: Approval for
Clinton by Gender
          Women   Men   Row Total

Disapprove 131    204   335

Approve   287     286   573

Column    418     490   908
Total
FIRST STEP: COMPUTE
PERCENTAGE TABLE
   Row margins:
    • 335/908 = 36.9% Disapprove

    • 573/908 = 63.1% Approve

   NOTE: Most Citizens Approve of Clinton
   BUT: We Are Testing for a Gender Effect:
    Are Women more Supportive Than Men?
PERCENTAGIZE TABLE
           Women      Men        Row
                                 Marginal
Disapprove 131/418 => 204/490 => 335/908 =>
               31%        42%        37%
Approve    287/418 => 286/490 => 573/908 =>
               69%        58%       63%
Column       418 =>     490 =>     908 =>
Marginal     100%        100%      100%
INTERPRETATION
   Row Marginal:
    Most Citizens (63%) Approved of Clinton.
   Column Marginal:
    There Are More Men in the Sample (54%).
   Based on the percent table looks like women
    are more supportive of Clinton than are men
    – 69% vs. 58%.

Step #1: Hypotheses:
 Null Hypothesis:
  H0: Women – Men = 0 + Chance
 Cell Percents Show Women More Supportive
   Null Hypothesis Challenged.
    STEP # 2: WHAT IS THE
    DISTRIBUTION?
Categorizing same individuals in two ways:
   Approval and Gender
Looking at the Effect of an Independent Variable
   (Gender) on Dependent Variable (Approval).
This is a classic application for the c2 test.
· 1. We have nominal data in both variables - men vs
   women, approve vs disapprove.
· 2. The data are in the form of frequencies and
· 3. We are looking to see if there is an relationship
   between the two variables.
          Step 3: DETERMINE LEVEL OF
                  SIGNIFICANCE
We set as our standard 95% confidence that the difference we
observe in our study is not due to chance This is equivalent of
setting alpha at risk level of 5% (=.05) for 95% confidence.

      STEP 4: DETERMINE CRITICAL
      VALUE OF c2*
   Degrees of Freedom:
     • (# rows – 1) * (# Columns – 1)

     • Here: (2 – 1) * (2 – 1) = 1 * 1 = 1

   Look up Critical Value of c2* at 5% risk with 1 df and
    find: c2* = 3.84
CHI-SQUARE DISTRIBUTION
STEP 5: MAKE DECISION
   Question: Is the proportion of men and women
    approving Clinton different from what you would
    expect by sampling error in more than 5% of all
    samples?
    Assuming the null hypothesis is true what would be
    the expected values?
   What we need now are the expected values against
    which to compare our observed values. What would
    you expect by assuming the null is true?
           CALCULATING EXPECTED
                         VALUES
   Look at the Marginal Values:
    Note: 63% of all respondents approve
   Therefore, assuming the null is true — that there is no
    gender difference — what would you expect the cell
    percentages to look like?

   37% of women should disapprove as well as 37% of
    men, + sampling error
   63% of women as well as 63% of men should
    approve, + sampling error
   The proportions of men and women approving and
    disapproving should be the same + sampling error
  CONSTRUCT A ―NULL‖ TABLE of fe
            Values

             WOMEN     MEN       TOTALS &
                                 PERCENT
Disapprove                       N = 335
                                 36.9%
Approve                          N = 573
                                 63.1%
             N = 418   N = 490   N = 908
                                 100%
TWO METHODS FOR COMPUTING
EXPECTED VALUES

1.  Method (Easiest):
       Row Margin * Column Margin
                 Total N
Cell a: 335 * 418 / 908 = 140,030 / 908 = 154
Cell b: 335 * 490 / 908 = 164,150 / 908 = 181
Cell c: 573 * 418 / 908 = 239,514 / 908 = 264
Cell d: 573 * 490 / 908 = 280,770 / 908 = 309
2. Null Percentage Method:

If null is true, the Percentage of Men and
Women should be the same. Then
compute the frequency based on that
percentage. Purely for Mathematical
Completeness

   Cell a:   .369 * 418 = 154
   Cell b:   .369 * 490 = 181
   Cell c:   .631 * 418 = 264
   Cell d:   .631 * 490 = 309
CHI-SQUARE: Frequency
Observed & (Expected)
          WOMEN   MEN


Disapprove 131    204           335
                        (181)
          (154)
Approve   287     286           573
                        (309)
          (264)
            418    490          908
KEY QUESTIONS
   How closely do fo values match fe
    values?
   Do the squared fo – fe differences fit the
    null hypothesis?
   Or, are the differences between
    observations and chance expectations
    so deviant as to justify rejection of the
    null?
                    ( f0  fe )
                                 2

             c 
              2

                          fe
CALCULATE CHI-SQUARE
CELL   fo    fe    (fo-fe)   (fo -fe)2 (fo-fe)2
                                       /fe

A      131   154   -23       529       3.44
B      204   181   23        529       2.92
C      287   264   23        529       2.00
D      286   309   -23       529       1.71
                                       =
                                       10.07
     Compare Chi-Square Values:
    Look in table for alpha at .05 with 1 df
    Critical value: 3.84
    Chi-square computed from data: 10.07

     STEP 6: STATE CONCLUSION
•Computed value of chi-square greater than
critical value, therefore, reject the null hypothesis.
•Substantive interpretation?: The difference between
groups on the IV is statistically different from the null
hypothesis.
    Summing up the properties of the c2
                         Distribution:
   c2 distribution ranges from zero to some positive
    value, i.e., „no difference‟ to some „big difference‟.
   c2 distribution is not symmetrical, but skewed to the
    right, from zero to a large positive c2. Chi square
    looks at differences from zero. Its value depends on
    the number of comparisons made, that is, the
    number of df. Note that the critical value of chi
    square gets bigger as the df get bigger, just because
    the more comparisons made the more likely you are
    to find differences, so df corrects for this.
   There are many different c2 distributions. Like the t
    distribution, c2 varies with degrees of freedom.

								
To top