Try:
forvalues i = 1/`=_N' {
....
}
Phil
At 06:01 PM 10/10/2008, you wrote:
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/
Philip Ryan
Professor,
Discipline of Public Health
Director, Data Management & Analysis Centre
Associate Dean (IT)
Faculty of Health Sciences
postal address:
Discipline of Public Health
Mail Drop DX650 511
University of Adelaide 5005
South Australia
location:
Level 6, Room 6-18
Bice Building
Royal Adelaide Hospital
North Terrace
Adelaide
tel +61 8 8303 3570
fax +61 8 8223 4075
http://www.public-health.adelaide.edu.au/
CRICOS Provider Number 00123M
-----------------------------------------------------------
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.
*
* 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/