angelo.arcadi at virgilio.it
2015-Nov-23 09:45 UTC
[R] R: Re: How to plot results from lme in presence of a significant interaction
Dear Bert and R list, actually I had tried the interaction plot function, but I deduced that it was not the correct function since it gave me an empty plot (no lines). This should not be correct because as you can see from the results of the analysis I reported in the previous e-mail, there is a significant interaction. The syntax for the function I used was interaction.plot(scrd$Weight, scrd$Height,scrd$Centroid) I want to plot my data and visualize the regression line showing the linear relationship between my dependent variable and the interaction between Weight and Height of the participants. How this is done in R? Thank you Best regards Angelo>----Messaggio originale---- >Da: bgunter.4567 at gmail.com >Data: 22-nov-2015 23.45 >A: "angelo.arcadi at virgilio.it"<angelo.arcadi at virgilio.it> >Cc: "r-help"<r-help at r-project.org> >Ogg: Re: [R] How to plot results from lme in presence of a significantinteraction> >I would have thought the first place to look would be ?interaction.plot > >Cheers, > >Bert >Bert Gunter > >"Data is not information. Information is not knowledge. And knowledge >is certainly not wisdom." > -- Clifford Stoll > > >On Sun, Nov 22, 2015 at 2:44 PM, angelo.arcadi at virgilio.it ><angelo.arcadi at virgilio.it> wrote: >> Dear list members, >> I wonder which is the best way to plot in r the >> results from the lme function, in presence of a significant interaction. >> My model has two interacting fixed effects and a random effect. The >> analysis is from an experiment where 19 participants had to adjust the >> Centroid parameter of some sounds stimuli, and I want to assess whether >> there is a relationship between their choices and their height and >> weight. There were 12 stimuli repeated twice for a total of 24 trials. >> Here is the output of my analysis: >> >> > library(nlme) >> > lme_Centroid <- lme(Centroid ~ Weight*Height, data = scrd, random =~1 | Subject)>> > >> > summary(lme_Centroid) >> Linear mixed-effects model fit by REML >> Data: scrd >> AIC BIC logLik >> 25809.38 25840.69 -12898.69 >> >> Random effects: >> Formula: ~1 | Subject >> (Intercept) Residual >> StdDev: 398.9658 3027.67 >> >> Fixed effects: Centroid ~ Weight * Height >> Value Std.Error DF t-value p-value >> (Intercept) -20232.203 9101.096 1349 -2.223051 0.0264 >> Weight 478.854 152.184 15 3.146536 0.0067 >> Height 140.440 52.194 15 2.690751 0.0168 >> Weight:Height -2.725 0.838 15 -3.253770 0.0053 >> Correlation: >> (Intr) Weight Height >> Weight -0.927 >> Height -0.994 0.886 >> Weight:Height 0.951 -0.996 -0.919 >> >> Standardized Within-Group Residuals: >> Min Q1 Med Q3 Max >> -1.5059828 -0.8664208 -0.2111113 0.7098706 2.3620633 >> >> Number of Observations: 1368 >> Number of Groups: 19 >> >> >> >> I >> do not know how to represent in R these results. I tried >> xyplot(Centroid ~ Weight * Height, type = c("p","r"), data = scrd) but I >> guess it is wrong. >> >> Thank you in advance >> >> Best regards >> >> Angelo >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html>> and provide commented, minimal, self-contained, reproducible code. >