Announcement

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

  • Summary Statistics of Categories Problem

    Hi,

    I'm trying to create and export a summary table for the mean and standard deviations statistics of each category of each variable given the observations = 1 for my dummy: problemgambler.

    When I use:

    eststo S1, title("group 1"): estpost tabstat lowincome Sex ag16g10 Educ2 origin2 i.maritalstatus if problemgambler == 1, statistics(mean sd) columns(statistics) listwise

    This provides me with the mean for the variable over all categories. And when I use:

    eststo S1, title("group 1"): estpost tabstat lowincome i.Sex i.ag16g10 i.Educ2 i.origin2 i.maritalstatus if problemgambler== 1, statistics(mean sd) columns(statistics) listwise

    I get the error 'factor-variable and time-series operators not allowed'

    I'm aware this works:

    bysort problemgambler: sum lowincome i.Sex i.ag16g10 i.Educ2 i.origin2 i.maritalstatus

    But I do not know how to export this way.

    Does anyone have a suggestion to correct this, or do I need to construct a dummy variable for each category and run the initial command?

    Thanks,
    Ben

  • #2
    tabstat does not support factor variables. That's certainly the problem.

    Someone else who uses estpost and eststo routinely may have a positive solution for you. The new table command could be a good way to get what you want.

    Comment


    • #3
      Thank you Nick, I'll look into the table command.

      Comment

      Working...
      X