I have a data set with 84 variables, and a treatment variable with 4 states (a, b, c and d). For variable 1, I want to know if there are mean differences between the 4 treatments. I then test variable 2, and so forth. I use proc GLIMMIX, and an lsmeans statement with adjust=tukey. For the variables that show no significant differences, is there a way to get SAS to calculate the sample size that would be needed to get a significant outcome? I would be happy if I could get the calculation for all of the variables and then process the output by hand to get only the non-significant variables.
There will be a sample size needed to get a significant difference between a and b, and this will be different than the sample size necessary to get b different than d. There are six possible values, but I am mostly just interested in the smallest value that will give at least one significant difference.
The SAS code looks like this, where the independent variable in NumPrbs, and trt is short for treatment :
Proc glimmix plots=residualpanel;
class trt;
model NumPrbs=trt;
lsmeans trt/adjust=tukey pdiff lines;
title 'ANOVA & LSD of NumPrbs';
Here is data from NumPrbs. Values are not integer because the data were transformed:
a | 5.291503 |
a | 4.472136 |
a | 6.78233 |
a | 5.477226 |
a | 3.316625 |
a | 3.741657 |
a | 4.795832 |
a | 2.645751 |
a | 5.385165 |
a | 4.690416 |
a | 5.91608 |
a | 3.464102 |
a | 2.236068 |
a | 4.242641 |
a | 3.605551 |
a | 2 |
a | 3.316625 |
a | 3.464102 |
a | 4.472136 |
a | 3 |
a | 3.162278 |
a | 4.242641 |
b | 6.557439 |
b | 6.164414 |
b | 7.141428 |
b | 5.830952 |
b | 1.732051 |
b | 2.236068 |
b | 7.071068 |
b | 4.898979 |
b | 2.236068 |
b | 4.795832 |
b | 2.44949 |
b | 4 |
b | 5.477226 |
b | 5.291503 |
b | 5.291503 |
b | 4.898979 |
b | 4.358899 |
b | 6.324555 |
b | 4.358899 |
b | 5.656854 |
b | 3.605551 |
b | 3.316625 |
b | 6.324555 |
c | 8.660254 |
c | 3.316625 |
c | 4.582576 |
c | 4.472136 |
c | 5.09902 |
c | 7 |
c | 2.44949 |
c | 4.898979 |
c | 3 |
c | 4.898979 |
c | 1.732051 |
c | 5.477226 |
c | 2.828427 |
c | 3.162278 |
c | 7.28011 |
c | 4.242641 |
c | 6.557439 |
c | 5.09902 |
c | 4.242641 |
c | 6.164414 |
c | 2.645751 |
c | 4.690416 |
c | 4.795832 |
c | 2.236068 |
d | 5.385165 |
d | 4.358899 |
d | 5.477226 |
d | 2.236068 |
d | 5.567764 |
d | 3.162278 |
d | 3.741657 |
d | 2.236068 |
d | 4.582576 |
d | 8.944272 |
d | 6.78233 |
d | 5.385165 |
d | 7.483315 |
d | 5.477226 |
d | 8.831761 |
d | 4.123106 |
d | 6.164414 |
d | 6.78233 |
d | 3.162278 |
d | 6 |
A power analysis would answer your question about sample size. For this model (a one-way ANOVA), you could use the GLMPOWER procedure.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.