Statalist The Stata Listserver


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

st: RE: -svy: mean - problem with returned matrices


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: -svy: mean - problem with returned matrices
Date   Thu, 31 May 2007 17:47:17 +0100

I think you are being bitten by code that 
tests to see whether you are trying to 
-display- the whole of a matrix. You 
are, but it's reasonable to ask for a -display- 
of the whole of a matrix which is just 1 X 1. 
That's my guess. I can't see inside the code 
that is behind this error report. 

Nick 
[email protected] 

Steven Samuels
 
> Can anyone explain why I get the following error?  How can I access  
> the elements of the matrix which generates the error?
 
> 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index