BookmarkSubscribeRSS Feed
Obsidian | Level 7 GS2
Obsidian | Level 7

Using SAS 9.4


I am wanting to do a post hoc power analysis


  proc power plotonly;
         groupmeans = 35.6 | 33.7 | 30.2 | 29 28 | 25.9
         stddev = 3.75
         groupweights = (2 1 1 1 1)
         alpha = 0.025
         ntotal = 24
         power = .
         contrast = (4 -1 -1 -1 -1) (0  1  1 -1 -1)
                    (0  1 -1  0  0) (0  0  0  1 -1);
      plot x=n min=24 max=480;

. I am using the sample code from SAS below but I am not sure where to get the standard deviation?  If you could please tell me how to find that it would be helpful. Thank you

Super User
You need to provide that based on your knowledge of the underlying data. It can be estimated. There are some cases where post hoc power analysis is appropriate, make sure your case is one - it's usually not considered a good idea at all.
Obsidian | Level 7 GS2
Obsidian | Level 7

Yes it is not a good idea to do a post hoc power analysis (almost all of the literature says this), however it is a specific request that I cannot ignore. 


If I have 4 groups means cannot I just use those to calculate a standard deviation estimate?



Super User
Yes, you can use your data to estimate the standard deviation.
Obsidian | Level 7 GS2
Obsidian | Level 7

Would it be appropriate to take the 4 means that I have calculated and run them through a code like below to get the standard deviation or since they are mean values is that an inappropriate way? Thank you 

proc sql;
create table want as
select *, std(150.3684, 63.59701, 53.16667, 37.21429 ) as sd_a
from have;



Super User
That's wrong, you can't figure out the standard deviations from aggregated data you need to use the raw data.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2 in conversation