patchPSPP - Patches: patch #6635, Wilcoxon signed rank test

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #6635: Wilcoxon signed rank test

Submitter:  John Darrington <jmd>
Submitted:  Thu 18 Sep 2008 11:43:56 AM UTC
   
 
Category:  None Item Group:  None
Status:  Done Assigned to:  None
Open/Closed:  Closed

Sat 20 Sep 2008 01:45:33 AM UTC, comment #2: 

Thanks for the suggestions.  I checked this in.  I tried your suggestion about SIGINT.  For some reason it didn't work.  I'll investigate more deeply later.  I used the sigsetjmp like you suggested. Thanks.

John Darrington <jmd>
Group administrator
Fri 19 Sep 2008 04:10:52 AM UTC, comment #1: 

Good work.  It takes a lot of motivation, at least on my own part, to track down implementations of code and then ask their authors to relicense it, and so I admire that you have done it so successfully.

A few comments:

  • "asymptotic" is misspelled in the documentation (extra "s").


  • Regarding the signal handler, another way that you might consider, if it is appropriate, is simply to set a variable from the signal handler, then periodically that variable's value.  The code in src/libpspp/model-checker.c does this, for example.


  • Along the same lines, you might consider handling SIGINT also, so that the user can interrupt the processing with ^C and no harm done.  (Probably, we should make this apply to all PSPP commands at some point, but it seems fine to me to special-case it for now.)


  • I don't see any reason to use SA_NODEFER, unless it is to ensure that jumping out of the signal handler does not leave the signal blocked forever.  The conventional (and slightly safer) way to do that, I think, would be to use sigsetjmp(). with "1" as the second argument, and siglonjmp(), in place of plain setjmp() and longjmp()
Ben Pfaff <blp>
Group administrator
Thu 18 Sep 2008 11:43:56 AM UTC, original submission:  

This patch adds the /WILCOXON subcommand to NPAR TESTS.

Some things to note:

1. The other software produces a value titled "point probablility".  I've no idea what this means or how to generate it, so I've left it out.  If somebody knows what it means and how to calculate it, then I'll include it.

2. I've to calculate the wilcoxon significance, I've used a routine from Dr. Rob van Son whom I contacted, and he's kindly agreed to put this code under GPLv2+  The results from this are slightly different to those from the Chicago sofware --- about 1/2 digits in the second decimal place.  Looking at their documentation, I infer that they're using some very anachronistic routine (they talk about running out of memory when calculating it), so frankly I'm more inclined to trust this routine than the other one.

3. Like the other software, the /METHOD=EXACT option takes a rediculously long time, if the number of cases is more than about 20.  Therefore the TIMER option sets a maximum time to try.  Although I thought it would be easy pre-empt a routine
on a timer in posix, it wasn't so simple after all.  I ended up jumping out of a signal handler with a longjmp --- somewhat messy, but after some thought, I can't see any reason why it's not portable or not safe (on a single threaded posix system).


John Darrington <jmd>
Group administrator

 

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

Attached Files
file #16518:  wilcoxon.patch added by jmd (39KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by jmd (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.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-09-20 jmd Open/ClosedOpen Closed
    2008-09-20 jmd StatusReady For Test/Review Done
    2008-09-18 jmd Attached File- Added wilcoxon.patch, #16518

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code