Announcement

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

  • #16
    Ok, let me just ask a very simple question then about panel data.
    when using xt commands, if I use xtsum with the same dataex as above:
    Code:
    xtsum price
    Code:
    Variable         |      Mean   Std. Dev.       Min        Max |    Observations
    -----------------+--------------------------------------------+----------------
    price    overall |      5.88   5.946427          1         23 |     N =      25
             between |             .5247378        5.4   6.444444 |     n =       3
             within  |             5.928236   .4355556   22.43556 | T-bar = 8.33333
    xtsum gives the mean over every line, not by actual patients...
    how can I get summaries for the price by num_id (n=3), not by N?

    Comment


    • #17
      How do patients enter here?

      xtsum is irrelevant for that purpose unless num_id is the panel identifier.

      Perhaps use tabstat or summarize with by() or by: as the case may be. But there can't be a single precise answer without a precise definition of summaries.

      Comment


      • #18
        num_id is the panel identifier.

        Code:
        . sum price
        
            Variable |       Obs        Mean    Std. Dev.       Min        Max
        -------------+--------------------------------------------------------
               price |        25        5.88    5.946427          1         23
        Code:
        * sum of price in total data set:
        
        display r(sum)
        147
        
        * mean price per observation
        
        display 147/25
        5.88
        
        * price per actual person
        
        display 147/3
        49
        How can you code for the "price per actual person", n = 3?

        *** EDIT... is it possible to do this without collapsing?
        Last edited by Graham Wells; 09 Oct 2017, 08:14. Reason: clarification

        Comment


        • #19
          Your direct response to my detailed reply in #15 is to say "Ok" and then in #18 (if I understand you correctly) just ask the same question all over again.

          My analysis in #15 implies to me that you are utterly confused about what you're calculating.

          If I'm wrong you'll have to show that before I am able and willing to take this further.

          Sorry if that seems unfriendly or unhelpful, but I can't say more.



          Comment

          Working...
          X