BookmarkSubscribeRSS Feed
ammarhm
Lapis Lazuli | Level 10

Guys, I really need help with this:

 

I am trying to do a sample size calculation, for comparison of means of three groups as follows:

 

%let ngroup=34; 	        /*n per group*/
%let sd=15;			/*standard deviation*/
%let power=0.80;	        /*Required power*/
%let m1=20;			/*Mean group 1*/
%let m2=30;			/*Mean group 2*/
%let m3=30;			/*Mean group 3*/
%let alpha=0.05;		/*Mean group 3*/


proc power; 
  onewayanova test = overall
  groupmeans = &m1 | &m2 | &m3 
  stddev = &sd 
  npergroup =  &ngroup 
  power = .
  alpha=α
   plot x=n min=1 max=100 npoints=20;
run;

 

OK so this is telling me that with 34 per group I will get a power of 0.80

Correct me if I am wrong, but this will only tell you how strong your power is to detect overall difference, and not between group differences.

I am also interested in taking into account pairwise comparisons when doing the sample size calculation, I can think of two strategies and I dont know if they are adequate:

1. use  Bonferroni correction dropping the alpha to 0.05/ngroup(3)=0.017

or use contrast but i am not sure if contrasts are right and what /how to use them

Could anyone please please try o help me out with these questions?

1 REPLY 1
ammarhm
Lapis Lazuli | Level 10

Anyone has any suggestions pease?

All help is appreciated

Kind regards

AM

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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
  • 1 reply
  • 2359 views
  • 0 likes
  • 1 in conversation