Announcement

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

  • Boxplots

    Hi, I am relatively new to stata,

    I was wondering if anyone had an advice on how to get box plots next to each other?

    I have 4 repeated measures scores over time

    I would like the box plot for each score 1 for smokers and none smokes next to each other, then score 2 nor smokers next to each other and so on on the same plot.

    I have tried -graph box tscore1 tscore2 tscore3 tscore 4, over( msmoke)- but this displays score1,2,3,4 for non smokers next to each other then a new graph of the same for smokers

    thanks


  • #2
    Hello Josh,

    Welcome to the Stata Forum.

    You may wish to present a brief dispay of your data, as recommended in the FAQ.

    That said, please check whether this example applies to your expectations:

    Code:
    . sysuse bpwide.dta
    (fictional blood-pressure data)
    
    . graph box bp_after, over(sex) over(agegrp)
    
    . graph box bp_after, over(agegrp) over(sex)

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      SJ-14-4 gr0062 . . . . . . . . . . . . Stata tip 121: Box plots side by side
      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . N. J. Cox
      Q4/14 SJ 14(4):991--996 (no commands)
      tip on how to and which data should be plotted side by
      side with box plots

      Comment

      Working...
      X