Announcement

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

  • How to make a graph of mean and standard deviation?

    Greetings. How can I make this graph of mean and standard deviation in stata? What would the command look like? Variable is "m2" and group is "town".
    Attached Files

  • #2
    Here is an example.
    Code:
    webuse grunfeld,clear
    collapse invest (sd) investsd=invest,by(company)
    gen y1=invest-investsd
    gen y2=invest+investsd
    twoway rcap y1 y2 company ||scatter invest company,scheme(538w)
    Attached Files
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

    Comment


    • #3
      Thank you. A question. No need to install a package in the stata? Your quantitative variable is "invest" and your qualitative variable is "company"?

      Comment


      • #4
        yes,you need not install package. I just give you an example.company is quantity variable, if your group variable is qualitative variable,you can use encode command to make it to be quantity variable and then label the variable by your group variable town.
        Best regards.

        Raymond Zhang
        Stata 17.0,MP

        Comment


        • #5
          If you have the mean and sd, if if you can use - serrbar - command for that matter.
          Best regards,

          Marcos

          Comment

          Working...
          X