Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: forv


From   "Frank de Libero" <[email protected]>
To   <[email protected]>
Subject   st: RE: forv
Date   Tue, 14 Jan 2003 16:01:34 -0800

You have more than you need in your code.

local nvar 10
set obs 25
forvalues i=1/`nvar'{
	gen coef`i' = uniform() /* You original code had a space before the () */
	}

And then simply -save filename- gives you what you want.

..Frank


-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Rajiv Mallick
Sent: Tuesday, January 14, 2003 3:44 PM
To: [email protected]
Subject: st: forv

I run the following code and get ""uniform not found r(111);"" error
message.  Am I missing something?

Also, how can I save values of coef`i'-`nvar' in a Stata file?

Thank you
Rajiv

code:
-------------------
local nvar 10
set obs 25
forvalues i=1/`nvar'{
        gen coef`i' = uniform ()
        gen n           = _n
        }
clear


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*
http://join.msn.com/?page=features/virus

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

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