Announcement

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

  • generate Table with Percentiles, Panel Data

    Hello,

    I am working with a panel data set containing 550 district variables over 6 years. One observed variable is math4 - the percentage of fourth graders passing a standardized math test. In order to give a quick overview over the data, I want to generate a table, containing the percentiles of students with satisfactory performance with the matching years.

    It should look like this (Percentage of students with satisfactory performance)
    10th 25th...
    1993 f.ex. 21.4 f.ex. 23.4
    1994 f.ex. 31.5 f.ex. 34.5
    Can anyone help me to code such a table? Do I need to reshape my Panel Data?

  • #2
    Code:
    help tabstat

    Comment


    • #3
      Hello Nick,

      thank you very much for your answer.

      If I use the tabstat command, the output is, but this doesn't solve my problem.
      And if I want to specify [tabstat year math4, p1], this will not give me any output.

      . tabstat year math4

      stats | year math4
      ---------+--------------------
      mean | 1996.5 64.61623
      ------------------------------

      Can you tell me how I need to change the code?

      Comment


      • #4
        I'm not a user of -tabstat-, but I see that the syntax description in the -help- for it indicates that the percentile designations p1, p5, ..., etc. are part of the statistics(option). (There are no specific examples of this usage in the -help-, so your confusion here is understandable.) There are some examples showing statistics broken down by ("conditioned on") another variable, and you'll see that they use the by() option. Try this:
        Code:
        tabstat math4, statistics(p10 p25 p50 p75) by(year)
        (Learning to use Stata's extensive -help- system takes some time. Even with a lot of experience, I usually go to the examples before I look at the abstractions embodied in the syntax description, a strategy that works sometimes but not always.)

        Comment


        • #5
          Hello Mike,

          thank you very much for your precise answer, the good advice and the code! It was successful and now I can present the data properly.

          Comment

          Working...
          X