neuropsychology / psycho.R

An R package for experimental psychologists
https://neuropsychology.github.io/psycho.R/
Other
145 stars 32 forks source link

Extend psycho package to include Wilcoxon rank sum test (non-parametric version of t-test) #76

Open MarkJThomas opened 6 years ago

MarkJThomas commented 6 years ago

Hi all,

I have been using the psycho package to retrieve summary stats and publishable info of the t-test for my manuscripts, I wondered if this can be extended to include the Wilcoxon rank sum test, please?

Many thanks Mark Thomas

DominiqueMakowski commented 6 years ago

Wilcoxon's rand sum test is not implemented yet, as I have no experience with it and its reporting. Nevertheless, I believe extending the analyze function to support it could be done quite easily.

As a wilcoxon test belongs to the "htest" class, its method should go in the analyze.htest method.

As you can see in the related file, from line 51 to 71, it takes care of the "correlation" subclass. Below, of the t-test.

Therefore, one could easily add a else if (grepl("Wilcoxon", values$method)) (if there is the word Wilcoxon in the method name), and then add below the specific text formatting code.

@r-sonist Feel free to try implementing it if you want, it could be a useful feature :)