--- On Thu, 19/3/09, Johan Hellstrom wrote:
> For graphing purposes I need to create a (filter-)variable
> that assign a value to every 1.000 observation (in total
> there is about 80.000 observations). Although it could be
> done manually, can anyone tell me how to do this
> automatically?
gen byte filter = mod(_n, 1000) == 0
alternatively, if you want to make sure that all values
are represented in your graph of variable x versus y
but that you don't plot the same point multiple times,
you could type:
bys x y: gen byte filter = _n == 1
Hope this helps,
Maarten
-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://home.fsw.vu.nl/m.buis/
-----------------------------------------
*
* 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/