[R] ks.test and wilcoxon.test results differ from other stat.packages

Rui Barradas ruipbarradas at sapo.pt
Fri Feb 1 16:33:31 CET 2013


Hello,

As for the KS test, the op might also want to look at

Simard, L'Ecuyer (2011)
http://www.jstatsoft.org/v39/i11

for an account on the different algorithms available, and their accuracy.
Apparently, R uses different algorithms according to the test in 
question. See the details section of ?ks.test. See also the references 
there, such as

Marsaglia, Tsang, Wang (2003)
http://www.jstatsoft.org/v08/i18/

Hope this helps,

Rui Barradas

Em 01-02-2013 11:24, Meyners, Michael escreveu:
> Impossible to say w/o a reproducible example, but to start with let me suggest looking at the exact= (both functions) and correct= (wilcox.test) arguments. Experience shows that some change of the default settings allows you to reproduce results from other software (and the help pages will explain you what the settings do; by that, you might also learn what your other tools actually calculate if you have no documentation at hand).
>
> HTH, Michael
>
>> -----Original Message-----
>> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
>> project.org] On Behalf Of Alexander Favorov
>> Sent: Freitag, 1. Februar 2013 09:00
>> To: r-help at r-project.org
>> Subject: [R] ks.test and wilcoxon.test results differ from other
>> stat.packages
>>
>> Probably, it's an obvious info, but I have not found anything in R FAQ
>> concerning this feature/bug.
>>
>> The results of ks.test and wilcoxon.test (in the Mann-Whitney version,
>> paired = 'FALSE') don't coincide with the results from the other
>> statistical packages, e.g. Statistica, Medcalc, and (as for MW test)
>> from the numerous online MW tests.
>>
>> E.g.
>> Statistica p-value=0.0435353
>> Medcalc p-value=0.0435354
>> R p-value=0.04635
>>
>> If I want to obtain result of test once, it does not matter.
>>
>> But what should I do if I want to perform Monte-Carlo simulations and I
>> need in 10000 or even 100 000 p-values and then will build some
>> distribution and then use results of Statictica? Whtever, the
>> descrepancy bothers.
>>
>> Are there some alternative packages for non-parametric statistics that
>> produce results comparable with the other program packages? Or,
>> probably, there is exists some environment variable to perform
>> calculations in more common way?
>>
>> Thank you!
>>
>> Sasha.
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list