[R] equivalent of model.tables for an lm.object?

Chuck Cleland ccleland at optonline.net
Wed Sep 27 14:47:53 CEST 2006


Henrik Parn wrote:
> Dear all,
> 
> I run a linear model with three significant explanatory variabels
> x1: a factor with 4 levels
> x2 and x3: factors with two levels each
> x4: continuous
> 
> model <- lm(y ~ x1 + x2 * x3 + x4)
> <>
> The data is not perfectly balanced between the different 
> factor-combinations and I use treatment contrasts.
> <>
> With an aov.object, I assume I could have used model.tables(aov.object, 
> type = "means", se = TRUE), to get the means and se for all factor 
> combinations.
> 
> <>In an lm.object like mine, I calculate the means 'manually' from the 
> Estimates (for sure it could be done with a script, but fair enough). 
> <>For the standard error of the means, I started out using formulas of a 
> variance of a sum of two variables, but I messed things up with the 
> interaction. Is there a way to calculate the standard error of the means 
> from Estimates and Std.Error (or other information) from the lm.object?

You might have a look at the effects package by John Fox.

http://socserv.mcmaster.ca/jfox/Misc/effects/index.html

> <>
> <>
> <>Thanks in advance for any advice!
> <><>
> Best regards,
> 
> Henrik
> <>

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list