SPSS syntax for Benjamini-Hocberg FDR procedure

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

SPSS syntax for Benjamini-Hocberg FDR procedure

Bruce Weaver
Administrator
There has been some discussion of the Benjamini-Hochberg False Discovery Rate (FDR) procedure in another recent thread.  I found this syntax (called a "script" on the site) for calculating it:

   http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/FDR

As far as I can see, there is absolutely no need for the !nbcases macro.  The number of cases is already saved in variable N, and the COMPUTE line that has division by !nbcases works exactly the same if you divide by N.  When I revised their syntax accordingly (i.e., get rid of the WRITE OUTFILE that defines !nbcases, get rid of INCLUDE FILE to call the macro, and get rid of unneeded EXECUTES), I got exactly the same results.  

I then plugged in the 15 p-values from Benjamini & Hochberg (1995, p. 295), and got the same result they report too.

Results for 15 p-values in BH (1995):

P Value FDR Criterion  FDR Significance
  .0001          .050                 1
  .0004          .050                 1
  .0019          .050                 1
  .0095          .050                 1
  .0201          .050                 0
  .0278          .050                 0
  .0298          .050                 0
  .0344          .050                 0
  .0459          .050                 0
  .3240          .050                 0
  .4262          .050                 0
  .5719          .050                 0
  .6528          .050                 0
  .7590          .050                 0
  1.000          .050                 0
 
 
Finally, if you back up a level, you'll find a general 255-item FAQ that might be useful.

   http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ

HTH.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

Bruce Weaver
Administrator
Oops...apologies to Dr. Hochberg for that typo in the subject line!  I got it right in the body of the message.

Bruce Weaver wrote
There has been some discussion of the Benjamini-Hochberg False Discovery Rate (FDR) procedure in another recent thread.  I found this syntax (called a "script" on the site) for calculating it:

   http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ/FDR

As far as I can see, there is absolutely no need for the !nbcases macro.  The number of cases is already saved in variable N, and the COMPUTE line that has division by !nbcases works exactly the same if you divide by N.  When I revised their syntax accordingly (i.e., get rid of the WRITE OUTFILE that defines !nbcases, get rid of INCLUDE FILE to call the macro, and get rid of unneeded EXECUTES), I got exactly the same results.  

I then plugged in the 15 p-values from Benjamini & Hochberg (1995, p. 295), and got the same result they report too.

Results for 15 p-values in BH (1995):

P Value FDR Criterion  FDR Significance
  .0001          .050                 1
  .0004          .050                 1
  .0019          .050                 1
  .0095          .050                 1
  .0201          .050                 0
  .0278          .050                 0
  .0298          .050                 0
  .0344          .050                 0
  .0459          .050                 0
  .3240          .050                 0
  .4262          .050                 0
  .5719          .050                 0
  .6528          .050                 0
  .7590          .050                 0
  1.000          .050                 0
 
 
Finally, if you back up a level, you'll find a general 255-item FAQ that might be useful.

   http://imaging.mrc-cbu.cam.ac.uk/statswiki/FAQ

HTH.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

paola
In reply to this post by Bruce Weaver
Sorry if I am doing this wrong but I am new to the forum. I am trying to run the Benjamini Hochberg procedure on SPSS using the IBM syntax below. I have two problems: when I include a list of p-values in the SPSS file how should I write p<0.005 (p=0 in the SPSS output)? If I want to obtain q values to show the reviewer (who asked for the correction) what syntax can I use? The only approach I found is to manually calculate q values by multiplying the original p-value by m (n of comparisons) and dividing by r (rank of the p-value in ascending order). Any help will be greatly appreciated!
Paola

sort cases by p (a).

compute i=$casenum.
 sort cases by i (d).
 compute q=.05.
 compute m=max(i,lag(m)).
 compute crit=q*i/m.
 compute test=(p le crit).
 compute test=max(test,lag(test)).
 execute.
 formats i m test(f8.0) q (f8.2) crit(f8.6).
 value labels test 1 'Significant' 0 'Not Significant'.

Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

Bruce Weaver
Administrator
"...when I include a list of p-values in the SPSS file how should I write p<0.005 (p=0 in the SPSS output)?"

Double-click on the pivot table where the p-value is shown, then double-click on the cell in the table containing the p-value to see the value with several more decimals.  Copy and paste.

HTH.


paola wrote
Sorry if I am doing this wrong but I am new to the forum. I am trying to run the Benjamini Hochberg procedure on SPSS using the IBM syntax below. I have two problems: when I include a list of p-values in the SPSS file how should I write p<0.005 (p=0 in the SPSS output)? If I want to obtain q values to show the reviewer (who asked for the correction) what syntax can I use? The only approach I found is to manually calculate q values by multiplying the original p-value by m (n of comparisons) and dividing by r (rank of the p-value in ascending order). Any help will be greatly appreciated!
Paola

sort cases by p (a).

compute i=$casenum.
 sort cases by i (d).
 compute q=.05.
 compute m=max(i,lag(m)).
 compute crit=q*i/m.
 compute test=(p le crit).
 compute test=max(test,lag(test)).
 execute.
 formats i m test(f8.0) q (f8.2) crit(f8.6).
 value labels test 1 'Significant' 0 'Not Significant'.
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

paola
Thanks! When I click on the pivot table I get 6.381405842495763E-5 which apparently I can't paste as it is because the SPSS file does not recognize it. I had to convert it manually to 0.0000638. Is there something I can do about this? PS: Any suggestions for getting the q-values automatically?
Paola
Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

Jon K Peck
Statistics does read e format numbers, but you have to declare that in the format.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        paola <[hidden email]>
To:        [hidden email],
Date:        10/05/2013 03:28 AM
Subject:        Re: [SPSSX-L] SPSS syntax for Benjamini-Hocberg FDR procedure
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Thanks! When I click on the pivot table I get 6.381405842495763E-5 which
apparently I can't paste as it is because the SPSS file does not recognize
it. I had to convert it manually to 0.0000638. Is there something I can do
about this? PS: Any suggestions for getting the q-values automatically?
Paola



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/SPSS-syntax-for-Benjamini-Hocberg-FDR-procedure-tp5714855p5722395.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

Bruce Weaver
Administrator
In reply to this post by paola
Help > Core System > Pivot tables > Cell properties

Cell properties: Format value

The Format Value tab controls value formats for the selected cells. You can select formats for numbers, dates, time, or currencies, and you can adjust the number of decimal digits that are displayed.

To change value formats for selected cells in a pivot table:

 Activate the table.

 Select the cell(s) that you want to modify.

 From the Format menu or the context menu choose Cell Properties.

 Click the Format Value tab.


paola wrote
Thanks! When I click on the pivot table I get 6.381405842495763E-5 which apparently I can't paste as it is because the SPSS file does not recognize it. I had to convert it manually to 0.0000638. Is there something I can do about this? PS: Any suggestions for getting the q-values automatically?
Paola
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: SPSS syntax for Benjamini-Hocberg FDR procedure

paola
In reply to this post by paola
Again- thank you so much everybody. I have a further question (sorry!) : I am using SPSS 19 which runs post-hoc tests pairwise comparisons for the Friedman test- I access them by double clicking on the output page. However, unlike in other SPSS pivot tables, by double clicking again I do not get the "full" decimal places I need for the significance levels (which is particularly  troublingfor the "p=0 " problem" in the Benjamini Hochberg).I tried using the legacy dialog box (from former SPSS versions) but of course it doesn't give me the pairwise comparisons.PS: