Skip to content

displaying derived coefficients in lm

2 messages · James Lawrence, Greg Snow

#
Hello R-help,

Is there a way to get R to tell you the coefficients in a lm that it 
wouldn't normally tell you because of identifiability constraints? For 
instance, if you use contr.sum() to generate contrasts for a factor, say

## y <- some data
## x <- a factor with levels 1:6
contrasts(x) <- contr.sum(levels(x))
lm.1 <- lm(y ~ x)

how would one persuade summary.lm to give the coefficient for x6 as well 
as x1 up to x5? I know in this case that x6 is minus the sum of x1 to 
x5, but I am working on a problem where the constraints are very 
complicated and it would be a real help to see all the coefficients.

Thanks in advance

James Lawrence.
#
Look at the dummy.coef function.