Announcement

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

  • Displaying only the mean values for output table

    Hello Statalists,

    I've been working with survey data and performed the following command:

    svy: mean var1 var2 var3, over(group)

    I get an output which displays the mean, std.dev the confidence interval. However, I would like to display only the mean value in a table output form but can't seem to figure out how this is possible.

    I tried the display r(mean) but that doesn't work, nor does display e(mean)

    Would appreciate your input!

    Thank you in advance

  • #2
    You might want to rephrase your question because I do not understand what you mean.

    You want to export only the mean to MS Word/Latex file? Or you are asking where the result is saved?

    If you are just staring at the result, what is wrong with just ignoring the information you do not need?

    Comment


    • #3
      Ah I missed that, I want to use the putexcel command to carry the value over, but just want to carry the means over.

      Comment


      • #4
        Here's a start

        Code:
        collect: table (group) [pw = your_weight_var], stat(mean var1 var2 var3)
        collect export mytable.xlsx

        Comment


        • #5
          Originally posted by Justin Niakamal View Post
          Here's a start

          Code:
          collect: table (group) [pw = your_weight_var], stat(mean var1 var2 var3)
          collect export mytable.xlsx
          This is very useful, Justin !

          The -collect- command is new to me. Do you know when it was introduced? In Stata 16 together with the new -table-?

          Comment


          • #6
            Hi Joro Kolev

            collect was introduced in Stata 17. Agreed, it's a very useful command!

            Comment


            • #7
              Originally posted by Justin Niakamal View Post
              Hi Joro Kolev

              collect was introduced in Stata 17. Agreed, it's a very useful command!
              I have to explore more and see how -collect- works, but by just looking at the help file this seems like a major innovation to how Stata works.

              Before the -by- construct could only be used on commands that do their job in one shot, mostly -generate-. For example if you run regressions by group, the results just flash in front of your eyes, and the last results overwrite everything done before.

              Now with this -collect- it seems that commands that produce non-immediate results such as -regress- and -summarize- can be used with the -by- construct.

              Comment

              Working...
              X