# Re: st: How can I do a weighted logit?

 From "L S" To statalist@hsphsun2.harvard.edu Subject Re: st: How can I do a weighted logit? Date Wed, 30 Jul 2008 23:00:48 -0700

```Hello,

I think that I want to use aweights.  Perhaps I am mistaken, but
aren't aweights the usual weights used for weighted least squares
(WLS) regression, whereas pweights are usually used on surveys that
over or undersample certain right-hand side variables?  I need to use
aweights here because the data is not a random sample.  Instead, the
data oversamples y=0 observations and undersamples y=1 observations, a
similar issue related to the confidence example in psychology
mentioned by jverkuilen.

family(binomial) option is specified.

Xie and Manski "The Logit Model and Response-Based Samples" (1989)
report that when uses a response-based sample (non-random; drawn
according to left-hand side variable), and applies weights that vary
with the left-hand side variable, all the estimates under the weighted
and unweighted logit should be the same except for the intercept term.
As seen in the example below, the coefficient on 'mpg' is not the
same before and after weights have been applied (one can use logit or
glm; the difference which isn't suppose to be there is between
weighted and unweighted for each case):

sysuse auto, clear
version 9.0

gen wt=.
replace wt=1 if foreign==1
replace wt=.1 if foreign==0

logit foreign mpg
logit foreign mpg [aw=wt]

glm foreign mpg [aw=wt], link(logit) family(binomial)

I do not think this is an issue in interpretability.  Might this
indicate some problem with the likelihood estimation?

Thank you.

>>Yes I can think of a number of similar problems in psychology, where a weight was desired for a binary outcome but not one based on a count/total. For instance, one might have a weight or confidence rating of some sort elicited from a subject who had to make a binary choice first, e.g.,:

Based on some criteria, Choose between option A or option B (record
binary outcome) How confident were you in your decision? (record
confidence score).
*
*   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/
```