Statalist The Stata Listserver


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

st: RE: xtline only for datasets with more than x values


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: xtline only for datasets with more than x values
Date   Mon, 29 May 2006 16:55:52 -0500

I believe this should work:

egen count = count(earn) if earn != 0 , by(id)

xtline earn if count >= 5 & !mi(count)


Scott

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of Frank Spakowski
> Sent: Monday, May 29, 2006 3:51 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: xtline only for datasets with more than x values
> 
> I have panel data with the year, id and earn (among others). Now I'm
> trying to create a line graph for my variable "earn", but only for the ids
> with more than five observations. That is, if I have more than 10 zeroes
> or missing values in my time series of 15 years (for each id), I want the
> whole firm to be excluded from the graph. Does anybody know how I can
> achieve this?
> 
> Many thanks!
> Frank
> 



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