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


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

st: RE: RE: RE: RE: RE: RE: RE: AW: xtline, xtline2 and cmissing(n)


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: RE: RE: RE: RE: RE: RE: AW: xtline, xtline2 and cmissing(n)
Date   Mon, 17 May 2010 13:39:29 +0100

Martin has a solution here. But -xtline*- have rationale largely as
convenience wrappers. Having to type that specification once for every
panel is a bit awkward. (I do know that a wrapper programming that -- a
metawrapper? -- is possible.) 

Using -separate- before a direct call to -twoway line- still looks a
competitor. 

Nick 
n.j.cox@durham.ac.uk 

Martin Weiss

Last word on this issue from my side: I showed earlier how the -overlay-
variant of -xtline- requires -plot#opts()- specifications, which do
accept
the -cmissing()- option. This seems to work just fine in 10.1. -help
xtline-
does not promise to accept your syntax. -overlay()- only honours
-overlaid_options-...


***********
clear*
vers 10.1

set obs 4
gen id=_n
expand 10
bys id: gen time=_n
gen x=runiform()
xtset id time
replace x=. if runiform()<.3

local opts cmissing(n)
xtline2 x, overlay plot1opts(`opts') plot2opts(`opts') /*
*/ plot3opts(`opts') plot4opts(`opts')
***********

Giovanni Vecchi

Martin

to make ma point clear, I'll build on your example:

**************
clear
vers 11

set obs 4
gen id=_n
expand 10
bys id: gen time=_n
gen x=runiform()
xtset id time
replace x=. if runiform()<.3

xtline x, overlay cmissing(n) name(mygr, replace)
**************

the last line returns an error message. the two options -cmissing(n)-
and
-overlay- do not seem to get along. 

-xtline2- suffers from the same problem. Following up on the above
example:


**************
version 10.1
xtline2 x, overlay cmissing(n) name(mygr, replace)
**************

returns the same error message.

My conclusion is that there is a problem with -xtline- in need of
consideration.

Personally, I also do not like to be forced to switch between -xtline-
and
-xtline2-, depending on the Stata version I am (or my co-author is)
using.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index