[R] logit regression, test among groups

Thomas Lumley tlumley at u.washington.edu
Tue May 28 18:50:33 CEST 2002


On Tue, 28 May 2002, Martin Henry H. Stevens wrote:

>
> Dear all:
> My logistic regression model includes one qualitative and one quantitative
> predictor variable,
>
> aes <- glm(p.a ~ spp * log(light), family=binomial(link=logit)),
>
> where spp is abundance of 3 species and light is subcanopy light
> availability varying from 0  1.
>
>   I want to test differences among levels of the quantitative variable at a
> value of x other than the current log(light)=0.  I tried using
> I(log(light+.5)) but this caused serious lack of fit (AIC went from 1574 to
> 1656, and diagnostic plots demonstrated poor fit). How would create a model
> statement such that I test differences among groups at log(light)=approx. 2?
> Many thanks.


 aes <- glm(p.a ~ spp * I(log(light)-log(0.5)),
		family=binomial(link=logit)),

will test at light==0.5, and so on.

Theoretically it's horribly inefficient to waste perhaps whole tenths of a
second refitting the model when you can in fact compute these contrasts
from the fitted parameters and covariance matrices, and Frank Harrell's
solution is much nicer.


	-thomas

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list