This post is to introduce the new command -regoptwgt-, which is now available from the SSC.
Researchers often wonder whether to use weighted or unweighted estimators when they want accurate estimation but are unsure which estimator will be better. This new command uses maximum likelihood (LIML in the case of endogenous regressors) to select among a weighted, an unweighted, or an intermediate estimator, assuming uncorrelated error terms. For multi-equation models, it can use different weighting for each equation.
In many cases, it can easily replace commonly-used commands. For example:
For more information on the command, see:
https://davidjonathanprice.com/docs/...edasticity.pdf
That paper mainly details a common setting where -regoptwgt- substantially outperforms weighted or unweighted estimators: when observation accuracy is thought to roughly follow a power law, as when there is one observation per city or per firm. In that setting, weighted and unweighted estimators can fail to be consistent; and weighted estimators can fail to be asymptotically normal, have standard errors that are inconsistent and uninformative about estimators' standard deviations, and produce inaccurate inference in large samples.
Comments and suggestions on the Stata command (or the paper!) are, of course, appreciated.
Researchers often wonder whether to use weighted or unweighted estimators when they want accurate estimation but are unsure which estimator will be better. This new command uses maximum likelihood (LIML in the case of endogenous regressors) to select among a weighted, an unweighted, or an intermediate estimator, assuming uncorrelated error terms. For multi-equation models, it can use different weighting for each equation.
In many cases, it can easily replace commonly-used commands. For example:
Code:
ssc install regoptwgt set seed 0 clear set obs 100 gen pop = 1/_n gen z = rnormal() gen xeta = rnormal() gen x = z + rnormal() + .1/sqrt(pop)*(xeta + rnormal()) gen y = x + rnormal() + .1/sqrt(pop)*(xeta + rnormal()) reg y z [w=pop] // Commonly-used command regoptwgt y z [w=pop] // This command can replace the one above it ivregress 2sls y (x=z) [w=pop] // Commonly-used command regoptwgt y (x=z) [w=pop] // This command can replace the one above it
https://davidjonathanprice.com/docs/...edasticity.pdf
That paper mainly details a common setting where -regoptwgt- substantially outperforms weighted or unweighted estimators: when observation accuracy is thought to roughly follow a power law, as when there is one observation per city or per firm. In that setting, weighted and unweighted estimators can fail to be consistent; and weighted estimators can fail to be asymptotically normal, have standard errors that are inconsistent and uninformative about estimators' standard deviations, and produce inaccurate inference in large samples.
Comments and suggestions on the Stata command (or the paper!) are, of course, appreciated.
