Page 1 of 1

Error with jmv::ANOVA vs Jamovi for two way ANOVA

Posted: Fri Jan 29, 2021 3:03 pm
by iainjgallagher
Hi

Using Jamovi I can carry out a two-way ANOVA (Ratio as dep var; Optim & Sex as indep vars) on the following small dataset:

dput(swimming)
structure(list(Optim = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Optimists",
"Pessimists"), class = "factor"), Sex = structure(c(2L, 2L, 2L,
2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L), .Label = c("Female",
"Male"), class = "factor"), Event = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Free", class = "factor"),
Ratio = c(0.986, 1.108, 0.952, 0.998, 1.108, 0.985, 1.001,
0.924, 0.968, 0.983, 0.947, 0.932, 1.078, 0.997, 0.983, 1.105,
1.116)), class = "data.frame", row.names = c(NA, -17L))

When I try to carry out the same analysis using jmv::ANOVA in R:

Code: Select all

swimming <- read.table('data/swimming_data2.csv', sep = ',', header=TRUE)
ANOVA(Ratio ~ Optim * Sex, data = swimming)


I get the following error:

Code: Select all

Error in .subset2(x, i, exact = exact) : invalid subscript type 'list'
Can you help with this?

Best,

i

Re: Error with jmv::ANOVA vs Jamovi for two way ANOVA

Posted: Fri Jan 29, 2021 11:13 pm
by jonathon
i think you need to name the formula argument. try this:

ANOVA(formula = Ratio ~ Optim * Sex, data = swimming)

jonathon

Re: Error with jmv::ANOVA vs Jamovi for two way ANOVA

Posted: Sat Jan 30, 2021 4:32 pm
by iainjgallagher
ah, thanks... don't do stats tired!