I was try to use
PROC GPLOT;
PLOT lnwage*education;
on my MacBook, it is a university edition, and show this error.
Can someone help my with this issue?
filename PS4SAS '/folders/myfolders/Econ';
/* Establish an extra library named PS4SAS in the Econ folder of My Folders. */
data mydata;
infile '/folders/myfolders/Econ/nlsextract.raw';
input age married education central south indcode occcode union experience tenure hours weeks wage smsa;
/* Attach an external file of demographic and workplace variables. */
proc means;
/* Get the mean of the education variable is 12.85159. */
proc freq;
tables married;
/* For married, there is 36.75% for 0; 63.25% for 1, which is married, and no value was missing for married, total 283 observations. */
data mydata; set mydata;
experience2=experience*experience;
/* Get the new variable which is the square of experience variable. */
if wage gt 0 then lnwage=log(wage);
/* Get the new variable which is the log of the wage variable.*/
data mydata; set mydata;
if hours ge 25;
/* Restrict the average hours of a week greater or equal 25. */
proc gplot;
plot lnwage * education;
proc print data = mydata;
run;
SAS/Graph is not included in SAS University Edition
Look into the SGPLOT procedures instead to create your graphs.
SAS/Graph is not included in SAS University Edition
Look into the SGPLOT procedures instead to create your graphs.
I also tried to use
proc sgplot;
plot lnwage*education;
it still does not work.
Is this correct?
@xiaolufan wrote:
Is this correct?
Nope. Please check the documentation for examples on the use of the procedures.
In your case, it looks like a basic scatter plot.
The code is a bit more intuitive in SGPLOT in my opinion. Also, my recommendation, especially when learning is to always specify the DATA statement on your procs to denote what data source you're using.
proc sgplot data=sashelp.class;
scatter x=height y=weight;
run;
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 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: