Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Simulating an AR(1) in Stata
From 
 
Maarten buis <[email protected]> 
To 
 
[email protected] 
Subject 
 
Re: st: Simulating an AR(1) in Stata 
Date 
 
Thu, 24 Feb 2011 17:45:04 +0000 (GMT) 
--- On Thu, 24/2/11, Syed Basher wrote:
> Perhaps replacing -gen- with -scalar- ensures rho and s as
> scalars. Maybe I should write:
> 
> scalar `rho' = a+(b-a)*runiform()
> scalar `s '= c+(d-c)*runiform()
> 
> However, using ` ' reports invalid name, while excluding `
> ' works fine.
It is good style to use `rho' instead of rho, but you first 
need to define it as a tempname:
tempname rho s
scalar `rho' = ...
scalar `s'   = ...
Hope this helps,
Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
      
*
*   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/