Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Testing for normality for each groups in the ANOVA

Dear colleagues,

I am exploring JASP for first time and I am not sure how to test for assumption of normality for each groups when you conduct an ANOVA. There is a Q-Q plot but for all the data, not stratified by groups, there is not a Saphiro-wilk test as in the t-test. Is there any method to proceed?

Thanks!

Comments

  • Hi mrvallejo,

    I'll ask Johnny (who has done most of the frequentist ANOVA work). It seems to me that what the ANOVA model assumes is normality of the residuals, but Johnny will know best.

    Cheers,

    E.J.

  • edited March 2019

    Hi mrvallejo,

    The normality assumption of the ANOVA concerns the distribution of the residuals, not the raw data itself. Because the residuals are the differences between the observed dependent variable and the predicted dependent variable, we can show the qq-plot for all groups combined, which is commonly done.

    I find this exchange particularly enlightening: https://stats.stackexchange.com/questions/6350/anova-assumption-normality-normal-distribution-of-residuals

    Basically, if you plot the residuals instead of the raw data, you can fit all residuals to the same normal distribution, whereas if you were to do this for the raw data, you would need to fit it to different normal distributions per group.

    Kind regards,

    Johnny

  • Dear Johnny & EJ,

    I'm starting to make myself familiar with JASP and the BayesFactor package.

    What code would I use in R with the BayesFactor package to create the same QQ plot as is done in JASP?

    It would be really useful to get the R code that is running under the hood in JASP so the user wouldn't have to rely on the GUI as much.

    Cheers,

    Michael

    PS: From what I understand something like this is already in preparation perhaps: https://forum.cogsci.nl/discussion/5462/analysis-of-effects-output-from-jasp-r-code

  • Johnny is on vacation but I asked another team member for input...

    E.J.

  • Hi Michael,

    This is something we are working on very hard at the moment!

    For now, you can use the function here (you also need the ggplot2 package for this): https://github.com/jasp-stats/jasp-desktop/blob/stable/JASP-Engine/JASPgraphs/R/plotQQnorm.R

    Kind regards,

    Johnny

  • Dear Johnny,

    That sounds very useful. I'm looking forward to it!

    Thanks for pointing me to the R code. I realized that extracting the residuals from a factorial design is anything but black magic. It just entails subtracting the cell means from each observed value if I am not mistaken :) So no need to "extract residuals" from the BayesFactor object in R.

    Perhaps you are the right person to ask about the meaning of the error bars in the Q-Q plot? The code makes it sound like they represent the "confidence band". What does that mean in the context of a Q-Q plot? Is this based on the confidence interval for the condition mean?

    Thanks for your time!

    Cheers,

    Michael

  • Simon Kucharsky email me: "The bars in QQ plots are present only for Bayesian ANOVAs, and correspond to xy% credible intervals. More info is in the Don's paper: https://www.cairn.info/journal-l-annee-psychologique-2020-1-page-73.htm#. The classical analyses do not show CIs. I guess it would be possible to add that, but it's probably more work than to just get the CIs from the MCMC samples."

    EJ

  • Merci bcp! That is a nice introductory paper. Credible intervals seem like a good piece of information to have when assessing how badly Gaussianity is violated in Q-Q plots. In that paper for example, the red line is nowhere near the credible intervals of the outlier residuals.

    Michael

Sign In or Register to comment.