Announcement

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

  • Concatenating returned results for output to excel (i.e. Median age = XX (XX - XX))

    Hello,

    I would like to be able to combine returned results so that I can putexcel them in a neat format. For example,

    sysuse auto
    summ mpg, detail
    return list

    if I wanted to output just the median mpg I would do this

    putexcel A1 = r(p50)

    What I'm struggling with is how to combine the returned results to output median and IQR in one cell in this format -> XX (XX - XX)

    Can anyone suggest a solution? Many thanks

    Daniel
    (Using Windows 10 STATA 14)


  • #2
    Code:
    putexcel A1 = "Median age = `r(p50)' (`r(p25)' - `r(p75)')"

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      Code:
      putexcel A1 = "Median age = `r(p50)' (`r(p25)' - `r(p75)')"
      Thank you. I wasn't aware you could specify a string directly in the putexcel command.

      Comment

      Working...
      X