<>
*************
sysuse auto, clear
*************
beforehand to make my example work.
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Martin Weiss
Gesendet: Dienstag, 19. Januar 2010 14:34
An: [email protected]
Betreff: st: AW: How to make a for "loop" when the counter is a variabe
<>
Which value of "var" do you want to be the upper limit? The first one:
***
forv i =1/`=mpg[1]'{
di `i'
}
***
Or the last one?
***
forv i =1/`=mpg[_N]'{
di `i'
}
***
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Quang Nguyen
Gesendet: Dienstag, 19. Januar 2010 14:23
An: [email protected]
Betreff: st: How to make a for "loop" when the counter is a variabe
When I run the following code:
for i = 1/`var' {........
}
where var is a variable in the data set.
The code doesn't work. Can you suggest a solution?
Many thanks!
--
"My father gave me the greatest gift anyone could give another person,
he believed in me." - Jim Valvano
*
* 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/
*
* 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/
*
* 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/