Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: STATA help for GLM misleading?


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: STATA help for GLM misleading?
Date   Mon, 14 Nov 2005 17:32:46 +0900

Rijo John wrote (excerpted):

The STATA help for GLM with the family(binomial) link(logit) option says

"For family(binomial) link(logit) models, we recommend using the logistic
command in preference to glm. Both produce the same answers, but logistic
provides useful post-estimation commands". [Cut]

This is actually misleading. When we have independent variables that are
fractions which can take any values between 1 and 0 including 1 and zero,
using family(binomial) link(logit) along with a robust option is certainly
different from logistic regression.
[Cut]
 And the stata help as written above sort of asserted that
using family(binomial) link(logit) is going to give the same result as
logistic, giving us the impression that STATA treats all the non-zero
values in the dependent variable as 1 thus resulting a (0,1) Bernoulli
distribution. But for me family(binomial) link(logit) with a robust option
gave a better result than logistic command.
[Cut]

--------------------------------------------------------------------------------

Stata's help for -glm- and -logistic- is not misleading:  you'll see that
you get identical results for fractional logistic regression in the example
below.  Cut and paste it into Stata's do-file editor to run it.

Just be aware that -logistic- only recognizes zeros and nonzeroes for the
response (as the help file for -logistic- states), so you need to set up
your dataset to make sense to -logistic-  See the do-file below for how.

This shouldn't be taken as an endorsement of fractional logistic regression
for your data.  Alternatives were suggested last month by other list
members.

Joseph Coveney

clear
set more off
set seed `=date("2005-11-14", "ymd")'
set obs 200
generate byte group = _n > _N / 2
generate float proportion = uniform() // No claim as to distribution
glm proportion group, family(binomial) link(logit) robust eform nolog
rename proportion proportion1
generate float proportion0 = 1 - proportion1
generate int row = _n
quietly reshape long proportion, i(row) j(positive)
logistic positive group [pweight = proportion], cluster(row)
exit

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index