%
clear all
close all


disp('Risks: Differences, Ratios and Odds Ratios')
  lw = 2; 
  set(0, 'DefaultAxesFontSize', 16);
  fs = 15;
  msize = 10;
% end of preamble--------------------------------------

disexposed =    binornd(60, 0.25, [1 500000]);
disnonexposed = binornd(80, 0.21, [1 500000]);
nbins=40
p1s = disexposed/60; p2s =disnonexposed/80;
figure(1); hist(p1s - p2s, nbins); axis tight
 %print -depsc 'C:\BESTAT\Two\Twoeps\risksa.eps'
figure(2); hist(p1s./p2s, nbins); axis tight
 %print -depsc 'C:\BESTAT\Two\Twoeps\risksb.eps'
figure(3); hist( log( p1s./p2s ), nbins); axis tight
 %print -depsc 'C:\BESTAT\Two\Twoeps\risksc.eps'
figure(4); hist( (p1s./(1-p1s)) ./(p2s./(1-p2s)), nbins ); axis tight
 %print -depsc 'C:\BESTAT\Two\Twoeps\risksd.eps'
figure(5); hist( log((p1s./(1-p1s)) ./(p2s./(1-p2s))), nbins ); axis tight
 % print -depsc 'C:\BESTAT\Two\Twoeps\riskse.eps'