ANOVA Within and Between Subject

Discuss statistics related things
Post Reply
j3ypi
Posts: 8
Joined: Thu May 04, 2017 4:24 pm

ANOVA Within and Between Subject

Post 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.
User avatar
jonathon
Posts: 2840
Joined: Fri Jan 27, 2017 10:04 am

Re: ANOVA Within and Between Subject

Post 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.
j3ypi
Posts: 8
Joined: Thu May 04, 2017 4:24 pm

Re: ANOVA Within and Between Subject

Post 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.
User avatar
Ravi
Posts: 201
Joined: Sat Jan 28, 2017 11:18 am

Re: ANOVA Within and Between Subject

Post 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.
j3ypi
Posts: 8
Joined: Thu May 04, 2017 4:24 pm

Re: ANOVA Within and Between Subject

Post 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!
Annach
Posts: 2
Joined: Tue Jul 30, 2024 4:51 pm

Re: ANOVA Within and Between Subject

Post by Annach »

Dear Jamovi users and cerators, anyone has an idea how to solve 'empty cell in between Subjects design...'? That occur when I try to do RM Anova. I don't Think I miss data. All calculations arę fine as long as I insert Just one factor in the 'between subject factors' field. Maybe I need to specife that software should ignore missing data? But how do I do this? I tryed to specify it in relevant column data (=='ignore_missing=1') but it did not help. I'm trying kind of randomly. I'm pretty crappy statistisian ;p
Attachments
Screenshot 2024-07-31 at 12.24.13 PM.png
Screenshot 2024-07-31 at 12.24.13 PM.png (506.13 KiB) Viewed 14876 times
User avatar
jonathon
Posts: 2840
Joined: Fri Jan 27, 2017 10:04 am

Re: ANOVA Within and Between Subject

Post by jonathon »

hi,

the issue is that there's a combination of `Status zwiazku` and `zamieszkanie groupy` that you have zero observations for.

i'd suggest running a contingency table (Frequencies -> Independent samples) to locate the empty cell. here's an example. you can see that the *combination* of 'female' and 'non-smoking' has zero counts. your data will have a similar problem.
Screenshot 2024-08-01 at 08.57.42.png
Screenshot 2024-08-01 at 08.57.42.png (114.1 KiB) Viewed 14847 times
Post Reply