Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

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

From   "Nick Cox" <>
To   <>
Subject   RE: st: RE: FW: graphing ordinal panel data over time
Date   Tue, 8 Jun 2010 15:33:24 +0100

Maarten's -proprcspline- (SSC) mentioned below seems to have the edge here as directly respecting the constraint that the proportions necessarily add to 1. 

I don't think that this machinery of Roger's does that, except by approximation. It's probably a fine point for graphics, but doing it properly is always a good idea. 


Roger Newson

If Paul wants to track the proportions with the 3 values over time, with 
confidence limits, then Paul might define 3 identifier variables 
identifying the 3 values, and model the progress of the means 
(proportions) of these with time (possibly using -ci- with -statsby- to 
make an output dataset with 1 obs per time point), and then use 
-eclplot- to produce the confidence interval plots, Alternatively, if 
time is a continuous variable, then Paul might prefer to use a spline 
regression model of log(p/(1-p)) with respect to time, using the 
-frencurv- module of the -bspline- package to compute a spline basis 
whose parameter values are values of the spline at points on the time 
axis, and then use -logit-, -logistoc- or -glm-, with the -noconst- 
option, to define confidence intervals for the p/(1-p) values at these 
time points, and then to use -parmest- to produce an output dataset with 
1 observation per parameter and data on estimates and confidence limits, 
and then to do an end-point transformation of the confidence intervals 
to the original probability scale before plotting the confidence 
intervals over time using -eclplot-. The examples of Newson (2001) and 
Newson (2004) might be helpful here.

If Paul is principally interested in measuring the ordinal association 
of this 3-level ordinal variable with time, then the -somersd- package, 
downloadable from SSC, might provide a way to do this.

I hope this helps.

Best wishes


Newson R. 2001. Splines with parameters that can be explained in words 
to non-mathematicians. Presented at the 7th UK Stata User Meeting, 14 
May, 2001. Download from

Newson R. 2004. B-splines and splines parameterized by their values at 
reference points. (This is a manual for the bspline package, 
downloadable from the SSC archive site, and is a post-publication update 
of a Stata Technical Bulletin article.) Download from

On 08/06/2010 13:16, Maarten buis wrote:
> --- Seed, Paul forwarding
>> I have got an ordered outcome variable with three values
>> over a period of 20 years. To describe the data, I want
>> to show how the three values of my outcome variable have
>> developed over time.
> --- On Tue, 8/6/10, Nick Cox wrote:
>> 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).
> Yet another way would be look at -proprcspline-, see
> -ssc d proprcspline- and
> <>
> An important difference is that -proprcspline- also applies
> certain amount of smoothing, which can for example be helpful
> when some the of the periods contain relatively few cases, such
> that the changes between periods becomes too eratic.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index