Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: how to get a line (or scatter)graph alike the linkplot of Nick Cox?


From   José Maria Pacheco de Souza <jmpsouza@usp.br>
To   statalist@hsphsun2.harvard.edu
Subject   st: how to get a line (or scatter)graph alike the linkplot of Nick Cox?
Date   Fri, 06 Jan 2012 12:46:11 -0200

Dear Statalisters:
I need to get a line (or scatter) plot where lines of different individuals do not connect, even when the first time of observation of one starts after the end of another. The small data set bellow and the commands show what I would like to get,using -linkplot- written by Nick Cox and what I would not want to get, using either line or scatter. The lines for individuals id=76 and id=137 *should be two separated lines*.

id	       age 	 	zpi
27	          8		-.4003515
27	        12		.7188796
27    	16		-.0958611
27		20		.0375383
27		24		.2878524
76		7		-.6242654
76		11		.3159339
137		17		-.6290992
137		21		-.2678947
436		10		.0439807
436		13		-.6680512
436		17		-.7185947
436		21		-1.088822

(Stata 10, same results for Stata12. Operational system Windows7 32 bits)

linkplot zpi age,link(id) mlabel(id)

scatter   zpi age,sort(  id  age) con(ascending) mlabel(id)
line   zpi age,sort(  id  age) con(ascending)

By the way, is it possible to make -linkplot- a twoway plottype?
Thanks.
josé maria
--
Jose Maria Pacheco de Souza
Professor Titular (aposentado), Colaborador Sen or
Departamento de Epidemiologia/Faculdade de Saude Publica, USP
Av. Dr. Arnaldo, 715
01246-904  -  S. Paulo/SP - Brasil
fones (11)3061-7747; (11)3768-8612
www.fsp.usp.br/~jmpsouza
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index