Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Graph tsline(or line) with missing value


From   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: Graph tsline(or line) with missing value
Date   Thu, 30 Nov 2006 08:32:03 -0600

Jia Xiangpin <[email protected]> asks,

> I am graphing a time-series data, in which some years are missing.
> Is that possible for me to graph the line with the missing left
> blank, instead of connecting bluntly.
>
> For example, while the data in 1950s are available, 1960 are
> missing.  By default, the data are connected and there is a sudden
> increase/decrease in trend.

Whether observations with missing data are ignored, so that the line is
continuous, or recognized, so that the line has a break, is controlled by the
option -cmissing()-.  If Jia will add the option -cmissing(no)- to the
-tsline- command, the line will be broken wherever there is missing data.

In almost all cases with time-series data, it does not matter whether you have
observations with completely missing data for some time periods or whether
those observations are simply not included in the dataset.  This is not true
for -cmissing()-.  -cmissing()- doesn't understand time, but does understand
missing data.

If Jia's data does not include the missing time periods, Jia can type,

    . tsfill

before drawing the graph.  -tsfill- will fill in any missing time periods with
missing data.

 
-- Vince 
   [email protected]

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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