[R] help with ols and contrast functions in Design library

2009-11-05 Thread Timothy Clough
Dear All, I'm trying to use the ols function in the Design library (version 2.1.1) of R to estimate parameters of a linear model, and then use the contrast function in the same library to test various contrasts. As a simple example, suppose I have three factors: feature (3 levels), group (

Re: [R] missing level of a nested factor results in an NA in lm output

2009-09-21 Thread Timothy Clough
I should have specified this before - it's part of the gmodels library. On Sep 21, 2009, at 2:31 PM, Erik Iverson wrote: estimable(fit, myEstimate) Estimate Std. Error t value DF Pr(>|t|) test 12.18198 0.6694812 18.19615 10 5.395944e-09 Where are you getting this "estimable" functi

[R] missing level of a nested factor results in an NA in lm output

2009-09-21 Thread Timothy Clough
oup and when it doesn't see patient 2 in group 4, it yields an NA parameter estimate for this combination. That's fine - the results of the other parameter estimates are still correct. However it's preventing me from estimating a linear function of the model coefficients, a

[R] missing level of a nested factor results in an NA in lm output

2009-09-20 Thread Timothy Clough
Hello All, I have posted to this list before regarding the same issue so I apologize for the multiple e-mails. I am still struggling with this issue so I thought I'd give it another try. This time I have included reproducible code and a subset of the data I am analyzing. I am running an

[R] missing values at a combination of two factors

2009-09-18 Thread Timothy Clough
Dear All, I have two factors: GROUP and PATIENT, where PATIENT is nested within GROUP. >levels(example$GROUP) [1] "0" "1" "2" "3" "4" > levels(example$PATIENT) [1] "1" "2" "3" There are three observations at each combination of these factors. However, there are no observations for PATIEN

[R] Help with lm with a nested effect

2009-09-17 Thread Timothy Clough
Dear All, I am running an ANOVA model with three factors: FEATURE (3 levels), GROUP (5 levels), and PATIENT (2 levels), where PATIENT is nested within GROUP. fit <- lm(ABUNDANCE ~ FEATURE + GROUP + FEATURE:GROUP + GROUP/PATIENT, example) However, the design is not balanced: PATIENT1 in

[R] using lm with nested factor results in NA's

2009-09-14 Thread Timothy Clough
Dear All, I am attempting to perform an ANOVA with three factors: feature (3 levels), group (5 levels), and patient (246 levels), where patient is nested within group. I am using the following command: fit <- lm(intensity ~ feature + group + feature:group + group/patient, data = new)

[R] help with 'lm' function: contrast and separate variance terms

2009-09-08 Thread Timothy Clough
Dear All, I am attempting to use R to perform an ANOVA with three factors: feature (3 levels), group (5 levels), and patient (246 levels), where patient is nested within group. Currently I am using the "lm" function to fit the model, with the following form: fit <- lm(intensity ~ featu