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) Does this code yield the correct model or is there another possibility? I?d 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 -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: data-glm.txt Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080421/01edb1fa/attachment.txt
Hi Robert, you can exclude the intercept by including "-1" in the formula: value <- as.numeric(runif(20)<.4) ppm <- rnorm(20) glm(value~ppm-1,family=binomial) HTH Stephan> 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) > > Does this code yield the correct model or is there another possibility? I?d > appreciate it very much if you could help me out with this. I attached some > example data. > > Thanks & all the best > > Robert--
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? I?d >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