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]

st: RE: Connecting Data Points with Lines

From   "Nick Cox" <>
To   <>
Subject   st: RE: Connecting Data Points with Lines
Date   Fri, 30 Apr 2010 18:52:29 +0100

See if 

sort id age 

before the graph command solves the problem. Note that if your estimated
trajectories are not monotone increasing for every individual, then the
request is contradictory. 

See also -xtline-. 


Jielu Lin

I'm modeling age-graded trajectories. Each individual case in my data
has 4 repeated observations. Then I tried to graph estimated
individual trajectories. Each individual should have a separate
trajectory which is not connected to another individual trajectory. In
the actual graph, within a person, the 4 estimated data points were
correctly connected. However, some trajectories were connected even
though these observations did not belong to the same person. This
happened to some cases, but not all of them. I've been for patterns of
these odd connections but so far it seems random.

I used the following codes:

xtmixed y age ||id: age, mle cov(un)
predict y_fitted, fitted
twoway line y_fitted age, connect(ascending)

Whether I use the codes or the pull-down menu gives me the same thing.

*   For searches and help try:

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