chi square tests (part 3)

Upload: kinhaisee

Post on 06-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Chi Square Tests (Part 3)

    1/10

    (Non-Parametric Techniques) Chi-Square Test (2

    ) (PART 3)

    (DR SEE KIN HAI)Fisher's exact test[1][2][3] is a statistical significance test used in the analysis of contingency tables.

    Although in the practice it is employed when sample sizes are small, it is valid for all sample sizes. It is

    named after its inventor, R. A. Fisher, and is one of a class ofexact tests, so called because thesignificance of the deviation from anull hypothesis can be calculated exactly, rather than relying on an

    approximation that becomes exact in the limit as the sample size grows to infinity, as with manystatistical tests.

    Fisher Exact Test (Test of Independence / Relatedness) for min expected f < 5

    1. You use chi-square procedure to compute Fishers exact test for 2 x 2 tables when one or moreof the cells has expected frequency < 5.

    Table shows the number of students from a small school and their preference in games.

    Game A Game B

    Males 2 7

    Females 4 1

    Test your Null hypothesis that the two variables (sex and games) are independent of each other.

    (OR) That the type of games preferred is not related to students gender.

    2. Enter the data into SPSS 20.

    1

    1=Male, 2=Female

    1= Game A, 2 = Game B

    http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-0http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-1http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-2http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-2http://en.wikipedia.org/wiki/Statistical_significancehttp://en.wikipedia.org/wiki/Contingency_tablehttp://en.wikipedia.org/wiki/Sample_(statistics)http://en.wikipedia.org/wiki/Ronald_Fisherhttp://en.wikipedia.org/wiki/Exact_testhttp://en.wikipedia.org/wiki/Exact_testhttp://en.wikipedia.org/wiki/Null_hypothesishttp://en.wikipedia.org/wiki/Null_hypothesishttp://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-0http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-1http://en.wikipedia.org/wiki/Fisher's_exact_test#cite_note-2http://en.wikipedia.org/wiki/Statistical_significancehttp://en.wikipedia.org/wiki/Contingency_tablehttp://en.wikipedia.org/wiki/Sample_(statistics)http://en.wikipedia.org/wiki/Ronald_Fisherhttp://en.wikipedia.org/wiki/Exact_testhttp://en.wikipedia.org/wiki/Null_hypothesis
  • 8/3/2019 Chi Square Tests (Part 3)

    2/10

    3. You have to tell SPSS 20 to count only the [Frequency] by selecting [Data] on the menu bar, then

    click on [Weight Cases]

    4. Click on [Weight cases by] and move [Frequency] into the [Frequency Variable] box then [OK]

    5. Select [Analyze] then [Descriptive Statistics] and [Crosstabs]6. Move [Sex] into [Rows] and [Games] into [Columns] box then select [Statistics] to open the

    dialogue box.

    7. Select [Chi-square] then [Continue] . The previous screen reappears, select [Cells] to open the

    sub-dialogue box.

    2

  • 8/3/2019 Chi Square Tests (Part 3)

    3/10

    8. Now click on [Continue] and [OK] on the previous screen that reappears.

    3

  • 8/3/2019 Chi Square Tests (Part 3)

    4/10

    Interpreting the output for Fishers Exact Chi-Square Test

    4

    This table shows the

    observed [Count] and[Expected Count]

    frequencies of the 4 cells

    Fishers Exact Test = 0.091 at 2-tailed level and 0.063

    at 1-tailed level >p = 0.05 thus not significant

  • 8/3/2019 Chi Square Tests (Part 3)

    5/10

    Reporting the output for Fishers exact test

    1. There was no significant relationship between sex and the types of games (two-tailed Fisher

    exact p = 0.091) or Males and females students do not differ in the frequency of the types of

    games they prefer (two-tailed Fisher exact p = 0.091).

    2. Care must be taken as the sample size is small. The finding can be considered as marginally

    significant and it is recommended that further studies should be done to establish with morecertainty if gender did differ in their games preference.

    COURSEWORK

    The table shows the types of subjects that are favoured by a sample of 104 students from a school.

    You are to find out if gender and the choice of the three subjects are independent of each other. (As

    one of the cells has a frequency < 5 , use Fishers exact test)

    Respondents Subject A Subject B Subject C

    Boys 27 4 19Girls 17 33 4

    ___________________________________________________________

    McNemars Chi-Square Test for 2 related samples

    In statistics,McNemar's test is a non-parametric method used on nominal data (see L26). It is applied

    to 2 2 contingency tables with a dichotomous trait, with matched pairs of subjects, to determinewhether the row and column marginal frequencies are equal ("marginal homogeneity"). It is named

    after Quinn McNemar, who introduced it in 1947.[1] An application of the test in genetics is the

    transmission disequilibrium test for detecting genetic linkage.[2]

    The test is applied to a 2 2 contingency table, which tabulates the outcomes of two tests on a sample

    ofn subjects, as follows.

    Test 2 positive Test 2 negative Row total

    Test 1 positive a b a + b

    Test 1 negative c d c + d

    Column total a + c b + d n

    The null hypothesisof marginal homogeneity states that the two marginal probabilities for eachoutcome are the same, i.e.pa +pb =pa +pc andpc +pd=pb +pd.

    5

    http://en.wikipedia.org/wiki/Statisticshttp://en.wikipedia.org/wiki/Statisticshttp://en.wikipedia.org/wiki/Non-parametrichttp://en.wikipedia.org/wiki/Nominal_datahttp://en.wikipedia.org/wiki/Contingency_tablehttp://en.wikipedia.org/wiki/Dichotomoushttp://en.wikipedia.org/wiki/Dichotomoushttp://en.wikipedia.org/wiki/Quinn_McNemarhttp://en.wikipedia.org/wiki/McNemar's_test#cite_note-McNemar1947-0http://en.wikipedia.org/wiki/Transmission_disequilibrium_testhttp://en.wikipedia.org/wiki/McNemar's_test#cite_note-Spielman93-1http://en.wikipedia.org/wiki/Null_hypothesishttp://en.wikipedia.org/wiki/Null_hypothesishttp://en.wikipedia.org/wiki/Statisticshttp://en.wikipedia.org/wiki/Non-parametrichttp://en.wikipedia.org/wiki/Nominal_datahttp://en.wikipedia.org/wiki/Contingency_tablehttp://en.wikipedia.org/wiki/Dichotomoushttp://en.wikipedia.org/wiki/Quinn_McNemarhttp://en.wikipedia.org/wiki/McNemar's_test#cite_note-McNemar1947-0http://en.wikipedia.org/wiki/Transmission_disequilibrium_testhttp://en.wikipedia.org/wiki/McNemar's_test#cite_note-Spielman93-1http://en.wikipedia.org/wiki/Null_hypothesis
  • 8/3/2019 Chi Square Tests (Part 3)

    6/10

    Thus the null and alternative hypotheses are[1]

    Herepa, etc., denote the theoretical probability of occurrences in cells with the corresponding label.

    The McNemartest statisticis:

    Summary (Practice)1. Use for 2 x 2 contingency tables with a dichotomous trait (Yes/No or Right/Wrong or

    Positive/Negative respond).

    2. It is used to test the difference between paired samples and must be mutually independent pairs.

    The table below shows the number of Sixth Form students from a school who changed or did not

    change their minds about taking Biology after listening to a careers talk by you as the Biology

    teacher. The table gives the numbers who wanted to take Biology before the talk and after it (30),those who wanted to take Biology before the talk but not after it (10), those who wanted to take

    Biology after the talk but not before it (50), and the numbers not wanting to take Biology both

    before and after the talk (32). You are to determine if there was a significant increase in the

    number of students taking your Biology subject after your talk.

    . 1 Before your talk (yes) 2 Before your talk (no)

    1 After talk (yes) 30 502 After talk (no) 10 32

    ______________________________________________________________________

    1. Enter the [Variable view] as below.

    2. Enter the data in the [Data View]

    6

    1=Yes 2=No

    http://en.wikipedia.org/wiki/McNemar's_test#cite_note-McNemar1947-0http://en.wikipedia.org/wiki/Test_statistichttp://en.wikipedia.org/wiki/Test_statistichttp://en.wikipedia.org/wiki/McNemar's_test#cite_note-McNemar1947-0http://en.wikipedia.org/wiki/Test_statistic
  • 8/3/2019 Chi Square Tests (Part 3)

    7/10

    3. Click on [Data] on the menu bar then [Weight Cases]

    4. Select [Analyze] then [Nonparametric Tests] to select [2 Related Samples]

    7

    Select [Weight cases by]

    and move [Frequency] in

    this box then [OK]

  • 8/3/2019 Chi Square Tests (Part 3)

    8/10

    5. Select [Fields] and move [Before] and [After] into [Test Fields] then click on [Run]

    8

  • 8/3/2019 Chi Square Tests (Part 3)

    9/10

    Interpreting the output for a McNemar chi-square test

    9

    Double click on this box to getthe Table below

    The number changes from wanting to

    take Biology 30 to 10 after teacher talk

    The number changes from not takingBiology (32) to 50 after teacher talk

    Total number of cases N=122, chi-

    square= 25.350 at sig levelp = 0.000

    as this is < 0.05

    This indicates that there has been asignificant change in the number of

    students taking Biology after teacher

    talk.

  • 8/3/2019 Chi Square Tests (Part 3)

    10/10

    Reporting the output for a McNemar Chi-square Test

    There was a significant increase in the number of students taking Biology after the teacher had given a

    talk to students.

    COURSEWORK

    The table shows the number of students who have taken a test in Oral English. A total of 100 students

    from a school are each assessed with grades of either a pass (1) or Fail (0). Variable A can be defined

    as students grade before the training in their oral and Variable B can be defined as students gradeafter they have their training. You are to determine if the training in Oral English increases the number

    of student who passes.

    10