[BioC] linear models and intercepts with LIMMA
James W. MacDonald
jmacdon at med.umich.edu
Fri Apr 15 15:08:46 CEST 2005
Ramsi Haddad wrote:
> Dear List,
>
> I have been working with LIMMA and I'm a bit confused by the linear
> models. I have a group with 4 factors. I want to remove covariates
> from the main effects before I look at contrasts. Before I do this, I
> was trying out the different combinations of ~ . When I say
> lmFit(~group), this is supposed to calculate an intercept. This works.
> The problem is that my groupCTL disappears. If I say lmFit(~ -1 +
> group), I gather that the intercept is constrained to (0,0) and that
> lmFit(~ 0 + group) does not calculate an intercept.
> My problem is that I want lmFit to give me an intercept and not take
> away my groupCTL! Below is the code showing what I mean. Everything
> works, its just that I want my contrast matrix to include
> groupPE-groupCTL, but I can't do this when the intercept is calculated.
You are misunderstanding the models you are fitting. In the first place,
with ANOVA there is no assumption of a linear relationship between the
factor levels, so removing the intercept term doesn't constrain the
intercept to (0, 0). In this case, the intercept term indicates what
sort of model you want to fit, either a cell means or factor effects model.
Without an intercept you are fitting a cell means model in which you are
estimating the mean expression for each factor level (e.g., the model is
y_ij = u_i + e_ij). In this case, doing the contrasts is quite
straightforward.
If you add an intercept term, you are fitting a factor effects model in
which all of the other factors are specified in relation to some mean
value. In this case, all the other factors are specified in relation to
the mean of the groupCTL (e.g., the model is y_ij = u. + t_i + e_ij).
Here u. is the mean of the groupCTL samples, and the t_i are the amounts
that each of the other group means differ from the groupCTL mean.
Therefore, the contrasts are specified by the t_i values themselves if
you are comparing to groupCTL, and are specified by e.g., groupPE -
groupTIL for the other contrasts.
HTH,
Jim
>
> Any assistance in clarifying this matter would be appreciated. Thanks
>
> Ramsi
>
>
>
>>table(group)
>
> group
> CTL PE TIL TNL
> 17 22 12 10
>
>
>>design.e <- model.matrix(~group)
>
>
>>colnames(design.e)
>
> [1] "(Intercept)" "groupPE" "groupTIL" "groupTNL"
>
>
>>design.e <- model.matrix(~-1 + group)
>
>
>>colnames(design.e)
>
> [1] "groupCTL" "groupPE" "groupTIL" "groupTNL"
>
>
>>design.e <- model.matrix(~0 + group)
>
>
>>colnames(design.e)
>
> [1] "groupCTL" "groupPE" "groupTIL" "groupTNL"
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
--
James W. MacDonald
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623
More information about the Bioconductor
mailing list