# How does the probability weight, called a pweight in Stata, work?

I am using inverse weights in a panel data analysis (fixed effects) in Stata, to see if my regression coefficients are the same after I reweight the analysis to better represent respondents most similar to sample attritors.

In the analysis I reweight using reg y x [pw=ipw]

I found the following description of pweighting online:

PWEIGHT= person (case) weighting.

PWEIGHT= allows for differential weighting of persons. The standard weights are 1 for all persons. PWEIGHT of 2 has the same effect on item estimation as putting the person and responses into the analysis twice.

https://www.winsteps.com/winman/pweight.htm

I think this is a really neat way of thinking about weighting. But is this actually what pweighting, and particularly Stata, does? The description is from a different statistical software.

If not, then what (in non-technical terms if possible), is Stata doing when it pweights in order to give more weight to some individuals in the data, and less to others?

• I want to emphasise what you mention yourself. The link you're giving is to documentation for Winsteps Rasch Measurement and Rasch Analysis Software. Just because that software uses the term PWEIGHT does not make pweights in Stata equivalent. – Nick Cox Feb 18 at 12:05

## 1 Answer

From the estimation perspective, pweights is internally used the same way as any other weight. in OLS: $$min_{\beta} = \sum{(y-\beta X)^2 * w}$$ The only difference with other methods is during the estimation of standard errors. When you use pweights, is like requesting robust standard errors. (sandwich formula).

For further details on how exactly weights enter the estimation, look in the helpfile for regress, go to the PDF (manual), methods and formulas, and finally weighted regression. (in stata 16, this is the "r.pdf" file page 2201pg.)

HTH

• Stata documentation is (1) bundled with whatever Stata you have downloaded if you use it (2) visible online regardless of whether you or your workplace have a license (licence). See stata.com/manuals/rregress.pdf for regress details. For a more general discussion see [U] 11.1.6 or stata.com/manuals/u11.pdf – Nick Cox Feb 18 at 12:10
• True. However, The Stata manual grows every update! (couple papers of mine got into the manual at some point this year), so I was referring to a specific page based on the current version of the pdf. Stata website has been difficult to access due to the weather conditions. PD. Im also missing "Statalist" – Fcold Feb 18 at 12:36
• The links I gave to www.stata.com work for me, although I can't rule out the possibility that that may be a benign side-effect of caching. Otherwise put, statalist.org is down as I write but I can see www.stata.com. Regardless, it's remarkable how many Stata users do not realise the opposite, that pdf documentation is bundled with any (legitimate) installation of Stata. – Nick Cox Feb 18 at 12:47
• Thank you so much for your comments. I guess I am more generally unclear on how weighting works in regressions in general, which is why I was so taken by the neat description in my post. If then, in Stata, an individual is given a pweight with an IPW of 2 in a regression, what exactly happens? Is their contribution to the analysis multiplied by 2? Or entered twice? – John Feb 18 at 12:55
• The former. When weights (any ways) are applied, when the objective function is maximized, minimized or otherwise calculated, the contribution of an observation is multiplied by its weight. (or its relative weight compared to the average weights in the sample). – Fcold Feb 18 at 13:12