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   "Jia Xiangping" <jiajoseph@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Graph tsline(or line) with missing value
Date   Fri, 1 Dec 2006 02:46:07 +0800

Say thanks to Vince,

-cmissing(no)- is  the command I want.  Tons of thanks.


On 11/30/06, Vince Wiggins, StataCorp <vwiggins@stata.com> wrote:
Jia Xiangpin <jiajoseph@googlemail.com> 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
  vwiggins@stata.com

*
*   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/


--
Xiangping JIA
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index