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
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).
The details of what is provided are here:
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 ?
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 |
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...
Your cell freq is too small ,equal 1. I would trust POINT option.
exact binomial /point;
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?
Sorry. I have no idea about it. Calling @Rick_SAS
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.
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).
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.