Page 1 of 1

ANOVA Within and Between Subject

Posted: Sat May 06, 2017 9:59 am
by j3ypi
I'm not quiet sure how to use the function for repeated measures anovas.

I have a 2x2 design with the version of the survey (1 or 2) and the ratio of solving an item before and after a certain explanation of the items depending on which version of the survey someone had.

Now I ran into some difficulties regarding between subject effects. I want to have "Version_Survey" as the between subject factor.

Code: Select all

anovaRM(
    data = daten,
    rm = list(
        list(
            label = "Version_Survey",
            levels = c(1, 2))),
    rmCells = list(
        list(
            measure = "Literacy_pre",
            cell = 1),
        list(
            measure = "Literacy_post",
            cell = 2)),
    rmTerms = list(
        "Version_Survey"))
Any idea of what I have to add for that? Maybe "bs" or "bsTerms" I thought but wasn't able implement it correctly.

Thanks in advance.

Re: ANOVA Within and Between Subject

Posted: Sat May 06, 2017 11:06 am
by jonathon
hi, the easiest way to get the right syntax is just to fire up jamovi and put it in syntax mode. then you can use the UI, and it will give you the right syntax.

but "bs" should be the correct argument to specify the between subjects factors.

https://www.jamovi.org/jmv/anovarm.html

if you're still stuck, feel free to post your data set here and we'll take a look.

Re: ANOVA Within and Between Subject

Posted: Sat May 06, 2017 11:48 am
by j3ypi
I can't use the jamovi gui because of the error caused by the NAs. I'll look into it later or just wait for the new release with the fix.

Re: ANOVA Within and Between Subject

Posted: Sat May 06, 2017 12:13 pm
by Ravi
It would be something like this:

Code: Select all

rm <- list(
    list(
        label="Literacy",
        levels=c("pre", "post")
    ))

rmCells <- list(
    list(
        measure="Literacy_pre",
        cell="pre"),
    list(
        measure="Literacy_post",
        cell="post"))

jmv::anovaRM(
    data = daten,
    rm = rm,
    rmCells = rmCells,
    rmTerms=list("Literacy"), 
    bs="Version_Survey",
    bsTerms=list("Version_Survey"))
This assumes that you have your data in wide format. In rm you define the name of your RM variable + the levels in that variable. With rmCells you link the columns in your data to the RM levels. Subsequently, you have to define you BS variable in bs. For now, you also have to define the terms, but in the future it will just assume that you want all the terms if you don't define these.

This is not the easiest syntax mostly because it assumes you have your data in wide format. In the future we want to support long format data which will make the syntax much easier.

Re: ANOVA Within and Between Subject

Posted: Sat May 06, 2017 12:25 pm
by j3ypi
Thanks a lot.

Even if it's not the easiest Syntax, it's still the best way to go in R. The lack of Within Subject ANOVAs in R is one of the few disadvantages compared to SPSS/SAS/Stata. In psychology you have to do them pretty often.

Keep up the good work!