[R-sig-ME] lme interaction result strange

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Wed May 2 15:24:54 CEST 2012


Dear Charles,

Are you sure that SAS and lme apply the same tests? So you'll need to know how the F-values are calculated. Futhermore: what is the relevance of testing the effect of a main effect when an interaction with that main effect is present?

Best regards,

Thierry

ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces op r-project.org [mailto:r-sig-mixed-models-bounces op r-project.org] Namens Charles Determan Jr
Verzonden: woensdag 2 mei 2012 15:14
Aan: Ista Zahn
CC: r-sig-mixed-models op r-project.org
Onderwerp: Re: [R-sig-ME] lme interaction result strange

I have checked the contrasts and 'unfortunately' they are identical.  Is that a statistically correct avenue to just take the interaction term from the interaction model and use the first ones?  That seems odd to me as the numbers aren't the same even in the SAS output between the models.  I certainly appreciate your prior suggestion but perhaps you or someone else has another idea?  Something else seems to be strange, perhaps the syntax needs to be different when doing an interaction term?

Thanks,
Charles

On Tue, May 1, 2012 at 2:02 PM, Ista Zahn <istazahn op gmail.com> wrote:

> Hi Charles,
>
> Ask yourself what the Event_name and Died terms represent in this
> model. When you understand that, you'll understand why you need to
> know what contrasts were used if you hope to correctly interpret these
> terms.
>
> Alternatively, you can interpret the Event_name and Died terms from
> the first model (without the interaction term), and interpret just the
> interaction term from this model (so-called type II sums of squares by
> some).
>
> Best,
> Ista
>
> On Tue, May 1, 2012 at 2:54 PM, Charles Determan Jr <deter088 op umn.edu>
> wrote:
> > I have yet to attempt the contrast suggestion yet but here is the
> > SAS
> output
> > to complement the R.
> >
> > SAS output for the simple and interaction models.  I have presented
> > the
> Type
> > III tests for simplicity.  As you can see from my prior R output,
> > the DFs match exactly.  The only variation is with the F and p value
> > of the Event_name and Died in the interaction model.
> >
> > Type 3 Tests of Fixed Effects
> >
> > Effect            NumDF DenDF F Value Pr > F
> >
> > group                1            23          0.65    0.4293
> >
> > Event_name     5            96          2.09    0.0738
> >
> > Died                  1            23          1.83    0.1889
> >
> >
> >
> > Type 3 Tests of Fixed Effects
> >
> > Effect                    NumDF DenDF     F Value Pr > F
> >
> > group                       1              23           0.47     0.5015
> >
> > Event_name            5              91           2.62    0.0290
> >
> > Died                         1              23           2.44     0.1318
> >
> > Event_name*Died 5              91          1.10     0.3637
> >
> >
> > R output of interaction model
> >
> >                          numDF denDF     F-value      p-value
> > (Intercept)               1        91       111.20483  <.0001
> >
> > group                      1        23        0.46632     0.5015
> > Event_name            5        91        1.14042     *0.3449*
> > Died                       1        23        0.50989    * 0.4824*
> > Event_name:Died     5       91        1.10436     0.3637
> > Done.
> >
> >
> > Regards,
> >
> > Charles
> >
> >
> >
> > On Tue, May 1, 2012 at 1:39 PM, Thompson,Paul
> > <Paul.Thompson op sanfordhealth.org> wrote:
> >>
> >> There is another issue. From the error df, it seems like this is a
> >> multi-level/RM/multiple obs study, and SAS and R do not always
> >> agree on
> the
> >> computation of the df, as well as the type of SS that is being
> computed. You
> >> need to present both outputs, so that we can see both.
> >>
> >> I know almost nothing about R, and so my comments may not be relevant.
> >>
> >> -----Original Message-----
> >> From: r-sig-mixed-models-bounces op r-project.org
> >> [mailto:r-sig-mixed-models-bounces op r-project.org] On Behalf Of Ista
> Zahn
> >> Sent: Tuesday, May 01, 2012 12:51 PM
> >> To: Charles Determan Jr
> >> Cc: r-sig-mixed-models op r-project.org
> >> Subject: Re: [R-sig-ME] lme interaction result strange
> >>
> >> Hi Charles,
> >>
> >> My first guess is that you have (a) categorical variable(s) in your
> >> predictors, and that the contrasts in SAS are different than those
> >> in R.
> >>
> >> Best,
> >> Ista
> >>
> >> On Tue, May 1, 2012 at 1:39 PM, Charles Determan Jr
> >> <deter088 op umn.edu>
> >> wrote:
> >> > Dear R users,
> >> >
> >> > I have been working on replicating some linear mixed models from SAS.
> >> >  The
> >> > first one matches perfectly when the SAS model is simple with the
> three
> >> > separate factors.
> >> >
> >> > fit=lme(var~group+Event_name+Died,
> >> >    data=liv34,
> >> >    random=~1|ID)
> >> > anova.lme(fit, type="marginal", adjustSigma=F)
> >> >
> >> > However, once I put an interaction into the formula the values
> >> > don't match.
> >> >
> >> > fit=lme(var~group+Event_name+Died+Event_name*Died,
> >> >    data=liv34,
> >> >    random=~1|ID)
> >> > anova.lme(fit, type="marginal", adjustSigma=F)
> >> >
> >> >                          numDF denDF     F-value      p-value
> >> > (Intercept)               1        91       111.20483  <.0001
> >> > group                      1        23        0.46632     0.5015
> >> > Event_name            5        91        1.14042     *0.3449*
> >> > Died                       1        23        0.50989    * 0.4824*
> >> > Event_name:Died     5       91        1.10436     0.3637
> >> > Done.
> >> >
> >> > The numbers *bold* don't match up.  They should be approximately
> >> > .0290 and
> >> > .1318 respectively.  The other two are still exact matches.  I
> >> > know looking for exact matches is ambitious but the numbers
> >> > should be at least similar that the conclusions don't change so
> >> > drastically.
> >> >
> >> > Any thoughts as to why this discrepancy is happening would be
> >> > most appreciated.
> >> >
> >> > Regards,
> >> >
> >> > Charles
> >> >
> >> >        [[alternative HTML version deleted]]
> >> >
> >> > _______________________________________________
> >> > R-sig-mixed-models op r-project.org mailing list
> >> > https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >>
> >> _______________________________________________
> >> R-sig-mixed-models op r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
> >>
> >> -------------------------------------------------------------------
> >> ---- Confidentiality Notice: This e-mail message, including any
> >> attachments, is for the sole use of the intended recipient(s) and
> >> may contain privileged and confidential information.  Any
> >> unauthorized review, use, disclosure or distribution is prohibited.
> >> If you are not the intended recipient, please contact the sender by
> >> reply e-mail and destroy all copies of the original message.
> >>
> >
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-mixed-models op r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.



More information about the R-sig-mixed-models mailing list