Announcement

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

  • Summary statistics for 2 dimensions

    Hi, I would like to do the following: I have a panel dataset with x groups and y years. For each year in my sample, compute the means of variables by group. Then, take the averages across all the years. How may I do this?

  • #2
    you don't say whether you want this for a display in a report or for further use of some kind; you also don't provide a data example (using -dataex-) so, first, read the FAQ; assuming you want this for display, you can use tabulate; here is an example using the auto data set:
    Code:
    sysuse auto
    ta rep78 for, su(price)
    for multiple variables, you would put this is a -foreach- loop; see
    Code:
    h foreach
    note that if you want to suppress the sd's or the N's (or both) there are options for doing this; see
    Code:
    help tabulate twoway

    Comment

    Working...
    X