You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you very much for making this very interesting and useful book available on github!
I have used it today for teaching Poisson regression, and I got stuck with the negative binomial model.
Actually, the model that is printed in the book uses the weightsoffset(log(offset1000)) instead of the offset, as the correct implementation of the offset would be with a "+" instead of the ",". You can verify that this is indeed the case by running str(modelinb). The corrected code produces quite different coefficients in some places, e.g., the type within the central region is no longer significant (this was presumably caused by universities being bigger than colleges, which was not accounted for by an offset). It remains true that the negative binomial model has several effects with smaller p-values.
By the way, the tweak to prevent the logarithm from becoming negative by modifying the offset1000 for c.data2 is not necessary for the corrected code, because a negative offset is perfectly permissible, whereas a negative weight is not (this error message drew my attention to the issue, because I tried to run the code on c.data, because I didn't immediately know how to obtain c.data2).
Best regards,
Ulrike Grömping
The text was updated successfully, but these errors were encountered:
Thank you very much for making this very interesting and useful book available on github!
I have used it today for teaching Poisson regression, and I got stuck with the negative binomial model.
Actually, the model that is printed in the book uses the weights
offset(log(offset1000))
instead of the offset, as the correct implementation of the offset would be with a "+" instead of the ",". You can verify that this is indeed the case by runningstr(modelinb)
. The corrected code produces quite different coefficients in some places, e.g., the type within the central region is no longer significant (this was presumably caused by universities being bigger than colleges, which was not accounted for by an offset). It remains true that the negative binomial model has several effects with smaller p-values.By the way, the tweak to prevent the logarithm from becoming negative by modifying the
offset1000
forc.data2
is not necessary for the corrected code, because a negative offset is perfectly permissible, whereas a negative weight is not (this error message drew my attention to the issue, because I tried to run the code onc.data
, because I didn't immediately know how to obtainc.data2
).Best regards,
Ulrike Grömping
The text was updated successfully, but these errors were encountered: