[R] Constraining coefficients

Andrew Criswell arc at arcriswell.com
Fri Mar 5 13:01:39 CET 2004


Hello All:

I have a binomial model with one covariate, x1, treated as a factor with 
3 levels. The other covariate is measured x2 <- 1:30. The response, y, 
is the proportion of successes out of 20 trials.

glm(cbind(y, 20 - y) ~ x1 * x2, family = binomial)

Now, I would like to constrain the cofficients on 2 levels of the 
factor, x1, to be identical and test the difference between these models 
by a likelihood ratio test.

How can I get glm() to constrain the coefficients on 2 levels to be the 
same?

Thanks,
ANDREW




More information about the R-help mailing list