Peter Dalgaard skrev: > Prof Brian Ripley skrev: > >> -0.5*(A+B) is not a contrast, which is the seat of your puzzlement. >> >> All you can get from y ~ x is an intercept (a column of ones) and a >> single 'contrast' column for 'x'. >> >> If you use y ~ 0+x you can get two columns for 'x', but R does not >> give you an option of what columns in the case: see the source of >> contrasts(). So you would need to replace contrasts(), which I think >> will be hard as model.matrix.default will look in the 'stats' >> namespace. It would probably be easier to create the model matrix >> yourself. >> >> > Or accept the default and do the parameter transformations yourself. > > l <- lm(y~x) > T <- rbind( > c(-1,-.5), > c(0,1)) > > c2 <- T%*%coef(l) > V2 <- T%*%vcov(l) %*% t(T) > > cbind(coef=c(c2), s.e.=sqrt(diag(V2))) >
I forgot: Also have a look at estimable() from the gmodels packages. -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ R-help@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.