[BioC] linear models and intercepts with LIMMA
Ramsi Haddad
rhaddad at genetics.wayne.edu
Mon Apr 18 15:53:26 CEST 2005
Dear Jim,
Thanks for your explanation. My confusion is over the fact that both
regression and ANOVA are called by the same function.
I guess I don't need the intercept as Gordon suggested for the factor
co-variates, but I thought I needed an intercept for a continuous
co-variate.
My original message indicated that the intercept can be calculated by
loosing one of the samples when using group (factor) data. If I use
only a continuous covariate, like age, I can get an intercept and still
keep the age co-variate. The trouble arises when I add a factor (like
group) and a continuous co-variate (like age). In this case, I can get
an intercept, but I loose a factor.
I am not intending to do anything with the intercept. For this reason,
I am taking Gordon's advice and not calculating an intercept.
Thanks all.
Ramsi
> 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
>
More information about the Bioconductor
mailing list