Using the dataset below- I have two independent factors here; one between factor
ID: 3269987 • Letter: U
Question
Using the dataset below-
I have two independent factors here; one between factor (OdorGender) and with one within factor (Distinct), thus I'm trying to conduct a two way, mixed design anova. At first, I used code
a<- aov(lm(difference~ OdorGender*distinct,data=data.df))
summary(a)
But, I realized that this was just for the Between Subject ANOVA - and the main effect.
Here, the dependent factor is "difference".
So to explain more in detail, in my experiment, a group of people had experiment with FemaleOdor, and the other group had their experiment with MaleOdor
Each participant's task was to remember the certain stimuli while smelling the odor, and there were 5 distinct stimuli. So each participants had all 5 distincts in their experiment.
I have a question on the two way ANOVA interaction (mixed design anova) in R. I'm trying to use lme4 ??? or nlme??. But what is the code..? how can I conduct mixed effect ANOVA?? is there any other way to use R and do mixed design anova analysis?
I need R code with explanation.. help!
id trial identity distinct difference OdorGender 1 1 3 0 0 Male 1 2 4 1.40E+00 8.00E-01 Male 1 3 5 2.80E+00 -4.00E-01 Male 1 4 1 -2.80E+00 4.00E-01 Male 1 5 2 -1.40E+00 -1.20E+00 Male 2 1 3 0 -1.20E+00 Male 2 2 4 1.40E+00 0 Male 2 3 1 -2.80E+00 -1.20E+00 Male 2 4 5 2.80E+00 8.00E-01 Male 2 5 2 -1.40E+00 -4.00E-01 Male 3 1 3 0 -4.00E-01 Male 3 2 1 -2.80E+00 -1.20E+00 Male 3 3 4 1.40E+00 0 Male 3 4 5 2.80E+00 8.00E-01 Male 3 5 2 -1.40E+00 8.00E-01 Male 4 1 4 1.40E+00 1.20E+00 Male 4 2 5 2.80E+00 1.20E+00 Male 4 3 2 -1.40E+00 -4.00E-01 Male 4 4 3 0 1.20E+00 Male 4 5 1 -2.80E+00 8.00E-01 Male 5 1 1 -2.80E+00 0 Female 5 2 5 2.80E+00 1.20E+00 Female 5 3 3 0 0 Female 5 4 2 -1.40E+00 -8.00E-01 Female 5 5 4 1.40E+00 -4.00E-01 Female 6 1 4 1.40E+00 0 Female 6 2 2 -1.40E+00 -1.20E+00 Female 6 3 1 -2.80E+00 -4.00E-01 Female 6 4 3 0 8.00E-01 Female 6 5 5 2.80E+00 0 Female 7 1 5 2.80E+00 -4.00E-01 Female 7 2 4 1.40E+00 4.00E-01 Female 7 3 2 -1.40E+00 4.00E-01 Female 7 4 3 0 -8.00E-01 Female 7 5 1 -2.80E+00 -8.00E-01 Female 8 1 4 1.40E+00 -4.00E-01 Male 8 2 2 -1.40E+00 -4.00E-01 Male 8 3 3 0 0 Male 8 4 1 -2.80E+00 -1.20E+00 Male 8 5 5 2.80E+00 8.00E-01 Male 9 1 2 -1.40E+00 8.00E-01 Male 9 2 3 0 4.00E-01 Male 9 3 1 -2.80E+00 0 Male 9 4 4 1.40E+00 1.20E+00 Male 9 5 5 2.80E+00 8.00E-01 Male 10 1 1 -2.80E+00 4.00E-01 Male 10 2 4 1.40E+00 0 Male 10 3 2 -1.40E+00 -1.20E+00 Male 10 4 3 0 8.00E-01 Male 10 5 5 2.80E+00 4.00E-01 Male 11 1 1 -2.80E+00 4.00E-01 Female 11 2 4 1.40E+00 1.20E+00 Female 11 3 5 2.80E+00 -8.00E-01 Female 11 4 2 -1.40E+00 -4.00E-01 Female 11 5 3 0 -8.00E-01 Female 12 1 2 -1.40E+00 0 Female 12 2 3 0 8.00E-01 Female 12 3 5 2.80E+00 -8.00E-01 Female 12 4 4 1.40E+00 8.00E-01 Female 12 5 1 -2.80E+00 -4.00E-01 Female 13 1 3 0 8.00E-01 Male 13 2 4 1.40E+00 -1.20E+00 Male 13 3 2 -1.40E+00 -8.00E-01 Male 13 4 1 -2.80E+00 0 Male 13 5 5 2.80E+00 4.00E-01 Male 14 1 1 -2.80E+00 -1.20E+00 Male 14 2 2 -1.40E+00 0 Male 14 3 4 1.40E+00 4.00E-01 Male 14 4 5 2.80E+00 8.00E-01 Male 14 5 3 0 -8.00E-01 Male 15 1 2 -1.40E+00 0 Female 15 2 3 0 -8.00E-01 Female 15 3 1 -2.80E+00 -1.20E+00 Female 15 4 4 1.40E+00 0 Female 15 5 5 2.80E+00 8.00E-01 FemaleExplanation / Answer
x=read.csv("Book1.csv")
difference=x[,5]
distinct=x[,4]
Odorgender=x[,6]
mxav=aov(difference ~ distinct*Odorgender, data=x)
summary(mxav)
> mxav
Call:
aov(formula = difference ~ distinct * Odorgender, data = x)
Terms:
distinct Odorgender distinct:Odorgender Residuals
Sum of Squares 6.48960 0.46080 0.37618 34.26489
Deg. of Freedom 1 1 1 71
Residual standard error: 0.6946971
Estimated effects may be unbalanced
> summary(mxav)
Df Sum Sq Mean Sq F value Pr(>F)
distinct 1 6.49 6.490 13.447 0.00047 ***
Odorgender 1 0.46 0.461 0.955 0.33181
distinct:Odorgender 1 0.38 0.376 0.779 0.38028
Residuals 71 34.26 0.483
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.