%Ratio of Two Poissons -- CI
    X1=69; t1 = 1079.6;
   X2=12; t2=467.9;
   n=X1 + X2; 
   phat = X1/n; %0.8519
   phat1 = (X1 +2)/(n + 4); %0.8353
   qhat1 = 1 - phat1;  %0.1647
% Agresti-Coull CI for prop was selected.
LBp = phat1 - norminv(0.975) * sqrt( phat1*qhat1/(n + 4) ) % 0.7564
UBp = phat1 + norminv(0.975) * sqrt( phat1*qhat1/(n + 4) ) %0.9141
LBlam = LBp/(1 - LBp) * t2/t1; %back to lambda
UBlam = UBp/(1 - UBp) * t2/t1;
[LBlam, UBlam]      %[1.3461    4.6147]
%Frame size in Poisson Sampling
    lambar1 = 69/1079.6;  %= 0.0639
    lambar2 = 12/467.9;  %=0.0256
    w = 2;
 t4diff =  4 * norminv(0.995)^2  *  ( 1/lambar1 + 1/lambar2 )/...
      (asin(lambar2/lambar1 * w/2));  % t4diff =3511.8
 t4rat =  4 * norminv(0.995)^2  *...
 ( 1/lambar1 + 1/lambar2 )/(log(w))^2;   %t4rat=3018.1

%Cox
LBlamc = t2/t1 * (X1 + 1/2)/(X2 + 1/2) * finv(0.025, 2*X1 + 1, 2*X2 + 1);
UBlamc = t2/t1 * (X1 + 1/2)/(X2 + 1/2) * finv(0.975, 2*X1 + 1, 2*X2 + 1);
[LBlamc, UBlamc]   %1.3932    4.7497

%test H_1: lambda1 > lambda2
pval = fcdf( t1/t2 * (X2 + 1/2)/(X1 + 1/2),    2*X1 + 1, 2*X2 + 1)
% 6.6417e-004