/* Fragment of SAS code to illustrate how to implement the inverse Chi-square function in SAS to compute gamma-based confidence intervals for age-adjusted rates. This example is for 95% confidence intervals. For other confidence limits, replace the constants 0.025 and 0.975 with the appropriate values. Variable definitions: CI_lower: Lower confidence interval limit CI_upper: Upper confidence interval limit maxwt: Maximum of the weights rate: Age-adjusted rate variance: Variance of the age-adjusted rate */ CI_lower = (variance/(2*rate))*cinv(0.025,2*(rate**2)/variance); CI_upper = ((variance + maxwt**2)/(2*(rate+maxwt)))* cinv(0.975,2*(rate+maxwt)**2/(variance+maxwt**2));