Statalist The Stata Listserver


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

Re: st: Re: memory problem where over 50% of memory are free


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: Re: memory problem where over 50% of memory are free
Date   Tue, 10 Apr 2007 13:40:08 +0100

Michael didn't mean what he suggested here. The -max()-
function needs two or more arguments and has different syntax
from -egen, max()-.

I think Michael is thinking of code like this:

sort persnr year2
by persnr : gen int maxyear2 = year2[_N]

or, if there are missings, something like

gen maxyear2 = cond(missing(year2), 0, year2)
sort persnr maxyear2
by persnr : replace maxyear2 = maxyear2[_N]

will mean one fewer variable.

Nick
[email protected]

Michael Blasnik

sort persnr year2
by persnr: gen int maxyear2=max(year2)

gen byte touse=year2<,
sort persnr touse year2
by persnr touse: gen int maxyear2=max(year2) if touse
drop touse
by persnr (maxyear2): replace maxyear2=maxyear2[1]

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