blob: dd3baee47c58f35a3c0fbbdc175cb34eab8ad3fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
initialsample = 30;
acceptable= 26;
phat = acceptable/initialsample;
error = 0.05/2;
zalpha = 2.58;
samplesize = (error/zalpha)^2/(phat*(1-phat));
finalsize = ceil(1/samplesize);
acceptablenew= 1040 + acceptable;
phat = acceptablenew/finalsize;
lowerlim = phat - (zalpha*sqrt(phat*(1-phat)/finalsize));
upperlim = phat + (zalpha*sqrt(phat*(1-phat)/finalsize));
disp(upperlim, "to ",lowerlim,"The 99% confidence interval is " )
|