Announcement

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

  • <Graph with mean and 95% CI>

    Dear all,

    I am a new user in STATA. I have encountered some problems in making line graphs. My graph is studying the pressure (y variables) over a time period (x variable). However, i would like to only show plots at specific time points such as 1 month, 3 month, 5 month and 7 month (similar to the attached figure 1), together with the 95% CI. My x variable is non-integers (6 month expressed as 0.5). I am not sure how to produce it.

    Attached is the dataset I have obtained, where I have included subjects identification, eyes (0=left eye; 1= right eye), medication (0=drug A; 1= drug B), duration is expressed in terms of years. However, i would like to only show plots at specific time points such as 1 month, 3 month, 5 month and 7 month.

    I used the command and showed the graph (which was rather messy) as attached.

    sort time
    twoway (line pressure duration if medication==0) (line pressure duration if medication==1)

    Thank you very much if someone can kindly provide some suggestions. Thank you so much!

    Best,
    William
    Attached Files

  • #2
    Repeated question. If interested, please follow https://www.statalist.org/forums/for...xed-time-point

    Comment

    Working...
    X