Statalist


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

Re: st: xtline with missing data


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: xtline with missing data
Date   Tue, 06 Oct 2009 18:03:47 -0500

John McAdams <[email protected]> is using -xtline- to produce line graphs
using panel data with missing values in the variable being plotted:

> I have a panel data set, and am trying to use "xtline" to graph a variable
> over time for each panel unit.  However, the variable is missing for some
> observations in some time periods.
> 
> When I run "xtline", it does not leave gaps during the periods with
> missing data (it connects all the dots).  This leaves one with the
> impression that there is in fact no missing data, which is not
> satisfactory.
> 
> Is there a workaround to tell Stata not to connect dots when there is a
> missing data point in between?  I tried adding an if statement to the
> xtline call (i.e., xtline variable if variable != .), but that didn't
> work.
> 
> I'm running Stata 10/SE.

Martin Weiss <[email protected]> suggested the -cmissing(n)- option, but
then noticed that it had no effect.

The -xtline- command is marking out observations with missing values in the
variable to be plotted, thus defeating the -cmissing(n)- option.

We will change -xtline- to stop marking out missing values in the plotted
variable in a future ado-file update to Stata 11.

John (and other Stata 10 users) can download -xtline2- from my user site.

	. net from http://www.stata.com/users/jpitblado
	. net describe xtline2
	. net install xtline2

--Jeff
[email protected]
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index