blog/how-to-do-a-t-test-or-anova-for-many-variables-at-once-in-r-and-communicate-the-results-in-a-better-way/ #74
Replies: 18 comments 21 replies
-
Comment written by CARLOS ORTEGA on March 19, 2020 19:59:08: Thanks for your entry, very elaborated and clear. It will make the first analysis (not the graphical one) automatically even if the dataset includes categoricals. Thanks again, |
Beta Was this translation helpful? Give feedback.
-
Comment written by Duleep Samuel on March 20, 2020 08:02:54: thanks for sharing a very useful site |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on March 20, 2020 08:05:25: Glad you like it! |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on March 20, 2020 09:38:54: Thanks Carlos for your comment. I added a reference to the package you mentioned, but I'll definitely discuss it in more details in an article about descriptive statistics and/or about presenting odds ratio. Regards, |
Beta Was this translation helpful? Give feedback.
-
Comment written by Chuck Powell on March 20, 2020 12:18:19: Take a look at ggstatsplot (https://github.com/IndrajeetPatil/ggstatsplot) [full disclosure I contributed a small amount to the package in the past] |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on March 20, 2020 14:58:17: The package is really complete, thanks for your input Chuck! I have mentioned it in the article and I'll definitely discuss about it again in a future article. |
Beta Was this translation helpful? Give feedback.
-
Comment written by Shodan on April 02, 2020 17:16:00: Thank you for this I have found it very helpful. However, I have some questions. Questions
Any help interpreting these graphs would be very helpful. Thank you. Jason, the #rstatsnewbie |
Beta Was this translation helpful? Give feedback.
-
Comment written by Antoine Soetewey on April 03, 2020 08:00:14: Dear Shodan,
Hope this helps. Regards, |
Beta Was this translation helpful? Give feedback.
-
Comment written by Pat on May 29, 2020 21:49:01: I have a question on your ANOVA section for this article. I was under the impression that you couldn't use a t-test multiple times without making a correction to your p value, but the values shown in the graphs are non-adjusted is that right? - EDIT - It looks like you have that addressed in the introductory note on 'multiplicity'. I'm assuming that since your t-test values are so small, they qualify as fitting the Bonferroni correction for multiple t-tests. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for sharing your code. It is excellent! I have 6 ANOVAS that I want to run on my depedent variable and plot as boxplots. I have written a loop using lapply(), which allows me to run the 6 ANOVAS and plot the boxplots no problem. However, I have no idea how to loop so that I can do the pairwise comparisons and add the significant ones to the boxplots. Would you have any idea how to do this or how to ammend your code (which is similar to mine) to add these comparisons in one loop ? |
Beta Was this translation helpful? Give feedback.
-
Hello, Hard for me to reply without seeing your code. My code can be used to run ANOVAs and do multiple comparisons, but it will display all comparisons and not just the significant ones. I believe editing my code to display only the significant comparisons would be too much of a struggle (and not very efficient). However, here are two resources that may be of interest to you:
Hope this helps. Regards, |
Beta Was this translation helpful? Give feedback.
-
Dear Antoine, Thank you in advance! |
Beta Was this translation helpful? Give feedback.
-
Hi Antoine,
thank you a lot for your prompt answer. I will try it and let you know.
Kind regards
Hana
|
Beta Was this translation helpful? Give feedback.
-
Dear Antoine,
I reviewed my code and realized that I forget to set categories. Now everything is working.
Thank you for this blog! It is really helpful!
test4$Response <- as.factor(test4$Response)
test4$Response = factor(test4$Response, labels = c(A", "B", "C"))
|
Beta Was this translation helpful? Give feedback.
-
Dear Antoine, Thanks for this useful post. I have some questions, is it possible for you to help me? There is a problem in computer science called "graph coloring". Our goal in graph coloring is to color a graph with a number of colors, provided that each connected vertex has a different color. Our goal is to compare two methods of encoding, but I don't know how to delete the solver effect and just compare encoding methods. Observe that I don't know if the time of running is the best variable to compare, or if I can identify a better metric! Best regards, |
Beta Was this translation helpful? Give feedback.
-
Dear Antoine, thank you so much - if I understand correctly, using your version of t-tests with bonferroni adjustment would suffice?
I have no experience with Hotelling's either which is why I'd prefer to perform your version.
Next I have an embarassing question which I would prefer to ask in private.... :/
If I want to know if the number of people in one group are significantly different from the number of people in another group, then I use the chi-square, right?
It basically is, I guess, a frequency of occurences test, not computed on means but on sums but I really --- cannot for the life of me remember how to check for whether group sizes are significantly different :/
My example: female adults with epilepsy, female adults with physical disability, female adults with psychological disability, female adults with chronic pain.
Each group contains a number of females but how do I check if there are significant more female adults in one group compared to the other - per school that they attend (4 different schools). :/ I am so embarrassed.....
|
Beta Was this translation helpful? Give feedback.
-
At first, thank you for thevery nice explanations. :) I tried the comparison of 15 groups, with the last code here at the side. I get the plots, but there are just in half of the boxplots jitter points. Any idea why? Maybe, it is limited? |
Beta Was this translation helpful? Give feedback.
-
Dear Antoine Soetewey, I was wondering if you have the answers to the following questions of mine (I guess I should also ask the author of ggstatsplot):
Best wishes |
Beta Was this translation helpful? Give feedback.
-
How to do a t-test or ANOVA for more than one variable at once in R - Stats and R
Learn how to compare samples for multiple variables at once in R thanks to a Student t-test or ANOVA and communicate the results in a better way
https://statsandr.com/blog/how-to-do-a-t-test-or-anova-for-many-variables-at-once-in-r-and-communicate-the-results-in-a-better-way/
Beta Was this translation helpful? Give feedback.
All reactions