Re: [R] hypothesis testing for rank-deficient linear models

2006-01-12 Thread dhinds
[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

[R] hypothesis testing for rank-deficient linear models

2006-01-10 Thread dhinds
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