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 😄

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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