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

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


*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index