Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Working with stored results e() and r()


From   Roberto Ferrer <[email protected]>
To   Stata Help <[email protected]>
Subject   st: Working with stored results e() and r()
Date   Thu, 14 Nov 2013 15:04:16 -0430

Two related questions:

1. Why do I have to save stored results in a -matrix- before doing
some other operations?

2. why do errors differ according to the stored result I´m processing ?

According to [U] 18.9 Accessing results calculated by estimation commands:

"5. Estimation commands store the entire coefficient vector and
variance–covariance matrix of
 the estimators in e(b) and e(V). These are matrices, and they may be
manipulated **like any
 other** matrix..." (Emphasis is mine.)

-matrix list- works fine, but -svmat- and -display-, for example,
don't. Additionally, depending
on the stored result, I get different errors.

Below some code:

*--------- begin code ---------

clear all
set more off

webuse nhanes2f
svyset [pweight=finalwgt]

svy: proportion sex, over(region)

* This works
matrix list e(V)
matrix list r(table)

* This works
matrix a = e(V)
svmat a
display a[3,2]

* This doesn´t work
svmat e(V) // gives error r(111);
display e(V)[1,1]

* This doesn´t work
svmat r(table) // gives error r(198);
display r(table)[1,1]

*-------- end code ----------

It looks as if Stata is saving e(V) in some matrix/macro with a
different name. But why
does -matrix list- work and the others do not?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index