Hi I am trying to create an ODS OUTPUT of the LSMeans for each of my groups so that I can use that data to graph them later. For reference I am doing a two way ANOVA with one blocking factor. When I run the code I keep getting a warning message shown below:
WARNING: Output 'GLM.LSMEANS.A_flour_B_temp.Y_protein.LSMeans' was not created. Make sure that the output object name, label, or path is spelled correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For example, verify that the NOPRINT option is not used.
I have included the code that I am using below:
DATA bread;
INPUT A_flour $ B_temp $ C_day $ Y_protein;
DATALINES;
A T1 D1 5.8
A T2 D1 4.6
A T3 D1 4.7
B T1 D1 8.4
B T2 D1 5.4
B T3 D1 4.9
C T1 D1 16.0
C T2 D1 5.2
C T3 D1 4.2
A T1 D2 11.4
A T2 D2 5.2
A T3 D2 5.2
B T1 D2 7.9
B T2 D2 7.9
B T3 D2 7.2
C T1 D2 17.7
C T2 D2 7.0
C T3 D2 6.3
A T1 D3 10.5
A T2 D3 9.7
A T3 D3 4.9
B T1 D3 14.7
B T2 D3 8.1
B T3 D3 6.9
C T1 D3 16.9
C T2 D3 11.5
C T3 D3 7.2
;
RUN;
PROC GLM DATA=bread;
CLASS A_flour B_temp C_day;
MODEL Y_protein = A_flour B_temp A_flour*B_temp C_day;
OUTPUT OUT=junk PREDICTED=yhat RESIDUAL=e;
QUIT;
PROC UNIVARIATE DATA=junk NORMAL PLOT;
VAR e;
RUN;
PROC SGPLOT DATA=junk;
SCATTER Y=e X=yhat;
RUN;
ODS OUTPUT GLM.LSMEANS.A_flour_B_temp.Y_protein.LSMeans = LSM_2wAB;
PROC GLM DATA=bread;
CLASS A_flour B_temp C_day;
MODEL Y_protein = A_flour B_temp A_flour*B_temp C_day;
LSMEANS A_flour*B_temp;
QUIT;
Please let me know if you have any guidance.
Thank you for your help!!
It appears to work for me:
119 ODS OUTPUT GLM.LSMEANS.A_flour_B_temp.Y_protein.LSMeans = LSM_2wAB; 120 PROC GLM DATA=bread; 121 CLASS A_flour B_temp C_day; 122 MODEL Y_protein = A_flour B_temp A_flour*B_temp C_day; 123 LSMEANS A_flour*B_temp; 124 quit; NOTE: The data set WORK.LSM_2WAB has 9 observations and 5 variables. NOTE: PROCEDURE GLM used (Total process time): real time 0:00:00.41 cpu time 0:00:00.15 Timestamp April 20, 2020 02:02:39 PM
If you start a new SAS Studio session and run only the code you included in your message, does it work? My guess is that something in your environment is set incorrectly, but it's difficult to tell what. Do you have any other ODS statements earlier in the program?
Thanks for the suggestion. I started a new SAS Studio session and ran only the code in the question, but I still get the same error message. I am using SAS studio through the university edition if that makes a difference.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.