Statalist


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

st: forvalues and _N


From   "Bastian Steingros" <Steingros@gmx.de>
To   statalist@hsphsun2.harvard.edu
Subject   st: forvalues and _N
Date   Fri, 10 Oct 2008 09:31:36 +0200

Hi Stata users,

I have been searching for a special command in regard to *forvalues*, but without success.

I need something like:

gen N=_N

forvalues i = 1/N {
...
}

In my case, N is the maximum number of observations in my sample. I do not want to write 22345 or something instead of N because the number of observations might vary depending on how many observations I have dropped before. 

But it is not possible to use N in a loop command at this place.


Are you aware of any stata updates being a solution to that problem?

Do you know a way to program it any better?

cheers

Bastian M Steingros


-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/wasistshortview.php?mc=sv_ext_mf@gmx
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index