When using the "ranksum" function, how can I differentiate bewteen the two options of getting a low p-value?
Afficher commentaires plus anciens
Say I have two vectors- A and B. If I get a low p-value, I would like to check whether this low p-value stands for high median of B compared to A, instead of just different medians (that is, either the median of B is higher than the median of A, or vise versa).
For example:
A=[120 10 201 20 30 12 30 10 2 2 3 5 1]
B=[140 400 120 2000 30 40 2000 1000 1000]
I get a p-value of 7.2251e-004.
But if
B=[1 0 0 0 0 0 0 0 0 0 0 0 0]
I also get a low p-value (6.4360e-006).
I would like to get only low p-values when B median is higher then A median. Since I have many calculations, I need it to be automatically in the code, instead of checking every pair of vectors. Do you have any idea how to do that?
Thanks, Michal
Réponse acceptée
Plus de réponses (1)
the cyclist
le 6 Août 2012
Modifié(e) : the cyclist
le 6 Août 2012
Use the 'tail' option. A careful read of
>> help ranksum
will explain how.
(In the first draft of my answer, I pointed to "doc ranksum" rather than "help ranksum", but it seems that that documentation doesn't list the 'tail' option. Weird.)
4 commentaires
Michal
le 7 Août 2012
Michal
le 7 Août 2012
the cyclist
le 7 Août 2012
Ah. I am using the prerelease of R2012b. It seems that 'tail' option is new.
Michal
le 9 Août 2012
Catégories
En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!