I am trying to compute the percentage of a normal population with unknown mean and unknown variance which lies outside of specified limits at a specified level of confidence. The SAS software computes the tolerance interval which gives the limits of a speficied percentage of the population at a specified level of confidence but does not seem to do the reverse as best as I can tell. Also in my case, the limits are an input and the percentage of the population is an output. Can anyone provide guidance on making this computation correctly.
I haven't computerd tolerance intervals myself, but it looks like if you have SAS/QC software, you can use the INTERVALS statement in PROC CAPABILITY to obtain tolerance intervals. Looks like METHOD=3 is what you want?
If you don't have SAS/QC, the documentation gives the formula in terms of the sample mean (xbar), sample standard deviation (s), sample size (n), the proportion (p), and the significance level (alpha).You can use the DATA step to implement the formula by using the QUANTILE function, which computes percentiles (=quantiles) of standard distribution. For example, the quantity
z = quantile("normal", (1+p)/2);
gives the quantile for the standard normal distribution with parameter (1+p)/2. Similarly,
chi2 = quantile("chisq", alpha, n-1);
gives the quantile for the chi-square distribution with df=n-1.
Thus if you know the sample statistics, then I think the following DATA step gives you what you want, or at least will point you in the right direction:
data limits;
/* input sample statistics and parameters */
xbar = 0;
s = 1;
n = 50;
p = 0.95;
alpha = 0.05;
/* compute Lower & Upper tolerance limits using QC formula */
z = quantile("normal", (1+p)/2);
chi2 = quantile("chisq", alpha, n-1);
delta = s*z*(1 + 1/(2*n))*sqrt( (n-1)/chi2 );
Lower = xbar - delta;
Upper = xbar + delta;
run;
proc print;run;
Please provide data and expected output. Also a reference or example would be nice.
Presumably the limits were computed based on n samples: something like xbar +/- k(n,1-alpha,p)*s, where k-is a 2-sided tolerance factor (or 2-sided equal tailed tolerance factor) based on n samples, 1-alpha confidence, and p is minimum proportion of population captured by the interval. Then no more than 1-p is outside the interval with 1-alpha confidence.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.