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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 840 views
  • 2 likes
  • 2 in conversation