Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: How to implement Wald estimator (for IV that is a ratio of coefficients)?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: How to implement Wald estimator (for IV that is a ratio of coefficients)?
Date   Mon, 12 Oct 2009 13:05:17 +0100

To expand on this: 

1. Instructions like 

local double b1=_b[nearc4]

are perfectly legal in Stata, but they certainly don't do what Misha wants. The effect in this example is to define a local macro with name -double- and contents "b1=_b[nearc4]". This also explains why with such syntax the local -b1- is not defined. (Exceptionally Misha might have defined such a local earlier in the same session or program.) 

2. Not only does Stata not support the specification of storage types for macros, they would not even be numeric types if Stata did. Local macros are essentially containers for strings; it is logically incidental, but practically important, that we often use them to hold strings that are all numeric or that define expressions with numeric result. 

3. As Martin Weiss indicated, Misha needs to do more reading here, but the first thing to read is surely the relevant chapters of [U]. 

Nick 
[email protected] 

Maarten buis

That won't work, if you want to store a single number in 
double precision you'll have to type:

tempname b1
scalar `b1'=_b[nearc4]

After that you can use `b1' just as you would a local.

--- On Sun, 11/10/09, Misha Spisok wrote:

> I attempted to use doubles in the code you provided, e.g.,
> local double b1=_b[nearc4]

*
*   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/



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