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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.