Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: Graphing the median of a list of variables
From
"Nick Cox" <[email protected]>
To
<[email protected]>
Subject
st: RE: Graphing the median of a list of variables
Date
Tue, 27 Apr 2010 19:12:09 +0100
No; I would use -collapse- first.
collapse (p50) question*, by(year)
After that, it's just a -line- plot. I'd put year on the x axis; any
other design may seem less intuitive to your readership.
By the way, even though the data are Likert scales, in my experience
means in practice often do a much better job of summarising level
(regardless of measurement theory).
Nick
[email protected]
Jeremy Voros
Stata newbie here with a question I'm having trouble finding an answer
for. I would like to create a line graph with variables along the x-axis
and their median on the y-axis, with a different line for each variable
based on the cohort year. Here's the details:
My database of likert-scale survey data looks basically like this:
| id | year | question1 | question2 |
question3 | etc...
| 5 | 1999 | 1 | 4 |
3 |
| 5 | 2001 | 3 | 4 |
2 |
| 6 | 1999 | 3 | 5 |
4 |
So ultimately I'd like a graph with question1, question2...questionX
along the x-axis, and the median of each variable on the y-axis, with a
different line for each year.
I feel like it should involve tabstat or reshape somehow, but can't
manage to work it out. Any help appreciated.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/