Statalist The Stata Listserver


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

st: forvalues gives "numlist has too many elements" error


From   Pablo Mitnik <pmitnik@ssc.wisc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: forvalues gives "numlist has too many elements" error
Date   Tue, 07 Mar 2006 11:35:41 -0600

Dear all,

The code below worked fine, until I tried it with `1'==10000 (`1' refers to the number of repetitions in a simulation).
When I did this, I received the following error message:

"invalid numlist has too many elements
r(123);"

The help info on r(123) didn't help me -- it refers you to [U] 11.1.8 numlist, but I didn't find anything
useful for my problem there.

Any thoughts? Is there a workaround this issue?

Pablo

-----------code begins--------------
foreach posed in o2 o3 o4 b2 b3 b4 {

forvalues rep = 1/`1' {
if (`rep'==1) {
mat MR`posed'=(mr`posed'_`rep')
}
else {
mat MR`posed'=(MR`posed' \ mr`posed'_`rep')
}
}
}
-------------- code ends-------------------


--
Pablo A. Mitnik
University of Wisconsin-Madison (http://www.wisc.edu/ )
Department of Sociology ( http://www.ssc.wisc.edu/soc/)
Center on Wisconsin Strategy (http://www.cows.org/ )
1180 Observatory Drive
Room 7114A
Madison, WI 53706
TEL (608) 2621839
E-mail: pmitnik@ssc.wisc.edu
*
* 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–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index