Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compare 2 categorical variables with 3 groups each

    Hello. I have what I think is a fairly simple question. I am using Stata to compare 3 groups on a categorical variable with 3 levels (3x3 contingency table). So, as an example, I would be comparing the groups of the variable 'race' (Black, Latino, White) across a categorical variable of their beliefs toward the effect of education on wealth (negative impact, no impact, positive impact). So the question that I am asking is: Do Black people, Latino people, and White people differ significantly in their levels of attitudes on this issue and between which groups are there significant differences? I ran a chi square test (actually Fisher's exact test because of some empty expected cell values) and now know that there are significant differences among the groups. Now, how do I check to see what the pairwise differences are (i.e., Black vs. Latino, Latino vs. White, Black vs. White)? Is there a post-hoc test from the Fisher's exact test for this? I have heard of ways to compare standardized residuals or odds ratios to this end, but have not found any details. Or do I need to recode the variables in some way to be more conducive to pairwise testing? Or should I instead go with a multinomial logistic regression? I am trying to do this as simply as possible. Thank you very much in advance for any help and happy holidays!
    Last edited by Jean Charles; 24 Dec 2014, 16:28.

  • #2
    The response variable (negative, none and positive) looks like an ordered category, and so the Fischer test seems inappropriate here. You could use the Kruskal-Wallis test for an omnibus test, and for follow-up individual comparisons you could look into Alexis Dinno's user-written Stata command here.

    As an alternative nonparametric approach, you could use the Dwass-Steel-Critchlow-Fligner test. The algorithm is not complicated--you could Google for it and write your own command. I've done it before as a one-off for a project a while back and it's not difficult to implement. I don't have my code handy anymore or else I would post it here.

    Finally, if your sample is large enough, you could try fitting an ordered-categorical regression model using one of Stata's official commands, e.g., ologit, or perhaps the more general user-written command gologit2 by Richard Williams (type search gologit2 at Stata's command line to see more about it). Then you could avail yourself to postestimation commands such as margins, contrast and pwcompare for individual comparisons.

    Comment


    • #3
      Awesome, thank you very much! I was just looking into the Kruskal-Wallis test, but was unsure about treating the variable as ordinal; but, your suggestions make a lot of sense. Thanks again, and happy holidays!

      Comment


      • #4
        Hello (unfortunately, you didn't use your real name and surname, so please edit it),

        I gather there is also an interesting way of comparing two categorical variables with three groups each.

        If you just want to estimate the magnitude of the association (without minding the ordering), Cramer's V can do the trick.

        However, if you want to evaluate "trends" in terms of an ordered variable (like the one you mentioned, i.e., impact on the level of education, that has 3 levels : negative, neutre, positive), maybe you'd better employ Kedall's tau-b.

        There is an introductory text on Stata (Acock, A Gentle Introduction to Stata: Chapter 6: Ordered Categorical Variables) where the author suggested a way to calculate p-values from Kendall's tau-b.

        Just divide the value by its asymptotic standard error(ASE) and, now having a z-test, check its value in a table with z-score.

        I did it in my thesis and it worked accordingly.

        Keep in mind that, when performing Kendall's tau-b, not only you perform a measurement of trend among ordered variables, but also you estimate the strengh of this association.

        By the way, the Stata commands for a Kendall's tau-b (plus a chi-square test) are easy to remember:

        . tabulate var1 var2, chi2 row taub


        Best,

        Marcos Almeida
        Last edited by Marcos Almeida; 27 Dec 2014, 15:35.
        Best regards,

        Marcos

        Comment

        Working...
        X