Advertisement
elena1234

scatter plot with regression line in SAS

Apr 8th, 2023 (edited)
1,613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 0.71 KB | None | 0 0
  1. ods excel file='/home/u63376027/Export/Scatterplots_with_Regression Line.xlsx' style=seaside;
  2. proc sgplot data=STPSAMP.STPEURO noautolegend;
  3.    title 'Population vs Growth';
  4.    reg y=pop x=growth /
  5.    lineattrs=(color=red thickness=2)
  6.    markerattrs=(color=green size=8px symbol=circlefilled);
  7.    xaxis grid values= (-0.04 to 0.04 by 0.001);
  8.    yaxis grid values = (0 to 150000000 by 10000000);
  9. run;
  10.  
  11. proc sgplot data=STPSAMP.STPEURO noautolegend;
  12.    title 'Birth vs Growth';
  13.    reg y=birth x=growth /
  14.    lineattrs=(color=red thickness=2)
  15.    markerattrs=(color=green size=8px symbol=circlefilled);
  16.    xaxis grid values= (-0.04 to 0.04 by 0.001);
  17.    yaxis grid values = (0 to 22 by 2);
  18. run;
  19. ods excel close;
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement