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

# Re: st: margins using weights in calculation?

 From Steve Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: margins using weights in calculation? Date Sat, 11 May 2013 12:49:05 -0400

```Please tell us about the design that produced weights with average value
<1.

Something else is puzzling here beyond the unusual weights. A regression
with pweights would show 13,000 as the number of obs with the sum of the
weights listed as "sum of wgt". If you did -svy: reg-, then the sum of
the weights would be reported as "Population size". If the weighted
regression with pweights is showing 7,701 as the "Number of obs",

Much will be clearer if, as the FAQ request, you show us the
actual code that you wrote and the Stata results. See Nick Cox's summary in
http://www.stata.com/statalist/archive/2013-03/msg00381.html.

Steve

On May 11, 2013, at 11:31 AM, Richard Williams wrote:

I am curious how your number of cases goes down when using pweights. But in any event the help for margins says "By default, margins uses the weights specified on the estimator to average responses and to compute summary statistics.  If weights are specified on the margins command, they override previously specified weights." So, I think margins is doing it fine, and there is no need for you to repeat the weight specification on the margins command.

At 02:12 PM 5/10/2013, Brent Gibbons wrote:
> When i run a weighted OLS regression (using either iweight or pweight) with about 13,000 cases, I get a reported number of observations of about 7,701 (which is what it should be given the values of the weights. But when I then run a margins command to compute dydx(*) on these data, with the same weight specified, I get the original unweighted number of cases (about 13,000) as the reported # of observations. Does this mean that when "margins" is averaging marginal effects across all cases, it is disregarding the weights and taking the simple unweighted average (i.e., giving each case a weight = 1)?
>
>
>
>
>
> *
> *   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/

-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam

*
*   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/

*
*   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/
```