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

Dear community,

 

I would like to know which test SAS is using with a PROC FREQ and a Binomial option ?

 

It seems that is a Wald test: "The BINOMIAL option also produces an asymptotic Wald test that the proportion equals 0.5".

 

If we compare with prop.test R function, which seems a Wilson test, we get the same results than SAS.

 

Moreover, if it's really a Wald test, why we get some unconformity between the test and the confidence limits as in this exemple:

/* Data */

data ACT;
	do i=1 to 48; ACTIVE="0"; output; end;
	do i=1 to 1; ACTIVE="1"; output; end;
run;

/* Bilateral 5% */
proc freq data=ACT;
      tables ACTIVE  / binomial(all level="0" p=.9) alpha=0.05;
run;
 
/* Results */
Confidence Limits for the Binomial Proportion 
Proportion = 0.9796 
Type 95% Confidence Limits 
Agresti-Coull 0.8831 1.0000 
Clopper-Pearson (Exact) 0.8915 0.9995 
Jeffreys 0.9086 0.9978 
Wald 0.9400 1.0000 
Wilson 0.8931 0.9964 
 
 
 
Test of H0: Proportion = 0.9 
ASE under H0 0.0429 
Z 1.8571 
One-sided Pr > Z 0.0316 
Two-sided Pr > |Z| 0.0633

P-value of 0.06 is not significant whereas Wald's CL [0.94 ; 1.00] is significant.

 

Could please enlighten me on this topic?

 

Many thanks in advance,

 

Alex

1 ACCEPTED SOLUTION

Accepted Solutions
Aleksik
Fluorite | Level 6

To conclude:

 

. It seems that the test realized by SAS is corresponding to a chi-squared test without Yates's correction for continuity (same used by prop.test function in R); 

. To get a SAS's test where p-value corresponds with Wald's confidence intervals, we have to add VAR=SAMPLE option;

. To get a exact test where p-value corresponds to an exact's confidence intervals, we have to add "EXACT=Binomial" instruction. Thereby with various essay, it seems that Clopper-Pearson's confidence intervals corresponds with the exact's p-value (more than Wilson).

 

The only doubt is that p-value from this test is slightly different from that given by the binom.test function of R (which also does the Clopper-Pearson's confidence intervals and the exact test of the binomial distribution).

View solution in original post

9 REPLIES 9
Aleksik
Fluorite | Level 6

Sorry, but I didn't find the answer to my interogation.

 

It's write that "The BINOMIAL option provides an asymptotic equality test for the binomial proportion by default". What's mean an asymptotic equality test? It's a test different frow the confidence limits?

 

Moreover, how should I proceed to get the p-value with the corresponding Confidence Limits ?

Ksharp
Super User

One cell freq is less than 5, 

therefore you need check Exact test ,not Wald test.

 

proc freq data=ACT ;
tables ACTIVE / binomial(all level="0" p=.9) alpha=0.05 cl ;
exact binomial /point;
run;

SAS Output

Type 95% Confidence Limits
Wald 0.9400 1.0000
Wilson 0.8931 0.9964
Agresti-Coull 0.8831 1.0000
Jeffreys 0.9086 0.9978
Clopper-Pearson (Exact) 0.8915 0.9995

Test of H0: Proportion = 0.9
ASE under H0 0.0429
Z 1.8571
One-sided Pr > Z 0.0316
Two-sided Pr > |Z| 0.0633
   
Exact Test  
One-sided Pr >= P 0.0369
Point Pr = P 0.0312
Two-sided = 2 * One-sided 0.0738
 
Aleksik
Fluorite | Level 6

Thank you for your message.

 

But which test is realised? "If you specify the BINOMIAL option in the EXACT statement, PROC FREQ also provides an exact equivalence test by using two one-sided exact tests (TOST)". We do not really want an equivalence test...

Ksharp
Super User

Your cell freq is too small ,equal 1. I would trust POINT option.

 

 exact binomial /point;

 

Aleksik
Fluorite | Level 6

Thank you for your post. So, which Confidence Limits corresponding to the p-value of 0.0312.

 

"The POINT option is available for all the EXACT statement statistic-options except the OR. RELRISK, and RISKDIFF options, which provide exact confidence limits". So it's significant with the test (p-value=0.0312) whereas the exact Confidence Limits is not significant ([0.8915 ; 0.9995]). It's discordant isn't it?

Ksharp
Super User

Sorry. I have no idea about it. Calling @Rick_SAS

StatDave
SAS Super FREQ

Specifically from that section of the documentation, you need to use the VAR=SAMPLE suboption in BINOMIAL to use the same standard error in the test as is used in the Wald confidence interval.  If you do that, the test p-value is <.0001.

Aleksik
Fluorite | Level 6

To conclude:

 

. It seems that the test realized by SAS is corresponding to a chi-squared test without Yates's correction for continuity (same used by prop.test function in R); 

. To get a SAS's test where p-value corresponds with Wald's confidence intervals, we have to add VAR=SAMPLE option;

. To get a exact test where p-value corresponds to an exact's confidence intervals, we have to add "EXACT=Binomial" instruction. Thereby with various essay, it seems that Clopper-Pearson's confidence intervals corresponds with the exact's p-value (more than Wilson).

 

The only doubt is that p-value from this test is slightly different from that given by the binom.test function of R (which also does the Clopper-Pearson's confidence intervals and the exact test of the binomial distribution).

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 9 replies
  • 8790 views
  • 3 likes
  • 4 in conversation