Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Dealing with exposure differences using logarithmic offsets versus rescaling
From
Phil Schumm <[email protected]>
To
<[email protected]>
Subject
Re: st: Dealing with exposure differences using logarithmic offsets versus rescaling
Date
Thu, 15 Aug 2013 11:06:41 -0500
On Aug 14, 2013, at 6:07 PM, Dimitriy V. Masterov <[email protected]> wrote:
> I am trying to test my intuition that logarithmic offsets should yield the same estimates as dividing the outcome by exposure and using exposure to weight.
<snip>
> gen lnt1 = ln(t1);
> lab var lnt1 "Treatment Offset (ln of Days)";
>
> gen bipd1 = bi1/t1;
> gen gmbpd1 = gmb1/t1;
>
> /* Simple Poisson Model for BI */
> poisson bi1 i.treat, offset(lnt1) robust;
> poisson bipm1 i.treat [iw=t1], robust;
This is a function of the fact that for the poisson family, the variance is proportional to the mean, and in the case of no overdispersion, equal to the mean. So, in your case, the mean and variance of Y are equal to
e^[XB + log(exposure)]
which is exactly the model you are fitting when using log(exposure). If you divide Y by exposure, then the mean and variance of Y become
mean = e^[XB]
var = e^[XB] x 1/exposure
which is the model you are fitting without the offset and using exposure as the weight.
> /* GMB using GLM */
> glm gmb1 i.treat, offset(lnt1) link(log) family(gamma) robust;
> glm gmbpm1 i.treat [iw=t1], link(log) family(gamma) robust;
In contrast, for the gamma family, the variance is proportional to the *square* of the mean. Thus, unlike with the poisson, in this case you are fitting two different models to the data. Which is better is an empirical question, which you should determine by examining the mean and variance of Y relative to the linear predictor and its components (initially through plots, and then possibly via more formal methods).
-- Phil
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/