Achim Zeileis Achim.Zeileis at uibk.ac.at
Mon May 13 12:56:01 CEST 2013

```On Mon, 13 May 2013, meng wrote:

> Hi all:
> I have a question about poisson regression.
>
> My data:
> drug result count
> 1       1          8
> 1       2        54
> 2       1       20
> 2       2      44
>
> My model:
> model<- glm(count ~ drug*result, family = poisson)
>
> My result:
> summary(model)
>
> Coefficients:
>              Estimate Std. Error z value Pr(>|z|)
> (Intercept)     2.0794     0.3536   5.882 4.06e-09 ***
> drug2           0.9163     0.4183   2.190   0.0285 *
> result2         1.9095     0.3788   5.041 4.64e-07 ***
> drug2:result2  -1.1211     0.4650  -2.411   0.0159 *
>
> Calculation of coefficients:
> Intercept: drug=1 and result=1,the corresponding count is 8.So log(8) is 2.079442 which is Intercept.
>
> My question: How is drug2 calculated? log(64)-log(62) or something like
> that(indicates the difference between drug2 and drug1) ? I've searched
> and tried many times for all possible solutions,but the result is not
> 0.9163.So,how is drug2 calculated ?

It's the drug2 effect (on a log-scale) for result=1, i.e.,
log(20) - log(8).

The four coefficients are:

R> y <- c(8, 20, 54, 44)
R> c(log(y[1]), log(y[2]) - log(y[1]), log(y[3]) - log(y[1]),
+    (log(y[4]) - log(y[3])) - (log(y[2]) - log(y[1])))
[1]  2.0794415  0.9162907  1.9095425 -1.1210851

> Many thanks!
>
>
> Best
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help