Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Marta García-Granero <mgarciagranero@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Wrong results for Wilcoxon signed ranks test when data have decimal places (even using double) |

Date |
Thu, 14 Feb 2013 17:02:36 +0100 |

set type double input copper 0.70 0.45 0.72 0.30 1.16 0.69 0.83 0.74 1.24 0.77 0.65 0.76 0.42 0.94 0.36 0.98 0.64 0.90 0.63 0.55 0.78 0.10 0.52 0.42 0.58 0.62 1.12 0.86 0.74 1.04 0.65 0.66 0.81 0.48 0.85 0.75 0.73 0.50 0.34 0.88 end * One sample Wilcoxon's test (against population median = 0.6) signrank copper = 0.6

generate copper100 = round(copper*100) signrank copper100 = 60

* Ranks should have been the same in both cases, but they are not * Notice the difference for cases 5/6/7, 18/19, 22/23/24, 29/30, 32/33

egen double ranks1 = rank(abs(copper-0.6)) egen double ranks2 = rank(abs(copper100-60)) generate absdiff = abs(copper-0.6) sort absdiff list absdiff ranks1 ranks2

Thanks, Prof. Marta Garcia-Granero, PhD Department of Biochemistry and Genetics University of Navarra SPAIN. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: Wrong results for Wilcoxon signed ranks test when data have decimal places (even using double)***From:*Nick Cox <njcoxstata@gmail.com>

**Re: st: Wrong results for Wilcoxon signed ranks test when data have decimal places (even using double)***From:*Marta García-Granero <mgarciagranero@gmail.com>

- Prev by Date:
**st: Test for cross-sectional dependency in dynamic panel data** - Next by Date:
**Re: st: Macro parsing question.** - Previous by thread:
**st: Test for cross-sectional dependency in dynamic panel data** - Next by thread:
**Re: st: Wrong results for Wilcoxon signed ranks test when data have decimal places (even using double)** - Index(es):