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.
*
* 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/