BookmarkSubscribeRSS Feed
n6
Quartz | Level 8 n6
Quartz | Level 8

So I want to do an equivalence test on a continuous variable in PROC POWER.  We have two groups.  We can assume the same standard deviation in each group (say 8).  So I want the null to be that the difference between the two groups is > 4 (say) and that the alternative to be that the difference is <= 4.  So if I can reject the null I can say "The difference between the two groups is at most 4."

Okay, here is the SAS code from an example in SAS PROC POWER help.

proc power;

     twosamplemeans test=equiv_diff

     lower = 2

     upper = 5

     meandiff = 4

     stddev = 8

     ntotal = .

     power = 0.9;

run;

I don't understand what LOWER and UPPER are or why they're necessary.  I've experimented with changing their values and the resulting N changes sometimes but I don't really know why.  But beyond that, I don't know why a LOWER and UPPER are necessary to begin with.  It seems that the problem is completely specified even without them.  I tried simply removing LOWER and UPPER and when I do the SAS Log says they are required.  Any idea what I'm missing?  Thanks in advance.

2 REPLIES 2
JacobSimonsen
Barite | Level 11

Hi,

I am not in expert in this, and powercalculations is not something I do often. Though, I think I know what happens, anyone are welcome to correct me if I am wrong.

I think you should specifiy "test=diff" instead, because your test is a two-sided test.

The equiv_diff allows you to specify two one-sided tests, and therefore you both need to specify the upper alternative and the lower alternative. This is not what you what if I understood you correct.

I suggest this code, which was generated by the SAS power and sample size application:

proc power;

   TwoSampleMeans test=diff

      Alpha = 0.05

      Sides = 2

      MeanDiff = 4

      StdDev = 8

      Power = 0.8

      NTotal = .

      NFractional  ;

run

Best.

n6
Quartz | Level 8 n6
Quartz | Level 8

I think I have figured it out.  Although your answer wasn't right it did lead me to realize what I was doing wrong.

TEST=DIFF is for when your alternative hypothesis is that the two groups are different.  But I am doing an equivalence test, which means my alternative hypothesis is that the two groups are the same, or at least that the difference between the two groups is less than some specified number, and thus I want to use TEST=EQUIV_DIFF.

In my original example I wanted to show that the difference between the two groups is at most 4.  I put that number (4) in the MEANDIFF line.  But if I wanted to show that the difference between the two groups was 4 then I should've used LOWER=-4 and UPPER=4.  LOWER and UPPER are the largest difference we'll allow between the two groups in each direction.  In an ordinary equivalence test LOWER and UPPER will have the same absolute value.

OTOH, MEANDIFF is the difference in the means between the two groups that we are going to assume exists.  If we assume the two groups have the same mean then MEANDIFF=0.

In my original example I wanted to answer the following question:  Assuming two groups have the same mean and also that both groups have a standard deviation of 8 and also assuming the two groups are equivalently sized, what is our required total N to have 90% power for an equivalency test to show that the difference between the two groups is at most 4?  Here is the code that answer that question.  We're also assuming a 0.05 alpha level but that is such a common assumption that we don't need to code for it.

proc power;

     twosamplemeans test=equiv_diff

     lower = -4

     upper = 4

     meandiff = 0

     stddev = 8

     ntotal = .

     power = 0.9;

run;

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
  • 2 replies
  • 3342 views
  • 0 likes
  • 2 in conversation