BookmarkSubscribeRSS Feed
saza
Quartz | Level 8

You are designing a survey in which you plan to ask participants about weight and caffeine consumption. You want to find out if there is a difference in mean weight of participants who consume caffeine on a daily basis and those who don’t. Based on data previously collected on the population of interest, you estimate that the standard deviation of weight will be 15 pounds in both groups.

 

You want 85% power to be able to detect a 10-pound difference between the groups. The desired significance level is 0.05. How many participants from each group do you need to achieve this?

5 REPLIES 5
Reeza
Super User
PROC POWER doesn't take a data set, it takes numbers...one of the few. See the examples in the documentation or see if you can find some beginner tutorials on Lexjansen.com

https://www.lexjansen.com/wuss/2016/105_Final_Paper_PDF.pdf
ballardw
Super User

Lets deconstruct your question:

"mean weight of participants who consume caffeine on a daily basis and those who don’t" > Sounds like you might want to use a T-test so points to a TWOSAMPLEMEANS Proc power.

 

"detect a 10-pound difference between the groups" looks like a MEANDIFF

 

"standard deviation of weight will be 15 pounds" looks like a STDDEV, both groups with same StdDev will have same variance so a test of differences would be Test=Diff

 

So the last bit is what is the actual question? Do you want to determine the overall sample size or the number that should be in each group (seems likely)

Perhaps:

Proc power;
twosamplemeans 
   test=diff
   stddev=15
   meandiff=10
   power=.85
   npergroup=. 
;
run;

Using defaults, such as alpha. The deconstruction is sort of a rough map of using Proc Power. The first is to determine the time to statistical test(s) the data may be used for. That will give you the main options in the documentation and match them up to the values you have (or estimate, or assume). Note that the value you look for , such a N or Npergroup or Power or whatever must be included and indicated as missing. ONE thing missing. Each type of sample has a variety of what may be needed as a minimum to work with. There are methods to examine multiple values such as Power=.8 .85 .95

 

saza
Quartz | Level 8
Well, I want to first start of by saying that even though I don't know you, I love you. My instructor provided 0 context and I had no idea how to form this code using SAS. I was starting to get to the point of manually doing the calculation. I really appreciate your explanation and your code worked perfectly to give me the n value. I am however, having issues with the second question. I'm not certain if the structure of code you provided me with the second survey format.

A researcher would like to examine whether there is a relationship between recent influenza vaccination (this season: yes/no) and a history of having the flu in the past 3 years (yes/no). She would like to detect a minimum difference in proportions of .10, and she expects a proportion of 0.35 in the reference group. She wants to limit falsely rejecting the null to 1%, and falsely rejecting the alternative hypothesis to 90%. What is the minimum sample size per group, given these criteria?

1) To detect a minimum difference of 0.10 (i.e., between 0.35 and 0.45) the minimum sample size per group is

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 5 replies
  • 1335 views
  • 7 likes
  • 5 in conversation