Announcement

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

  • How to generate means table

    Hi.

    I have 3 independant variables and alot of dependant variables. I am trying to get one table the means of all depedant variables in connection with the independant variables.
    However i am able to get them only separately.


    tabstat healthsat no_hosp_visit mcs, by(unemp_pc) stat(mean n)

    Summary statistics: mean, N
    by categories of: unemp_pc

    unemp_pc | health~t no_hos~t mcs
    ---------+------------------------------
    0 | 6.870635 .7070358 48.45468
    | 76551 38148 20871
    ---------+------------------------------
    1 | 6.574338 .6651163 48.7111
    | 491 215 90
    ---------+------------------------------
    Total | 6.868747 .7068008 48.45578
    | 77042 38363 20961
    ----------------------------------------

    But i am only interested in the dummy var==1.


    ANd for the other covariates which are alsi dummy variables i am using different command.

    tabstat age_1, by(healthsat) stat(mean)

    tabstat age_1, by(no_hosp_visit) stat(mean)

    tabstat age_1, by(mcs) stat(mean)


    Is there any way i can have just one output table for all variables (just for the dummy variables i am interested in).


    Thank you in advance,

    Tamara





  • #2
    Please use formatting when posting messages.

    Try the following code, then tweak where necessary
    Code:
    sysuse auto, clear
    tabstat price, stats(mean N), if foreign==1
    tabout rep78 mpg using "C:\temp\delme.html" if foreign==1, c(mean price) sum oneway replace
    Best, Sergiy Radyakin

    Comment

    Working...
    X