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)

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

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project Administrator
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 mtmiller (Posted a comment)
  • -email is unavailable- added by tpapastylianou (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-21 mtmiller CategoryOctave Function => Octave Forge 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.5