09-08-2011 01:40 AM
Create SAS data set contain output of standard errror of slope, standard errror of intercept. output generated by proc glm.
Following is SAS code:
input x y;
1 0.9450 0.060958
2 1.8580 0.143329
4 3.7480 0.279329
8 7.4240 0.597336
10 9.1880 0.820075
20 11.7960 8.247110
30 12.6310 17.404420
40 12.7820 27.297152
proc reg data=inputdata ;
model y = x;
After execution of above sas code, we get sas output contain slope, intercept, se of slope, se of intercept.
how to save sas output (create SAS data set) from proc reg?
Please anyone help me?
Thanks in advance.
09-08-2011 08:02 AM
You can either look in the documentation for PROC REG to see how it might use the OUTPUT statement or the OUT= option to create a SAS dataset from your procedure results OR you can read about the
ODS OUTPUT statement to create a SAS dataset from PROC REG output objects.
09-13-2011 07:23 PM
If you want to know the dataset names of ods output, use ods trace on/listing before the stat proc. Then you can pick what you want, from output window.
09-19-2011 07:55 AM
Dear Steve Denham,
Also I want required sum of squares.
Let Y is response variable & X is independent variable.
How to create SAS data set contain output of sum of squares like Sxx, Sxy, Syy & SST (Total sum of square) through proc reg procedure?
Please anyone help me.
Thanks in advance.
09-19-2011 08:30 AM
I believe that one way to get the calculations you are looking for is to specify the outsscp option. Take a look at: http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_reg_sect007....
09-21-2011 01:09 AM
But the dataset inputanova does not contain Sxx & Sxy.
Slope ~ N(Slope_Hat, Sigma^2/Sxx)
I want Sxy & Sxx for above application.
09-21-2011 05:22 AM
For corrected sum of squares for x or y, You can use proc means with css option to get.
But for corrected cross product,I am afraid that you need to calculated by hand.
proc means noprint data=sashelp.class; var weight height; output out=Sxx(drop=_:) css=weight_css height_css mean=weight_mean height_mean; run; data class; set sashelp.class; if _n_ eq 1 then set Sxx; run; proc sql ; create table Sxy_Sxx as select weight_css,height_css , sum((weight-weight_mean)*(height-height_mean))as Sxy from class; quit;
09-21-2011 09:05 AM
KSharp and Pankaj, take a look at the reference I provided earlier in this thread, particularly regarding what is included with the outsscp option. The documentation states:
outputs a data set that contains sums of squares and crossproducts
09-21-2011 10:56 PM
Art is right. I should check documentation firstly. Sorry! Pankaj Bhangale ,You should use outsscp= option to get that.
proc reg data=fitness outsscp=sscp;
var Oxygen RunTime Age Weight RestPulse RunPulse MaxPulse;
proc print data=sscp;
09-21-2011 11:49 PM
I just found that outsscp= option gave the Uncorrected Sum of Square, not Corrected Sum of Square and
The cross product is also uncorrected .So Maybe My code is what Op want.
I am so curious that why sas can not give us Corrected Sum of Square in proc reg.
Need further help from the community? Please ask a new question.