My first post to SAS communities...
I want the fitted data (red dots) in the scatterplot below to be a line rather than a set of dots. I don't see a way an option within the scatter statement to change the circles to lines. Any suggestions? (My code below.)
proc sgplot data=pred1;
scatter x=eucdist y= HTp; *blue circles;
scatter x=eucdist y= HTp_pred; *red circles;
run;
SCATTER creates a scatter plot.
Use SERIES to create a line plot instead.
Everything else can stay the same.
EDIT: REG can do both at once though, without the pre-calculation as well. Remove the CLM/CLI to remove the prediction and confidence intervals. You could do all three together to test that if you'd like.
proc sgplot data=sashelp.class;
reg x=height y=weight / CLM CLI;
run;
@Reeza wrote:
SCATTER creates a scatter plot.
Use SERIES to create a line plot instead.
Everything else can stay the same.
EDIT: REG can do both at once though, without the pre-calculation as well. Remove the CLM/CLI to remove the prediction and confidence intervals. You could do all three together to test that if you'd like.
proc sgplot data=sashelp.class; reg x=height y=weight / CLM CLI; run;
Data shows enough of a curve you may want the DEGREES=2 option to fit a quadratic in the Sgplot REG statement.
proc sort data=pred1; by eucdist; run;
proc sgplot data=pred1;
scatter x=eucdist y= HTp; *blue circles;
series x=eucdist y= HTp_pred / lineattrs=GraphData2; *line in contrasting color;
run;
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!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.