Announcement

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

  • A paired graph w connected observations

    Hi,

    I know that my question is a banality. However, how to present paired data so that the observations of a person (row) are connected and the data points of a variable (column) appear piled. I want to demonstrate, what happened to individual study subjects’ weights during a 3 month intervention.

    Thanks in advance.

    Mikko Lehtovirta

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long id double(weight_start weight_3m)
    31157 59.9 55.7
    40958 95.3 84.1
    50767 77.1 69.3
    60355 79.8 75.2
    60566 74.8 71.4
    end

  • #2
    Mikko: Perhaps take a look at
    Code:
    help twoway pcspike
    For instance, you could do something like this:
    Code:
    gen pre=0
    gen post=1
    twoway pcspike weight_start pre weight_3m post
    after which you could use standard -twoway- options to get your axes, labels, etc. to look the way you'd like.

    Comment


    • #3
      John, thank you very much! I did study pcspike but did not figure out that Stata needs a hint for the start and end points.
      Great!
      BR Mikko

      Comment


      • #4
        Search also this forum for mentions of gr0041.

        Comment


        • #5
          Thank you Nick!

          Comment

          Working...
          X