SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
GS2
Obsidian | Level 7 GS2
Obsidian | Level 7

Hello,

 

Using SAS 9.4

 

I am looking to run a power analysis. I have a total n=34 with 4 groups (n=10 10 10 4). I would like to find the n per group needed for a power of 80% at an alpha of 0.05. Any help would be appreciated. Thank you

7 REPLIES 7
ballardw
Super User

What kind of test do you intend to do?

 

After you set the parameters in Proc Power for the appropriate test and set power=.8 the resulting n is the n for that power pretty much. So "by group" doesn't make much sense in this context.

 

Power analysis should be done before data collection so you can collect enough records for your design. If you have already collected the data it is kind of late.

GS2
Obsidian | Level 7 GS2
Obsidian | Level 7
I will be doing a wilcoxon, I am looking at a continuous ROM variable by the 4 groups mentioned. I agree there is a lot of literature about the lack of utility for post hoc power analyses.
ballardw
Super User

Can you show an example of the code you intend to conduct the test?

 

I'm not sure that Proc Power is going to be that helpful for other than a two sample wilcoxon (hence the statement twosamplewilcoxon in proc power)

GS2
Obsidian | Level 7 GS2
Obsidian | Level 7
That is more what I was asking. if anyone knows a method other than proc power to perform this because, as you said, it does not appear that proc power will be helpful.
ballardw
Super User

Do you know the procedure and options you are going to use to analyze the data?

 

If not, then it may be too early to talk about power. If so, then show an example of the code. There may be other approaches someone may come up with.

Since most of the actual Wilcoxon analysis is with pairs of data then this question is I think quite relevant. Perhaps your intended analysis might mean the GLMPOWER is more appropriate such as doing ANOVA of some flavor.

 

Power is tied to analysis, hence the way the statements in proc power are set up.

GS2
Obsidian | Level 7 GS2
Obsidian | Level 7
Below is fake data for how my data set looks and the code I would use to run the wilcoxon

data have;
input ID side $ group $ rom;
cards;
1 left A 144
1 left B 144
1 left C 144
1 right A 129
1 right B 129
1 right C 129
2 left A 100
2 left B 100
2 left C 100
2 left D 100
2 right A 120
2 right B 120
2 right C 120
2 right D 120
;
run;

proc npar1way data = have wilcoxon;
class group;
var rom;
OUTPUT OUT= KW_PVALS (KEEP=_VAR_ P_KW);
RUN;
PROC PRINT DATA = KW_PVALS;
RUN;
ballardw
Super User

Please note that the TEST used is a Kruskal-Wallis that uses Wilcoxon Scores. So not actually a Wilcoxon test.

The exact distribution of the Kruskal-Wallis is more than a bit difficult for many sample sizes. So a Chi-square approximation using k-1 degrees of freedom is used, where k is the number of samples.

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1450 views
  • 0 likes
  • 2 in conversation