gdimarco / FinalProject

0 stars 0 forks source link

RM Anova #1

Open bartkrekelberg opened 5 years ago

bartkrekelberg commented 5 years ago

Importing of the data and creating the table looks fine.

Things start to go wrong near line 26. There you assign a table of data (unstackedData) to an element of a cell array that has the names of (dataNames). That cannot be right as you are now mixing chars (the original content of dataNames) with tables (assigned on line 26).

On line 27 you want to remove mice with missing data. That is good, but the code does not actually do that.

The last problem is the RM model specification. You are asking for a model with a term for each SUBJECT , but Matlab always implicitly adds a constant term to the model.
In other wordes y~SUBJECT is the same as y~ 1+ SUBJECT in Wilkinson notation.

But because there are no other terms beside SUBJECT , the constant term is actually the same as the SUBJECT term. Having two identical (or linearly dependent) terms in the regression model makes the model underdetermined (in class we briefly discussed this as the design matrix being rank deficient). To fix this you have to specify that the constant term should NOT be included. y~SUBJECT-1 does this.

I did not look at the code beyond this point yet.

gdimarco commented 5 years ago

Thank you for your comments. I have uploaded a new version based on all of your comments. I have also uploaded a new version of my safePrint assignment as you will need that to run the finished result of my analysis. If you have time to look over my corrections I would appreciate it. If not, I completely understand. Thank you.

gdimarco commented 5 years ago

I also forgot to mention, my post-hoc results look a bit strange, but I believe this is due to no significant results and a very small n. If I replace the term 'SessionType' with 'SUBJECT' to compare subjects, the output generates a "normal" looking result. For this reason I added different output options, so the user can specify whether they want to take time to run the anova and post-hoc tests or not.