Announcement

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

  • Differences in means by sub groups with categorical variables

    Click image for larger version

Name:	Cattura.PNG
Views:	2
Size:	30.0 KB
ID:	1629909


    I found this analysis on a paper that i wanted to replicate with my dataset.
    Basically there are different scores and i want to test the difference in means by groups (like gender) for each score as you can see in the picture.

    In don't know(even if i doubt) if author used a single formula and maybe "appended" it for each column, but as I am at entry level i decied to compute them "manually using the t statistic.

    So i was testing gender using:

    [code]
    ttest score, by (gender)


    Gender is a dummy so it was not a problem but with categorical variables it obviously gives me an error ar there are too many variables.

    Code:
    ttest FL, by (***_income)
    by(): too many variables specified

    In this case i have low_income, med_income, high_income.

    How can I solve this problem? (If there is a way to compute direcly as in the paper table it would be awesome)

    Thanks in advance
    Attached Files

  • #2
    Forgot to mention that even if computing:

    Code:
    ttest FL, by (low_income)
    I would only test low income vs all the other incomes and not low vs med only. How to test the difference between low and med only?

    Comment

    Working...
    X