I used the following code, but I want the columns in a different order.
ods graphics on;
proc glm plots=diagnostics;
class trt;
model pct_Juice Brix Acid Ratio BrimA = trt;
lsmeans trt/adjust=tukey alpha=0.05 lines;
run;
Here is the default graph, but the columns are in alphabetical order. I want "Control" as the first column on the left.
In your SAS data set, add a space in front of 'Control' so it is now ' Control'
Then run PROC GLM again
In your SAS data set, add a space in front of 'Control' so it is now ' Control'
Then run PROC GLM again
Generally you have two options:
1. Make the graph using the output and SGPLOT
2. Map numbers to the values you'd like ordering them in the order you'd like to see, ie Control = 0, Black = 1, Blue = 2 and use Labels to control the displayed value. Then once they're sorted by default they'll show the labels in the order desired.
@tebert wrote:
I used the following code, but I want the columns in a different order.
ods graphics on; proc glm plots=diagnostics; class trt; model pct_Juice Brix Acid Ratio BrimA = trt; lsmeans trt/adjust=tukey alpha=0.05 lines; run;
Here is the default graph, but the columns are in alphabetical order. I want "Control" as the first column on the left.
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.