Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Syed Basher <syed.basher@yahoo.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Simulating an AR(1) in Stata |
Date | Thu, 24 Feb 2011 09:52:05 -0800 (PST) |
It worked well. Thank you Maarten. ----- Original Message ---- From: Maarten buis <maartenbuis@yahoo.co.uk> To: statalist@hsphsun2.harvard.edu Sent: Thu, February 24, 2011 8:45:04 PM Subject: Re: st: Simulating an AR(1) in Stata --- 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/ * * 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/