Statalist The Stata Listserver


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

Re: st: Re: help with loops


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: Re: help with loops
Date   Tue, 5 Dec 2006 10:21:51 -0500

Robert Ndugwa --

levelsof id, local(ids)
foreach i of local ids {
tw (scatter score date if id==`i' & class=="AA", legend(label(1 "AA")
  label(2 "BB")) ytitle(id`i')) (scatter score date if id==`i' & class=="BB")
gr export child_`i'.wmf
}

On 12/5/06, Robert Ndugwa <[email protected]> wrote:
Dear Stata users,

I have a data set that looks like below. I want to graph a series of plots
where i plot on the same scatter the score by on several available dates for
the same person id. I need individual graphs for each Id. But i dont have a
continous running ID as some IDs are exlcuded due to no entries.
For example i dont have entries for ID=6 here so i dont need any graph for
this.

How can i make the program only to plot where ID exists?
by current program looks like this

local i=1

while `i'<=20 {
*
*   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