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 😄
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.