Announcement

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

  • Calculating mean for different categorical variables

    Hi!

    I have a data set with height measurements based on sex. Sex is coded as 0=females and 1=males. I am trying to figure out how to find the mean age for men and women separately.

    Thanks!

  • #2
    Code:
    tab sex, sum(age)
    or
    Code:
    mean age, over(sex)
    Stata/MP 14.1 (64-bit x86-64)
    Revision 19 May 2016
    Win 8.1

    Comment


    • #3
      or
      Code:
      table sex, contents(mean age)
      or even
      Code:
      regress age ibn.sex, noconstant

      Comment

      Working...
      X