Statalist


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

Re: st: referencing eresult matrices


From   Joseph McDonnell <[email protected]>
To   [email protected]
Subject   Re: st: referencing eresult matrices
Date   Sat, 7 Nov 2009 14:11:52 +0930

I suspect that it might be due to the fact that Stata considers e(b)
etc to be ephemeral. Immediately available but soon to be overwritten.
By forcing you to explicitly export it, matrix management is enhanced
(maybe!?).

As an aside, I never use el(). I just type

. di b[1,1]

Are there ads or disads to my approach?

Cheers

Joseph

On Fri, Nov 6, 2009 at 10:51 PM, Jeph Herrin <[email protected]> wrote:
> Thanks, but as the subject line says, I want to
> reference e(matrix) directly - I just gave one
> example. I've been using the below method for years,
> so I hardly think about it anymore, but every once
> in a while wonder if there's a shorter way.
>
> cheers,
> J
>
> Maarten buis wrote:
>>
>> --- On Thu, 5/11/09, Jeph Herrin wrote:
>>>
>>> After an estimation, I often want to get a particular
>>> element of one of the result matrices, and know I can do
>>> it as follows:
>>>
>>>  reg y x
>>>  matrix b = e(b)
>>>  di el("b",1,1)
>>>
>>> But there must be a way to eliminate the middleman b? This
>>>
>>>  reg y x
>>>  di el("e(b)",1,1)
>>>
>>> doesn't work, but I'm sure there's a way to reference e(b)
>>> so that I don't need to store it in another matrix first.
>>> In fact, I'm sure I knew it once, even.
>>
>> Say the variable whose coefficient you want is called x, than you can
>> refer to it as _b[x] (and its standard error as _se[x]).
>>
>> 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/
>

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