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

Dear all!

 

Could you please help me with the following question:

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?

 

Thanks in advance!

Best Regards,

Andrey

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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.

View solution in original post

5 REPLIES 5
FreelanceReinh
Jade | Level 19

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.

StatDave
SAS Super FREQ

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

FreelanceReinh
Jade | Level 19

@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.

Ksharp
Super User

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

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
  • 5 replies
  • 2293 views
  • 0 likes
  • 4 in conversation