Announcement

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

  • t-test on categorical/factor variables

    Dear community,

    I once again have to ask for your support.
    I use Stata 18 on a Windows System.

    As the caption suggests, I want to carry out a t-test comparing the mean values of a categorical variable.
    The data looks like this:
    i.Education mean control mean treatment mean difference
    Education == 1 (no secondary Education) 0.08 0.08 0
    Education == 2 (secondary Education) 0.7 0.61 0.09
    Education == 3 (tertiary Education) 0.22 0.31 -0.09
    Additionally, the test has to be restricted by sex (either ==1 or ==2) and post_reform == 0
    for "regular" variables, the ttest command sufficied, but I have not been able to find a solution for the categorical variables.

    Thanks in advance!

  • #2
    What is the null hypothesis you want to test?
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      In addition to the exact null-hypothesis, could you give us an example from your data? How to do so is discussed in the FAQ (black bar near the top of this page).
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        thanks Maarten Buis for the reply.
        My data looks roughly like that:
        PersonalID Year Education sex treatment post_reform
        1 2005 [1] no secondary education [1] male [1] yes [0] no
        1 2006 [1] no secondary education [1] male [1] yes [1] yes
        2 2005 [3] tertiary education [2] female [1] yes [0] no
        3 2005 [2] secondary Education [1] male [0] no [0]
        i want to test the mean difference of the treated women/men vs the women/men in the control group.
        My null Hypothesis for this case would be H: mean treated and mean control are significantly different.

        Comment

        Working...
        X