anyone know how to get the mean difference by week using proc glm:
so far I have the code:
proc glm data=work.psilongfinal ;
class week abc_scr ;
model new_total = week*abc_scr / ss1 ss2 ss3 ss4 ;
means week*abc_scr;
format abc_scr abc_scr.;
run;
and I get this: SAS Output
N | new_TOTAL | |||
WEEK | abc_scr | Mean | Std Dev | |
1 | 1 | 96 | 12.4913 | 6.41615 |
1 | 2 | 50 | 16.5664 | 7.28447 |
8 | 1 | 120 | 7.55877 | 5.49867 |
8 | 2 | 10 | 12.6476 | 5.18959 |
12 | 1 | 118 | 6.59475 | 5.24013 |
12 | 2 | 9 | 11.5119 | 6.38991 |
16 | 1 | 118 | 6.81316 | 6.03729 |
16 | 2 | 7 | 7.9 | 5.34516 |
N | new_TOTAL | |||
WEEK | abc_scr | Mean | Std Dev | |
1-8 | 1 | 12.49-7.52= | ||
1-8 | 2 | 16.57-12.65= | ||
1-12 | 1 | 12.49-6.54= | ||
1-12 | 2 | 16.57-11.51= | ||
1-16 | 1 | |||
1-16 | 2 | |||
proc glimmix gives you more options. This little example might inspire you:
proc glimmix data=sashelp.cars plots=none;
where cylinders in (4,6) and make in ("Chrysler", "Ford", "Chevrolet") ;
class make cylinders;
model MSRP = make|cylinders;
lsmeans make*cylinders / slicediff=cylinders diff;
run;
proc glimmix gives you more options. This little example might inspire you:
proc glimmix data=sashelp.cars plots=none;
where cylinders in (4,6) and make in ("Chrysler", "Ford", "Chevrolet") ;
class make cylinders;
model MSRP = make|cylinders;
lsmeans make*cylinders / slicediff=cylinders diff;
run;
was able to modify and make it work! thanks 😄
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.