[R] displaying derived coefficients in lm

From: James Lawrence <jdl37_at_hermes.cam.ac.uk>
Date: Wed, 11 May 2011 12:42:53 +0100

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.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 11 May 2011 - 13:56:57 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 11 May 2011 - 21:30:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive