Games-howell test in R and implementing a function
0
0
Entering edit mode
3.2 years ago

How do I implement this code to find a significant difference between groups in my data set using Games -Howell test? This is the link to the code for the Games-Howell test: http://aoki2.si.gunma-u.ac.jp/R/src/tukey.R I would like to know how do I implement this code in R? Which arguments do I need to feed to the function to give me the result?

R gameshowell nonparametrictest • 3.8k views
ADD COMMENT
0
Entering edit mode

Hi,

How is this related to bioinformatics?

ADD REPLY
0
Entering edit mode

Because I would like to analyse a patient dataset to look for statistically significant difference between 2 groups of patients. So it is a bioinformatic analysis of metabolomes and hence I would like to execute this code to see for a difference.

ADD REPLY
1
Entering edit mode

Please edit your question and add this information in there. This connection makes the post relevant to the website, as without it, you could be asking this on Cross Validated (the statistics Stack Exchange).

ADD REPLY
0
Entering edit mode

rstatix has this function and here is the link to do it with example: https://rpkgs.datanovia.com/rstatix/reference/games_howell_test.html. However, Tukey's test and GH test will yield similar results as per https://rpubs.com/aaronsc32/games-howell-test. So it might be better to consider Tukey's test as there are enough tutorials on Tukey's test.

ADD REPLY
0
Entering edit mode

My data set does not have an equal sample size, that is why I preferred to do the Games-Howell. But when I performed the Games-Howell from the "userfriendlyscience" package, it was a post-hoc analysis for the ANOVA but I wanted to do a non-parametric test from the beginning as my data is not normally distributed.

ADD REPLY
0
Entering edit mode

GH test function from rstatix which i linked above is not a post-hoc test (as far as I know). It seems it can handle imbalanced data sets. However, requires more (>6) samples per group.

ADD REPLY
0
Entering edit mode

Yea. I just ran the test using the rstatix package and it gave me the same result as the Post-hoc Games-Howel test of the User-friendly package. That is why I was trying to figure out how to execute the code I mentioned above to check if it give me a different result.

ADD REPLY
0
Entering edit mode

you don't need to implement it in R. It's already in R code. Source the file and use the function tukey as defined in the source code.

Example code using the code furnished in OP:

> source("http://aoki2.si.gunma-u.ac.jp/R/src/tukey.R")

> tukey(ToothGrowth$len,ToothGrowth$supp,method="Games-Howell")

$result1
        n     Mean Variance
Group1 30 20.66333 43.63344
Group2 30 16.96333 68.32723

$Games.Howell
           t       df          p
1:2 1.915268 55.30943 0.06063451

> tukey(ToothGrowth$len,ToothGrowth$supp,method="Tukey")
$result1
        n     Mean Variance
Group1 30 20.66333 43.63344
Group2 30 16.96333 68.32723

$Tukey
           t          p
1:2 1.915268 0.06039337

$phi
[1] 58

$v
[1] 55.98033
ADD REPLY
0
Entering edit mode

Thanks a lot for your help. I ran the code, and it gave me the same result. So, I guess it is the correct output. Have a nice day :)

ADD REPLY

Login before adding your answer.

Traffic: 1797 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6