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

From |
"Jeff S. Pitblado" <jsp@stata.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Feature of -svymean- |

Date |
Fri, 16 Aug 2002 14:44:54 -0500 |

On Fri, Aug 16, 2002 at 05:47:15PM +0100, Roger Newson wrote: > I have been informed (by Dan Blanchette of the University of North > Carolina) that the -svymean- command has the feature that the estimation > results -e(b)- and -e(V)- do not always contain the estimates and the > covariance matrix of the estimates, respectively. This worries me, because, > in writing my -parmest- package, I have assumed that -e(b)- always contains > the estimates, and that -e(V)- always contains the covariance estimates. If > this assumption is false, then -parmest- will either crash or give the > wrong results. > An example of this feature was found by Dan Blanchette in the -auto- data, > in which both -e(b)- and -e(V)- can be 1x1 matrices of zeros in the > presence of user-inserted missing values in the data. I have reproduced > this example below. As it happens, the feature can be fixed by including > the -complete- option of -svymean-, and I have also reproduced this below. > However, it is surprising that there are any -eclass- commands at all for > which -e(b)- and -e(V)- are not the estimates and their covariance, > respectively. Is this feature of -svymean- supposed to be there? And, if > so, what is Stata's true policy on estimation results, so I can think of a > way for -parmest- to work around it (or warn users in the .hlp file)? > (example ommitted) The behavior of -svymean- in this regard is intentional and explained in what follows. -svytotal- and -svyratio- also behave this way, but only these three commands have this feature. These three commands behave like all other Stata estimation commands with one notable exception. When there are observations with missing values of one or more of the variables involved, pairwise covariance estimates are not all based on the same set of observations, and thus it would be misleading to construct a covariance "matrix" from all the pairwise covariances. In this case, rather than be misleading we chose not to store such a matrix in -e(V)-; furthermore, we do not even store the parameter estimates in e(b). In cases where we are guaranteed that the pairwise covariances are all based on the same observations, there is no problem, and we do store the estimates and their estimated covariances in -e(b)- and -e(V)-. -svymean-, -svytotal-, and -svyratio- have the -complete- option that drops any observation with a missing value for any variable involved. Thus when you specify -complete-, you will get -e(b)- and -e(V)-. Authors of post-estimation commands that want their commands to work after -svymean- (and friends) will have to check the -e(complete)- macro. The point here is: "`e(complete)'"=="available", indicates that there were observations with missing values, thus the full variance covariance matrix is not estimated, yet the individual variances are. As such, when it comes to displayed output, -svymean- may look like any other estimation command, but when it comes to saving the full covariance matrix in -e(V)-, this is not possible. When this issue came up as -svymean- was being designed/written, there were any number of possible solutions. We chose this solution, putting the burden on programmers, to be more friendly to the typical Stata user who just wanted to see the point estimates and their standard errors. Note that the -available- option forces this feature. However, as Roger indicated, the -complete- option ensures that -e(b)- and -e(V)- contain the estimates and variance matrix (by not including observations with missing values in the calculations). For more details see [R] svymean. Programmers interested in examples of post-estimation commands that work after -svymean- can look at the ado files for -svylc- and -svytest- for examples of how to handle this feature of -svymean-. --Jeff jpitblado@stata.com * * 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/

**Follow-Ups**:**st: question re:merge***From:*Anna Hyojin Joo <ajoo@fas.harvard.edu>

**References**:**st: Feature of -svymean-***From:*Roger Newson <roger.newson@kcl.ac.uk>

- Prev by Date:
**st: RE: Does your academic discipline use logit regressions with interaction terms?** - Next by Date:
**st: generating sums** - Previous by thread:
**st: Feature of -svymean-** - Next by thread:
**st: question re:merge** - Index(es):

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