Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Before and After Pairwise Plots


From   C Rose <junk7@microserf.org.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Before and After Pairwise Plots
Date   Fri, 19 Oct 2007 11:45:43 +0100

Dear all

I'm very new to Stata, so please excuse me if this has been answered before.

I'd like to know how to produce a plot that shows how a dependent variable, measured for a number of individuals, changes after an intervention. I have managed to find an FAQ on the topic for older versions of Stata, which explains the situation quite clearly (please see http://www.stata.com/support/faqs/graphics/vplplot.html), as does the referenced paper. I'm using Stata/IC v10.

It seems the "twoway pcspike" command is appropriate, but I have two questions about this:

1. This requires one to have data in the form y1 x1 y2 x2. I have two variables: the dependent variable, Y, and a categorical variable that indicates whether the corresponding entry in Y was measured pre- or post-intervention. How can I (easily!) convert my data into the y1 x1 y2 x2 form? (It would be nice if this were to generalise to the case where I have measurements on Y at more than two time points.)

2. How do I get "twoway pcspike" to place the correct categorical label on the x-axis, rather than the values I used in x1 and x2? I can edit the text manually in the graph window, but found that my text ran off the edge of the display.

Your help would be very much appreciated.

Chris
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index