log linear analysis

Upload: kinhaisee

Post on 05-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Log Linear Analysis

    1/11

    HIERARCHICAL LOG-LINEAR ANALYSIS (DR SEE KI N HAI)

    1. An extension of chi-square test to analyze contingency tables of 3 or more variables.

    2. To determine which of the variables and their interactions best explain the observed frequencies.

    3. Variables and interactions are called [Models].4. Goodness-of-fit test statistics are used to assess the degree of correspondence between the Model

    and the Data.5. Statistical significance indicates the Model fails to account totally for the observed frequencies.

    6. Statistical non-significance indicates the Model fits the observed frequencies7. If more than 1 Model fits the data, look for the Model that has the least variables and interactions

    and the simplest one as the preferred Model.

    8. Likelihood ratio chi-square is employed as the test statistics.

    Assumptions

    (Not as critical as parametric methods)

    1. Random Sampling.

    2. Similar shape and variability across the distributions.3. Independent sample.

    Example.

    Table below shows a 3-way contingency showing the relationship between Gender, Attitude Towards

    Science and Science Achievement.

    Attitude Towards Science Science Achievement Gender Margin Totals

    Female Male

    High High 20 30 50Low 40 25 65

    Low High 35 55 90Low 45 50 95

    Margin totals 140 160 300

    1. Enter the data into the [Data View] and [Variable View]

    1

    1 = High, 2 = Low

    1 = Female, 2 = Male

  • 8/2/2019 Log Linear Analysis

    2/11

    2. Weight cases by [Frequency]

    Select [Data] then [Weight Cases..] to open the

    dialogue box. Move [Frequency] into the

    [Frequency Variable] box and select [Weight cases

    by] then [OK].

    Now the [Weight On] is shown in the [Status Bar] below

    3. Select [Analyze] then [Loglinear] and [Model Selection..] to open the dialogue box. Move [Attitude],

    [Achievement] and [Gender] into the [Factors] box then select [Define Range].

    2

  • 8/2/2019 Log Linear Analysis

    3/11

    4. Enter [1] into the [Minimum] box and [2] into the [Maximum] box then select [Continue].

    5. Now select [Attitude] and [Define range]

    Enter [1] into [Minimum] and [2] into [Maximum] and repeat for [Achievement] and select [OK].

    3

  • 8/2/2019 Log Linear Analysis

    4/11

    Interpreting the output

    Extensive output is revealed by this test. It is best you ignore all and examine only the final model.

    1. Ignore all the following tables:

    4

  • 8/2/2019 Log Linear Analysis

    5/11

    5

    Likelihood ratio2

    for the saturated or full model is

    presented first = 0.000 and p =1.000 meaning the

    saturated model provides a perfect fit for the observed

    frequencies and is non-significant.

    The saturated model consists of : 3 main effects

    (Attitude, Achievement and Gender), 3 2-way

    interactions (Attitude*Achievement, Attitude*Genderand Achievement*Gender) and 1 3-way interaction

    (Attitude*Achievement*Gender)

  • 8/2/2019 Log Linear Analysis

    6/11

    6

    The saturated model includes all

    components that they individually may ormay not have contributed to explaining

    the variation in the observed data. Thus, itis necessary to delete components one by

    one to see if this makes the models fit

    worse. If it does this component of the

    model iss kept for the final model. SPSS

    20 begin with full model then delete each

    effect in turn to determine which effects

    make the least significant change in the

    likelihood ratio chi-s uare.

  • 8/2/2019 Log Linear Analysis

    7/11

    2. You only examine this Final Model below: The best-fitting model is presented last. In this case, the

    interaction ofAchievement*Genderand the main effect ofAttitude. This model has likelihood ratio2

    =3.91, DF=3 and p = 0.271 (not significant) which means the observed data can be reproduced with

    these 2 effects ofAchievement*Genderand main effect ofAttitude.

    To interpret the 2 effects of (a) Chi-square test of independence for Achievement and Gender,

    (b) Chi-square test for Goodness of fit for Attitude (Equal expected frequencies) run the analyses

    below.

    How to run (a) Chi-square test of independence for Achievement and Gender

    1. Select [Analyze] then [Descriptive Statistics] to select [Crosstabs..] to open the dialogue box below.

    2. Move [Achievement] into [Row] and [Gender] into [Column] box, then select [Statistics] to openthe sub-dialogue box..[Crosstabs..]

    7

    This table provides the Frequency or counts for

    the data and expected frequency under this model.

    Residual= Observed Count Expected Count =50.000 46.250 = 3.750.

    2 statistics used for Goodness-of-fit:

    1. Likelihood Ratio chi-square commonly used because it has the

    advantage of being linear so that2

    values can be added or

    subtracted.

    2. Pearson Chi-square.

  • 8/2/2019 Log Linear Analysis

    8/11

    3. Select [Chi-square] and [Continue] then click on [Cells]

    4. Select [Observed], [Expected] and [Unstandardized] then

    [Continue] and [OK].

    8

  • 8/2/2019 Log Linear Analysis

    9/11

    How to run (b) Chi-square test for Goodness of fit for Attitude (Equal expected frequencies)

    1. Select [Analyze] then [Non parametric Tests] , [Legacy Dialogs] and [Chi-Square] to open thedialogue box below.

    2. Move [Attitude] into the [Test Variable List] and select [All categories equal] then click [OK]

    9

    This table shows that

    more males (85) are in

    the High achievement

    than the females (55)

    i.e. 85/160 x 100% =53.1% for Male and

    55/140 x 100%=39.3% Female

    However, more

    females are in the Low

    achievement than the

    males

    We can conclude that, there was a significantassociation between the science achievement and gender

    (2

    = 5.75,DF=1 and p = 0.017)

  • 8/2/2019 Log Linear Analysis

    10/11

    Reporting the results

    A three-way frequency analysis was performed to develop a hierarchical linear model of Achievementand Attitude in Female and Male students. Backward elimination produced a model that include themain effect of Attitude and the interaction effect of Achievement and Gender. The model had a

    likelihood ratio2

    = 3.91, p = 0.27, indicating a good fit between the observed frequencies and the

    expected frequencies generated by the model. About 38% of the students had Low Attitude score.About 53% of the male students had High Achievement score as compared with about 39% of the female

    students.

    10

    This table shows that there are morestudents in the Low Attitude score than

    the High Attitude score. It is about

    185/300 x 100% = 61.7% in High and38.3% in Low attitude

    There was a statistical significant difference betweenthe observed and expected frequency for the 2

    categories of Attitude (High and Low) towards

    science (2

    = 16.33,DF=1,p =0.000)

  • 8/2/2019 Log Linear Analysis

    11/11

    COURSEWORK

    Determine the association between the variables in the table below by using the Log-Linear Analysis.

    Mental Ability Maths Achievement Gender Margin TotalsFemale Male

    High High 50 30 80Low 20 15 35

    Low High 35 45 80Low 20 55 75

    Margin Totals 125 145 270

    11