[R] logit GLM without intercept
Michael Dewey
info at aghmed.fsnet.co.uk
Wed Apr 23 10:42:54 CEST 2008
At 16:56 21/04/2008, Robert Junker wrote:
>Dear Statisticians,
>
>
>
>I would like to analyse my data with a GLM with binomial error distribution
>and logit link function. The point is that I want a model fitted without
>intercept, i.e. the fitted curve should start at y=0.5 for x=0.
>
>I tried it with the following code:
>
>
>
>glm(value~0+ppm, binomial)
Others have already answered your question but
for future reference you might like to
(a) do ?predict.glm which will tell you how to
get predictions for any values of your predictors
(this may be useful in more complex situations)
(b) consider grouping the data as you have
repeated values of your x variable and using the
cbind(successes,failures) format for y, see ?glm
Of course you also need to ask how you _know_
that the response is 0.5 but we will take your word for that.
>
>
>Does this code yield the correct model or is there another possibility? Id
>appreciate it very much if you could help me out with this. I attached some
>example data.
>
>
>
>
>
>Thanks & all the best
>
> Robert
>
>
>
>
>
>
>
>
>
>
>
>--------------------
>Robert Junker
>Department of Animal Ecology & Tropical Biology
>University of Würzburg Biozentrum, Am Hubland
>97074 Würzburg, Germany
>
>
>
>
>
>
Michael Dewey
http://www.aghmed.fsnet.co.uk
More information about the R-help
mailing list