[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Creating/initializing vars without external data file
Thanks for your very helpful response.
I'm using Stata 9.1 Intercooled for Windows and am trying to transition
from SAS, SYSTAT and SPSS (ugh).
Your response solved my problem to a point. I was not familiar with the
"webuse" command and was beginning my do file with a "gen" command
without having any data file open. Apparently in that case (but I'm not
sure), the "gen" and "local" commands do not initialize variables.
I can add the "webuse auto" command, but I'm wondering if it is possible
instead to have webuse open a null or temp data file. I would prefer
not to have my display cluttered by reference to an irrelevant data file
(like "1978 Automobile Data") if that is possible.
All I'm doing is a simple procedure that makes a distributional
calculation on a single set of one-case parameters to produce an
immediate statistic. I had hoped that routine could be accomplished
without having to open a data file. If not, at least you have given me
an option that does not require me to actually create a one-line
external data set and call it at the beginning of the do file.
So, do you know if it is possible to call a null or temp data file
instead of a real data set?
Again, many thanks.
Richard Williams wrote earlier:
What version of Stata? Here is what I get using 9.1:
. webuse auto
(1978 Automobile Data)
. gen param1 = .05
. display param1
. local param1 = .05
. display `param1'
Notice the left & right single quote marks for the local macro. Also,
note that the first display is equivalent to
. display param1
i.e. when you give only a var name to display, it prints out the value
of the first case.
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
* For searches and help try: