[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: Logistic using aweigths
Anna Lsto <email@example.com> writes:
> I tried to run a logistic regression using a_weight and got an error message
> back (aweigth not allowed). Is there any explanation for that? Can I
> alternatively run a logit using a_weight and then manually calculate the
> odds ratio from the logit regression coefficients? Would that give me the
> odds ratio I was looking for when I ran the logistic?
Nick Winter <firstname.lastname@example.org> responds:
> The odd thing is, -logistic- calls -logit- to do the actual estimation, and
> the documentation for -logit- suggests that it does not accept aweights,
> although it does, in fact.
> So it seems like either they both should, or neither should accept aweights.
They both should not, as the concept of aweights and cell means does not
really translate well into the machinations of -logit- and -logistic-.
Although you can have a model where the response is the average number
(proportion) of "yes" respondents, the mechanics of -logistic- and -logit-
would treat the proportion as it would treat any other non-zero response -- it
would treat it just as if it were equal to one.
The model where the response is a proportion is handled by -glm- instead, and
-glm- does accept aweights. I would advise caution when using them, however.
A -glm- Bernoulli model with aweights translates into both the response AND
the covariates being "averaged" out. If only the response is an average and
the covariates fixed over the averaged subjects, then what you want is -glm-
with a binomial denominator, specified as -family(binom varname)-, where
varname defines how many subjects went into each average. If you go this
route, you would also need to change the response from a proportion to the
number of positive respondents, i.e. from y to varname*y.
As for -logit-, the fact that it accepts aweights, although undocumented, is
probably a computational artifact left over from an earlier version of Stata.
For purposes of consistency in the definition of aweights, we'll change
-logit- to disallow them entirely.
* For searches and help try: