[R] logit GLM without intercept

gorgasal at gmx.de gorgasal at gmx.de
Tue Apr 22 17:04:24 CEST 2008


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

--



More information about the R-help mailing list