Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -svy: mean - problem with returned matrices


From   Steven Samuels <ssamuels@albany.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: -svy: mean - problem with returned matrices
Date   Thu, 31 May 2007 12:38:38 -0400

Can anyone explain why I get the following error? How can I access the elements of the matrix which generates the error?
Thanks,

Steve

Program:
/************************************/
webuse nhanes2, clear
svyset
svy : mean height
ereturn list
matrix list e(V_srs)
di el(e(V_srs),1,1) //OKAY

matrix list e(b)
di el(e(b),1,1) //GENERATES ERROR
/*************************************/

Log:
webuse nhanes2, clear

. svyset

pweight: finalwgt
VCE: linearized
Strata 1: strata
SU 1: psu
FPC 1: <zero>

. svy : mean height
(running mean on estimation sample)

Survey: Mean estimation

Number of strata = 31 Number of obs = 10351
Number of PSUs = 62 Population size = 1.2e+08
Design df = 31
--------------------------------------------------------------
| Linearized
| Mean Std. Err. [95% Conf. Interval]
-------------+------------------------------------------------
height | 168.4599 .1466103 168.1609 168.7589
--------------------------------------------------------------

. ereturn list

scalars: [OUTPUT SKIPPED]
macros: [OUTPUT SKIPPED]

matrices:
e(b) : 1 x 1
e(V) : 1 x 1
e(_N_subp) : 1 x 1
e(V_srs) : 1 x 1
e(_N) : 1 x 1
e(error) : 1 x 1

functions: [OUTPUT SKIPPED]

. matrix list e(V_srs)

symmetric e(V_srs)[1,1]
height
height .00908828

. di el(e(V_srs),1,1) //OKAY
.00908828

. matrix list e(b)

symmetric e(b)[1,1]
height
y1 168.45989

. di el(e(b),1,1) //GENERATES ERROR
matrix operators that return matrices not allowed in this context
r(509);


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




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