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, is already up and running.

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

Re: st: Connecting Data Points with Lines

From   Jielu Lin <>
Subject   Re: st: Connecting Data Points with Lines
Date   Fri, 30 Apr 2010 16:09:51 -0400

Nick Cox just advised me to use "xtline" and this solves my problem.
If I do tsset and then line, the problem is still there. I'm working
on a small dataset--don't know if this is a problem of my data.

Jielu Lin

On Fri, Apr 30, 2010 at 2:02 PM, Austin Nichols <> wrote:
> Jielu Lin <> :
> Can you
> tsset id age
> before graphing?
> Can you show an example of the problem using publicly available data?
> clear all
> webuse grunfeld
> qui xtmixed mvalue time||company:time, mle cov(un)
> predict y_fitted, fitted
> g c=inrange(company,1,2)
> sort c
> line y_fitted time, connect(L) name(wrong)
> tsset
> line y_fitted time, connect(L)
> On Fri, Apr 30, 2010 at 1:44 PM, Jielu Lin <> wrote:
>> Dear all,
>> 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)
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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