BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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

 

  Nnew_TOTAL
WEEKabc_scrMeanStd Dev
119612.49136.41615
125016.56647.28447
811207.558775.49867
821012.64765.18959
1211186.594755.24013
122911.51196.38991
1611186.813166.03729
16277.95.34516
     
 
I would also like:
 
  Nnew_TOTAL
WEEKabc_scrMeanStd Dev
1-81 12.49-7.52= 
1-82 16.57-12.65= 
1-121 12.49-6.54= 
1-122 16.57-11.51= 
1-161   
1-162   
     
 
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

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;
PG

View solution in original post

3 REPLIES 3
starz4ever2007
Quartz | Level 8
sorry the values in the second table should be in the "Mean" column not the "Std Dev"
PGStats
Opal | Level 21

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;
PG
starz4ever2007
Quartz | Level 8

was able to modify and make it work! thanks 😄

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

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1213 views
  • 1 like
  • 2 in conversation