- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have a regression model that I fitted with proc glm. I want to have both observed and predicted values of my response variable. Then I want to group each into 100 groups (by rank) and find AVERAGE and STD per group for each column:
Y YRank Yhat YhatRank
23 2 20.2 2
22.8 2 21.5 3
15.8 1 16.2 2
11.2 1 9.8 1
8.7 1 10 1
... ... ... ...
So then:
group avg_Y std_Y avg_Yhat std_Yhat
1 11.9 1.1 9.9 2.1
2 22.9 1.7 18.2 1.9
... ... ... ... ...
100 ... ... .... ...
Your help would be greatly appreciated!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax17.htm&docsetVersion=15...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The output from the OUTPUT statement in PROC GLM will contain the actual Y value, the predicted value and the residual value, if you use the proper options. P=PRED is the option that produces predicted values, R=RESID is the option that produces residual values.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax17.htm&docsetVersion=15...