I'm trying to run a test of equivalence on a 2x2 table. I'm not sure what, exactly, I am doing.
First, I am trying to understand the difference between the EQUIV features of the BINOMIAL and RISKDIFF table options. When I run the following code, though, all I get is the 2x2 frequency table and nothing about the equivalence of the two rows:
PROC FREQ ORDER=DATA;
WEIGHT COUNT;
TABLES GROUP*GENDER / BINOMIAL (EQUIV);
RUN;
My input dataset is (variables Group, Gender, and Count):
Spl1 F 462
Spl1 M 80
Spl2 F 84
Spl2 M 11
When I run the following code, I do get several additional tables: risk estimates, equivalence analysis, and TOST.
proc freq order=data;
weight count;
table group*gender / riskdiff (equiv);
run;
So, my questions are:
Thanks!
The Binomial option only works for one-way tables, you are requesting a two-way. Also part of the answer for the Riskdif which does the 2x2 table.
And since you are comparing two variables then Binomial isn't going to be much help though it does show something about the individual variables.
See the results if you use
proc freq order=data; weight count; table group gender / binomial (equiv); run;
The Binomial option only works for one-way tables, you are requesting a two-way. Also part of the answer for the Riskdif which does the 2x2 table.
And since you are comparing two variables then Binomial isn't going to be much help though it does show something about the individual variables.
See the results if you use
proc freq order=data; weight count; table group gender / binomial (equiv); run;
If what you want is a test of the hypothesis that the two row (or column) proportions are the same, then just use the CHISQ option as discussed and illustrated in this note.
StatDave_sas, I'm glad you responded.
The title of the note you cited indicates that it is about testing equality, but it really looks like the standard treatment of demonstrating difference by rejecting the null hypothesis of equality.The example in the article says that the chi-squared test shows that the null hypothesis (of equivalence) is rejected, which is great in this example, so I know the two groups are not equivalent.
However, I am looking for a measure of how similar they are, and I need to flip the hypotheses. My "null hypothesis" is that they are different, and I want to be able to reject that. I have found some literature on this topic, but there doesn't seem to be much treatment of this situation.
Some literature suggests that using a conventional chi-squared test and seeing a p-value of 0.06, for example, would demonstrate that the two groups were similar, but I object that this is not a strict enough test. That simply means that there is still a 94% chance that they are different, right? (Note that some fields of study seem to think p<0.10 shows a significant difference.) Naively, I would expect to need a p-value > 0.95 in order to say with 95% confidence that the two sets of responses are likely to be the same.
From what I have read, the TOST table generated by the RISKDIFF option seems the appropriate statistic to use to test equivalence in the 2x2 case, but I have no idea what to do in 2x3 (two groups, three response categories) or higher tables.
What are your thoughts?
Thanks!
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.