BookmarkSubscribeRSS Feed
sahoositaram555
Pyrite | Level 9

Hi , i have a data set below which i have to use for generating binomial CI by WILSON method and it has to be generated by proc freq.

 

Please suggest what changes can i make in my code to get the CI with WILSON method?

proc freq data=cases;
by country ;
tables category/ nocum norow binomial(level='Y' cl=WILSON(CORRECT));

weight counts;

output out=out binomial;

run;

 

Country

infected 

total

category

counts

Algeria

10

94

Y

10

Algeria

10

94

N

84

Australia

7

1098

Y

7

Australia

7

1098

N

1091

Austria

8

3025

Y

8

Austria

8

3025

N

3017

Belgium

67

2815

Y

67

Belgium

67

2815

N

2748

 

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hi @sahoositaram555,

 

Your PROC FREQ code is correct. It does calculate (among other statistics) the Wilson confidence interval (with continuity correction) for the binomial proportion of category 'Y' for each country.

 

You can use the ODS SELECT statement to restrict the output to the CI if you like. Similarly, you can restrict the output dataset to the confidence limits and the name of the country (and the point estimate, I'd suggest) by using a KEEP= dataset option:

data cases;
input Country :$30. infected total category :$1. counts;
cards;
Algeria 10 94 Y 10
Algeria 10 94 N 84
Australia 7 1098 Y 7
Australia 7 1098 N 1091
Austria 8 3025 Y 8
Austria 8 3025 N 3017
Belgium 67 2815 Y 67
Belgium 67 2815 N 2748
;

ods select binomialCLs;
proc freq data=cases;
by country;
tables category / binomial(level='Y' cl=WILSON(CORRECT));
weight counts;
output out=out(keep=country _: l: u:) binomial;
run;

 

 

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

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.

Discussion stats
  • 1 reply
  • 1099 views
  • 2 likes
  • 2 in conversation