[R] glht with a glm using a Gamma distribution

From: Jarrett Byrnes <jebyrnes_at_ucdavis.edu>
Date: Mon, 14 Apr 2008 21:14:32 -0700

Quick question about the usage of glht. I'm working with a data set from an experiment where the response is bounded at 0 whose variance increases with the mean, and is continuous. A Gamma error distribution with a log link seemed like the logical choice, and so I've modeled it as such.

However, when I use glht to look for differences between groups, I get significant differences where there are none. Now, I'm all for eyeballing means +/- 95% CIs. However, I've had reviewers and committee members all tell me that I needed them. Oy. Here's the code and some of the sample data that, when visualized, is clearly not different in the comparisons I'm making, and, yet, glht (at least, how I'm using it, which might be improper) says that the differences are there.


I'm guessing I'm just using glht improperly, but, any help would be appreciated!

trt<-c("d", "b", "c", "a", "a", "d", "b", "c", "c", "d", "b", "a") trt<-as.factor(trt)

resp<-c(0.432368576, 0.265148862, 0.140761439, 0.218506998, 0.105017007, 0.140137615, 0.205552589, 0.081970097, 0.24352179, 0.158875904, 0.150195422, 0.187526698)

#take a gander at the lack of differences
boxplot(resp ~ trt)

#model it

a.glm<-glm(resp ~ trt, family=Gamma(link="log"))


#set up the contrast matrix

contra<-rbind("A v. B" = c(-1,1,0,0),

			"A v. C" = c(-1,0,1,0),
			"A v. D" = c(-1,0,0,1))

summary(glht(a.glm, linfct=contra))

Linear Hypotheses:

             Estimate Std. Error z value p value
A v. B == 0   1.9646     0.6201   3.168 0.00314 **
A v. C == 0   1.6782     0.6201   2.706 0.01545 *
A v. D == 0   2.1284     0.6201   3.433 0.00137 **
Signif. codes:  0 *** 0.001 ** 0.01 * 0.05 . 0.1   1
(Adjusted p values reported)


Jarrett Byrnes
Population Biology Graduate Group, UC Davis
Bodega Marine Lab

	[[alternative HTML version deleted]]

______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Received on Tue 15 Apr 2008 - 04:20:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Apr 2008 - 21:30:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive