Announcement

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

  • tabulate average values

    Is there any command that will tabulate average values of another variable for each value of a different variable? I know reg does provide but I want something that also shows the number of obs used to calculate the average etc in the same row.

    ie if var1 has three values: 1, 2, and 3

    then some command that will tabulate the average value of var2 for each value of var1.



    thanks!
    Donovan

  • #2
    Like this?
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . table rep78, c(mean price)
    
    -----------------------
    Repair    |
    Record    |
    1978      | mean(price)
    ----------+------------
            1 |     4,564.5
            2 |     5,967.6
            3 |     6,429.2
            4 |     6,071.5
            5 |       5,913
    -----------------------
    David Radwin
    Senior Researcher, California Competes
    californiacompetes.org
    Pronouns: He/Him

    Comment


    • #3
      Similar to David's suggestion is
      Code:
      . sysuse auto, clear
      (1978 Automobile Data)
      
      . tabulate rep78, summarize(price)
      
           Repair |          Summary of Price
      Record 1978 |        Mean   Std. Dev.       Freq.
      ------------+------------------------------------
                1 |     4,564.5   522.55191           2
                2 |   5,967.625   3,579.357           8
                3 |   6,429.233    3,525.14          30
                4 |     6,071.5   1,709.608          18
                5 |       5,913   2,615.763          11
      ------------+------------------------------------
            Total |   6,146.043    2,912.44          69

      Comment


      • #4
        wow this is great thank you!

        Comment

        Working...
        X