Statalist


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

Re: st: lincom & svy commands


From   "Tim Wade" <wadetj@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: lincom & svy commands
Date   Thu, 23 Oct 2008 15:24:04 -0400

Jacqui, here is an example that probably does not make any sense but
illustrates what lincom does:


. clear

. webuse nhanes2f

. svyset psuid [pweight=finalwgt], strata(stratid)

      pweight: finalwgt
          VCE: linearized
  Single unit: missing
     Strata 1: stratid
         SU 1: psuid
        FPC 1: <zero>

. svy: mean zinc leadwt
(running mean on estimation sample)

Survey: Mean estimation

Number of strata =      31       Number of obs    =       9189
Number of PSUs   =      62       Population size  =  104176071
                                 Design df        =         31

--------------------------------------------------------------
             |             Linearized
             |       Mean   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
        zinc |   87.18207   .4944827      86.17356    88.19057
      leadwt |   15726.67   340.4806      15032.25    16421.08
--------------------------------------------------------------

. lincom zinc-leadwt

 ( 1)  zinc - leadwt = 0

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         (1) |  -15639.49   340.5765   -45.92   0.000     -16334.1   -14944.88
------------------------------------------------------------------------------

. matlist e(b)

             |      zinc     leadwt
-------------+----------------------
          y1 |  87.18207   15726.67

. matlist e(V)

             |      zinc     leadwt
-------------+----------------------
        zinc |  .2445131
      leadwt | -32.53403     115927

. *standard error from covariance matrix

. di sqrt((v[1,1])+(v[2,2])-(2*v[2,1]))
340.57646

. scalar se=sqrt((v[1,1])+(v[2,2])-(2*v[2,1]))

. *t statistic

. di r(estimate)/se
-15639.486

hope this helps, Tim


On Thu, Oct 23, 2008 at 11:18 AM, Bell, Jacqueline S. <j.bell@abdn.ac.uk> wrote:
> Hi
>
> This is a follow-on to a previous message I sent this month asking about how lincom calculates standard errors when clustering is present.
>
> Can anyone advise me on what lincom actually does when estimating differences in parameters from svy:mean or svy:prop?
>
> I have before/after data which is not paired at an individual level, but has a cluster structure.  In these circumstances it is not obvious how lincom goes about estimating the before/after difference.
> The two alternatives suggested to me are:
> i) it estimates before and after separately for the whole population, then estimates the difference
> ii)it estimates the difference in each cluster, and then the overall difference.
>
> In the data there are (in most cases) before and after data for each cluster, but often quite severe imbalances in samples before/after within cluster.
>
>
> Thanks for any help, Jacqui
>
>
>
> The University of Aberdeen is a charity registered in Scotland, No SC013683.
>
> *
> *   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index