%LMcs090503_4th.m
% Written by Eugene.Gallagher@umb.edu
% Calls Gallagher's binom2sample.m, which
% Written November 2010, Revised 12/12/10,2/27/11
[D,phat,z,pvalue,CI,obsp]=binom2sample(34,40,19,35,0.05)
fprintf('The expected joint probability is %6.4f\n',phat)
fprintf('The z statistic is %6.4f with two-tailed p = %6.4f\n',z,pvalue)
fprintf('The observed proportions were %6.4f and %6.4f\n',obsp)
fprintf(...
'The difference in proportions is %6.4f with conf. interval: %6.4f %6.4f\n',D,CI)
M=[34 6;19 16];
% Fisher's exact test
[H,P,STATS] = fishertest(M);
fprintf('Fisher''s exact two-tailed p value is %6.4f\n',P)