Statalist The Stata Listserver


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

st: RE: linkplot does not accept the option -plot(plot)-


From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: RE: linkplot does not accept the option -plot(plot)-
Date   Mon, 16 Apr 2007 18:53:34 -0500

It looks like you can perform the data manipulation of -linkplot- directly,
and then use -twoway connect- 

For example:

clear
input  A          B         id	id2
      13.2       14.0          1 	1
       8.2        8.8          2 	1
      10.9       11.2          3 	1
      14.3       14.2          4 	1
      10.7       11.8          5 	1 
       6.6        6.4          6 	2
       9.5        9.8          7 	2
      10.8       11.3          8 	2
       8.8        9.3          9 	2
      13.3       13.6         10 	2
end

rename A wearA
rename B wearB
reshape long wear, string i(id) j(j)
encode j, gen(material)

//lines 43-49 of linkplot.ado
tempvar last
bysort id (material) : gen byte `last' = _n == _N 
expand 2 if `last'
sort id material
by id (material) :replace wear = . if _n == _N 

twoway connected wear material if id2 ==1, cmissing(n) mc(blue) lc(blue) ///

 || connected wear material if id2 ==2, lc(red) mc(red) cmissing(n) /// 
 ||, legend(order(1 "ID2 =1" 2 "ID2 = 2")) xla(1 2, valuelabel) /// 
  xsc(r(0.5 2.5)) yla(, ang(h)) 

Scott



> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Jos� Maria Pacheco de Souza
> Sent: Monday, April 16, 2007 12:54 PM
> To: [email protected]
> Subject: st: linkplot does not accept the option -plot(plot)-
> 
> Dear People (or, more directly, Dear Nick  Cox):
>     I am trying to use the code -linkplot porcento ano if
> numerodepesquisas==2, link( idmunicipio) cline(black) plot(linkplot
> porcento
> ano if numerodepesquisas==3,link(idmunicipio)cline(red))- in order to have
> different colors to identify better the two groups of lines, for
> numerodepesquisas==2 and for numerodepesquisas==3.
>     However I get the error message -linkplot is not a plot type-
> Is it a way to obtain the overlaid graphs?
> Thank you for the help.
> Jos� Maria




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