User Tools

Site Tools


analysis:stat:fisherexacttest

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
analysis:stat:fisherexacttest [2014/12/15 18:10] igorkagananalysis:stat:fisherexacttest [2014/12/16 11:15] igorkagan
Line 8: Line 8:
  
 <code matlab> <code matlab>
-% Fisher's exact test+%% Fisher's exact test
 Ns1 = 10; % status 1 (e.g. control) Ns1 = 10; % status 1 (e.g. control)
 Ns2 = 10; % status 2 (e.g. stimulation) Ns2 = 10; % status 2 (e.g. stimulation)
-status1_prop = 8/2; % outcome 1 / outcome 2 +status1_prop = 8/2;proportion outcome 1 / outcome 2, binomial proportion  
-status2_prop = 1/9; % outcome 1 / outcome 2+status2_prop = 1/9;proportion outcome 1 / outcome 2, binomial proportion 
 y1 = zeros(1,Ns1);  y1 = zeros(1,Ns1);
-y2 = ones(1,Ns2);+y2 = ones(1,Ns2); % let's assign outcome 2 as "success" (arbitrary)
  
 x1 = [zeros(1,round(  status1_prop*Ns1 / (1 + status1_prop) )) ones( 1,round(  Ns1 - status1_prop*Ns1 / (1 + status1_prop)  ))]; % status 1 outcome  x1 = [zeros(1,round(  status1_prop*Ns1 / (1 + status1_prop) )) ones( 1,round(  Ns1 - status1_prop*Ns1 / (1 + status1_prop)  ))]; % status 1 outcome 
analysis/stat/fisherexacttest.txt · Last modified: 2022/12/29 07:15 by 127.0.0.1