Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: FW: graphing ordinal panel data over time


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: FW: graphing ordinal panel data over time
Date   Tue, 8 Jun 2010 12:33:04 +0100

There are several possible graphs here. For example, you can -contract-
and then just draw line plots of frequencies or percents. 

Another way to do it directly is using -catplot- (SSC). 

Whatever the way, I suspect most users would expect time on the
horizontal axis for such a plot. 

As signalled recently, I have just revised the syntax of -catplot-. The
revised files should appear shortly on SSC, courtesy of Kit Baum. 

Here is an example using the new syntax of -catplot-. 

. set obs 1000

. egen id = seq(), block(10)

. egen time = seq(), to(10)

. gen response = ceil(3 * runiform())

. catplot response time, percent(time) recast(bar) asyvars stack

. catplot time , by(response, compact col(1)) bar(1, bfcolor(none)) ///
blabel(bar, pos(base) format(%2.1f)) subtitle(, pos(9) ring(1) nobexpand
bcolor(none)) /// 
yla(none) recast(bar) percent(time)

Here is the same stuff with the old syntax, which is at this moment the
version on SSC. 

catplot bar response time, percent(time) asyvars stack

catplot bar time, by(response, compact col(1)) bar(1, bfcolor(none)) ///
blabel(bar, pos(base) format(%2.1f))  subtitle(, pos(9) ring(1)
nobexpand bcolor(none)) /// yla(none) percent(time)

The graphs can be improved further using the Graph Editor. 

Nick 
n.j.cox@durham.ac.uk 

Seed, Paul forwarding a.hense@jpberlin.de

first I want to thank you for writing the very helpful command xtgraph.

I would be very glad if you could answer a question for which I could 
not find an answer yet:

I have got an ordered outcome variable with three values over a period 
of 20 years. I use an unbalanced panel design and the sampling units are

individuals. To describe the data, I want to show how the three values 
of my outcome variable have developed over time. Therefore, I  would 
like to graph the overall development of these three values over time 
that means mapping the percent of respondents who chose value 1, 2 or 3 
in a certain year. Do you know how I can do this in Stata?

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


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