🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Obsidian | Level 7

Goodman method (1965 year) confidence interval using SAS

Dear all!

I need to calculate the simultaneous confidence limits for multinomial proportions based on Goodman method (1965 year) like it id done here:

https://blogs.sas.com/content/iml/2017/02/15/confidence-intervals-multinomial-proportions.html

But I don't have SAS/IML, is it possible to done the calculation using base SAS without IML module?

Best Regards,

Andrey

1 ACCEPTED SOLUTION

Accepted Solutions
Jade | Level 19

Re: Goodman method (1965 year) confidence interval using SAS

Hello @AndreyMyslivets,

Yes, this is possible. Here's how (using Rick Wicklin's example data):

``````%let c=4;     /* number of categories */
%let a=0.05;  /* alpha */

data have;
input n1-n&c;
cards;
91 49 37 43
;

data GoodmanCI;
array n[&c];       /* counts */
array p[&c];       /* percentages */
array lcl[&c];     /* lower confidence limits */
array ucl[&c];     /* upper confidence limits */
set have;
nt=sum(of n[*]);   /* total n */
x=cinv(1-&a/&c,1); /* chi-square quantile, df=1, with Bonferroni adjustment */
do i=1 to &c;
p[i]=n[i]/nt;
lcl[i]=(x+2*n[i]-sqrt(x*(x+4*n[i]*(nt-n[i])/nt)))/(2*(nt+x));
ucl[i]=(x+2*n[i]+sqrt(x*(x+4*n[i]*(nt-n[i])/nt)))/(2*(nt+x));
end;
drop i;
run;``````

I took the formulas from a 2016 post of mine where I estimated some coverage probabilities for this and other suggested confidence intervals for multinomial proportions.

5 REPLIES 5
Jade | Level 19

Re: Goodman method (1965 year) confidence interval using SAS

Hello @AndreyMyslivets,

Yes, this is possible. Here's how (using Rick Wicklin's example data):

``````%let c=4;     /* number of categories */
%let a=0.05;  /* alpha */

data have;
input n1-n&c;
cards;
91 49 37 43
;

data GoodmanCI;
array n[&c];       /* counts */
array p[&c];       /* percentages */
array lcl[&c];     /* lower confidence limits */
array ucl[&c];     /* upper confidence limits */
set have;
nt=sum(of n[*]);   /* total n */
x=cinv(1-&a/&c,1); /* chi-square quantile, df=1, with Bonferroni adjustment */
do i=1 to &c;
p[i]=n[i]/nt;
lcl[i]=(x+2*n[i]-sqrt(x*(x+4*n[i]*(nt-n[i])/nt)))/(2*(nt+x));
ucl[i]=(x+2*n[i]+sqrt(x*(x+4*n[i]*(nt-n[i])/nt)))/(2*(nt+x));
end;
drop i;
run;``````

I took the formulas from a 2016 post of mine where I estimated some coverage probabilities for this and other suggested confidence intervals for multinomial proportions.

SAS Super FREQ

Re: Goodman method (1965 year) confidence interval using SAS

See examples 2 and 3 in this note using PROC CATMOD.

Jade | Level 19

Re: Goodman method (1965 year) confidence interval using SAS

@StatDave wrote:

See examples 2 and 3 in this note using PROC CATMOD.

According to another post in the 2016 thread I mentioned in my reply to @AndreyMyslivets, that Usage Note 32609 was not very helpful for computing simultaneous confidence intervals (EDIT: as far as non-IML techniques are concerned), unfortunately.

Obsidian | Level 7

Re: Goodman method (1965 year) confidence interval using SAS

Many thanks for your help!

Super User

Re: Goodman method (1965 year) confidence interval using SAS

There is a macro in @Rick_SAS  blog. maybe you can use it .

Discussion stats
• 5 replies
• 2259 views
• 0 likes
• 4 in conversation