SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
LLOUKINE
Calcite | Level 5

Does anyone know what kind of a regression model (with or w/o intercept) is used to build a regression line in the proc sgplot? I want to add the model parameters to the graph but I am not sure which model corresponds to the reg line in the sgplot when we use reg statement there. I checked the documentation for the proc sgplot but did not find any info regarding this. 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

No. You can not. But you could use PROC REG + PLOT to get the regression line function:

 

proc reg data=sashelp.class;
model height=weight;
/*model height=weight/noint;*/
plot height*weight;
quit;

Ksharp_0-1744333716487.png

 

View solution in original post

4 REPLIES 4
Ksharp
Super User

?? It is just a regression model with one independent variable:   Y=intercept + beta*X ;

You can compare the output between PROC REG and PROC SGPLOT.

 

proc reg data=sashelp.class;
model height=weight;
quit;

proc sgplot data=sashelp.class;
reg y=height x=weight;
run;

 

You could see thay have the same regression line and intercept .

LLOUKINE
Calcite | Level 5

thanks for the reply! I appreciate it! but unfortunately I do not see it on the graph.  perhaps I should specify the start of the axis to see it. Thanks for the idea how to check it.

 

Do you know if proc sgplot can output the parameters for the reg line? and whether it is possible to specify the reg w/o an intercept in proc sgplot?

I know that I can run proc reg, save the model parameters into a file and than pick it up and display them on the plot. I am just wondering if i can only use proc sgplot for that. thank you!

 

Ksharp
Super User

No. You can not. But you could use PROC REG + PLOT to get the regression line function:

 

proc reg data=sashelp.class;
model height=weight;
/*model height=weight/noint;*/
plot height*weight;
quit;

Ksharp_0-1744333716487.png

 

LLOUKINE
Calcite | Level 5

thank you for the confirmation! this is what I thought too. Too bad that SAS did not gave more functionality to the sgplot. 

Thanks again for the confirmation!

 

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1026 views
  • 0 likes
  • 2 in conversation