- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
?? 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 .
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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!