[EMAIL PROTECTED] wrote:
> Take the following example:
> a <- rnorm(100)
> b <- trunc(3*runif(100))
> g <- factor(trunc(4*runif(100)),labels=c('A','B','C','D'))
> y <- rnorm(100) + a + (b+1) * (unclass(g)+2)
...
Here's a cleaned-up function to compute estimable within-group effect
Take the following example:
a <- rnorm(100)
b <- trunc(3*runif(100))
g <- factor(trunc(4*runif(100)),labels=c('A','B','C','D'))
y <- rnorm(100) + a + (b+1) * (unclass(g)+2)
m <- lm(y~a+b*g)
summary(m)
Here b is discrete but not treated as a factor. I am interested in
comp