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

st: Creating/initializing vars without external data file


From   "George Stimson" <stimson@netz.us>
To   statalist@hsphsun2.harvard.edu
Subject   st: Creating/initializing vars without external data file
Date   Sat, 12 Nov 2005 11:01:28 -0600

I'm new to Stata and am trying to write a simple routine that uses a
distribution function to create a statistic.

I thought this would be incredibly simple, but I've been unable to
create/initialize a simple set of parameter estimates in the routine
without putting them in a single line raw data file and reading that
file into Stata.

For instance I've tried:
. gen param1=.05
. display param1

and that produces (at least displays) a zero value instead of .05.

Then I tried:
. local param1=.05
. display param1

but that also produces (at least displays) an incorrect result.

I've also tried adding a format statement:
. form param1 %4.2f

but that didn't solve my problem.

I expect the answer is very simple, but I just can't find it in the
documentation.

Thanks for any help.  I really did try to figure this out before asking
here.

George


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index