I am using SAS Studio
variables are fertility and pcturban
I need to graph log(ferility)*pcturban, but SAS is reading log as a variable, which I don't have.
proc plot data=UN112;
plot log(fertility)*pcturban;
run;
proc reg data=UN112;
model log(fertility)=pcturban;
run;
Log function does not highlight blue in SAS Studio.
Do you actually want the TEXT based result from using Proc Plot?
You would have to use a data step to calculate the log.
Or you might try
proc sgplot data=un112; scatter x=ferility y=pcturban; xaxis type=log; run;
Proc Reg also requires the transform done before hand not on a model statement.
Note that proc reg also supports plotting with the Plots= option.
Most of the time when you think something is a keyword and does not highlight in the editor you are either using it incorrectly or it is not valid at all. Most of the time, there are some exceptions.
Do you actually want the TEXT based result from using Proc Plot?
You would have to use a data step to calculate the log.
Or you might try
proc sgplot data=un112; scatter x=ferility y=pcturban; xaxis type=log; run;
Proc Reg also requires the transform done before hand not on a model statement.
Note that proc reg also supports plotting with the Plots= option.
Most of the time when you think something is a keyword and does not highlight in the editor you are either using it incorrectly or it is not valid at all. Most of the time, there are some exceptions.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.