I've been instructed to produce a scatterplot between a response and predictor, grouped by an indicator variable. I am supposed to have one scatterplot show the different levels of the indicator variable. I am using a limited, remote version of SAS - so there are some procedures I can't really use. I'm limited to using proc reg or proc gplot.
This is what I have tried, but what it does it produce two separate scatterplots for each level of the indicator:
goptions reset = all;
symbol1 v=dot c=red h=1;
symbol2 v=plus c=blue h=2;
proc gplot data=datafile;
plot Y*X;
by ind;
run;
I have also tried:
proc reg data=datafile;
model Y = X;
plot Y*X;
by ind;
run;
I have tried other variations, and have also sorted by the indicator beforehand. Any help would be appreciated.
Take a look at what happens with:
proc gplot data=datafile;
plot Y*X= ind;
run;
Take a look at what happens with:
proc gplot data=datafile;
plot Y*X= ind;
run;
Thanks. That seems to have worked.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.