bugGNU Octave - Bugs: bug #50169, [octave forge] (statistics) u_test...

 
 

bug #50169: [octave forge] (statistics) u_test wrong result (reversed alternative hypothesis p value and inaccurate z value)

Submitter:  Tasos Papastylianou <tpapastylianou>
Submitted:  Sat 28 Jan 2017 01:50:29 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Wont Fix Assigned to:  None
Originator Name:  Tasos Papastylianou <poacheR> Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 08 Aug 2022 07:27:18 PM UTC, comment #3: 

closing report as per package maintainer.

Nicholas Jankowski <nrjank>
Group Member
Mon 08 Aug 2022 06:56:57 PM UTC, comment #2: 

The reason for the inaccuracy with small sample sizes is that different computational methods are being used (full enumeration or network algorithm). The newly implemented ranksum function covers u_test functionality and it is best practice to use ranksum for doing a Mann Whitney U test. I suggest it is best to deprecate this function from the next release and close this bug,  since there is no reason to reimplement the functionality of ranksum in u_test in order to fix the inaccuracy problems.

Andreas Bertsatos <pr0m1th3as>
Sat 21 Apr 2018 05:38:23 PM UTC, comment #1: 

Reassigning to the Octave Forge statistics package, the u_test function has been removed from Octave 4.4.

Mike Miller <mtmiller>
Group Member
Sat 28 Jan 2017 01:50:29 PM UTC, original submission:  

As per http://stackoverflow.com/questions/41902166/octave-mann-whitney-u-test-p-value-confusion/




   1   1   1   1   1

octave:2> y=[2,2,2,2,2,2]
y =

   2   2   2   2   2   2

octave:3> [p,z]=u_test(x, y, "<>")
p =  0.0061699
z = -2.7386
octave:4> [p,z]=u_test(x, y, ">")
p =  0.0030849
z = -2.7386


The u_test function seems to have the 'alternative hypothesis' p values the wrong way round.

Furthermore, the z value is inconsistent with other sources (online calculators, and the equivalent function in julia, but those two are also inconsistent with each other).
In fairness, the source code does state the z value will be inaccurate for smaller sample sizes, but I have no idea where the discrepancy is coming from.

Tasos Papastylianou <tpapastylianou>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by pr0m1th3as (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by tpapastylianou (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-08-08 nrjank StatusNone Wont Fix
        Open/ClosedOpen Closed
    2018-04-21 mtmiller CategoryOctave Function Octave Package
        Release4.2.0 dev
        Summaryu_test produces wrong result (reversed alternative hypothesis p value and inaccurate z value) [octave forge] (statistics) u_test wrong result (reversed alternative hypothesis p value and inaccurate z value)

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code