% LMex030202_4th.m
% Larsen & Marx Example 3.2.2 Page 132 in 
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th Edition
% Based on LMEx030306_3rd.m
% see LMEx030202_4th.m, p. 137, 3rd edition
% Written by Eugene.Gallagher@umb.edu
% revised 1/11/2011.
% A drug company is testing drugs on 30 patients. It has a rule rejecting a
% drug if fewer than 16 of 30 patients show improvement and accepting the
% drug if 16 or more patients show improvement
n=30;
po=0.5;
pa=0.6;
% What is the probability that a drug that is 60% effective will be
% rejected using the decision rule of 16 patients or more have to improve?
PFR=sum(binopdf(0:15,n,pa))
% or equivalently, use the binomial cumulative distribution function
PFR2=binocdf(15,n,pa)
fprintf(...
'Probability of a false rejection=%6.4f | effectiveness = %3.1f.\n',...
PFR,pa);
% What is the probability that a drug that is 50% effective will be
% accepted for further development using the decision rule of 16 patients
% or more have to improve?
PFA=sum(binopdf(16:30,n,po))
% or equivalently, use the binomial cumulative distribution function
PFA2=1-binocdf(15,n,po)
fprintf(...
'Probability of a false acceptance=%6.4f | effectiveness = %3.1f.\n',...
PFA,po);