BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JKCho
Pyrite | Level 9
proc surveyreg data=crdsimple;
class sic fyear idvc ids loss;
model rating = logat roa lev idvc ids loss/ solution;

run;

data crd2;
set crdsimple;
rtmade = 16.8313718 -0.9310491*logat-1.0102761*roa+0.7764174*lev-2.4251711*idvc-0.4183952*ids+1.5549358*loss ;
run;

Hi!

 

What I am doing here is 1) to get coefficient estimates and 2) use these estimate to obtain dependent variables.

Since I used 2 fixed effect(sic and fyear), I may need to reconsider these 2 when calculating dependent variables again.

 

However, there is no output statement showing fixed effects and wonder how one can obtain dependent variables with fixed effects?

Simply, I need intercept so used proc survey instead of proc glm and, so far, I am satisfied with the outcome. 

Calculated ratings(rtmade) are fairly similar to real ratings given in general and this makes me think that I need to consider fixed effects!!

 

Does anyone know how to consider fixed effects?

Plus,  I have yearly effects and more... I may need a good and simple coding to put these effects. If not, I should put each year's effect manually, which is not recommended at all. (like this... If year=1999 then rtmade+some number for 1999... and do this multiple times) 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

You add SIC and FYEAR into the MODEL statement, since your code has already placed them into the CLASS statement.

 

 

--
Paige Miller

View solution in original post

8 REPLIES 8
PaigeMiller
Diamond | Level 26

Do you mean: how to use fixed effects to PREDICT dependent variables?

 

Do you mean how you can use SIC and FYEAR since they are categorical ?

--
Paige Miller
JKCho
Pyrite | Level 9
Sorry for this confusion.

I mean the second.
They are categorical so I need to add more effects by each SIC and each FYEAR after my getting DV value from my equation of RTMADE. I simply want to retrieve the values of each categorical effects.
PaigeMiller
Diamond | Level 26

You add SIC and FYEAR into the MODEL statement, since your code has already placed them into the CLASS statement.

 

 

--
Paige Miller
JKCho
Pyrite | Level 9
wow... that is it...
I was so curious...why it didn't have the info.
Besides, Do you also know by any change the coding to put these categorical effects?

Cuz I currently do not know it. I am thinking of doing like.... if year=1999 then rtmade+some number of 1999's year effect ... and do this multiple times)

PaigeMiller
Diamond | Level 26

Each year, and each SIC should have a regression coefficient estimated, which you can view with the SOLUTION option to the MODEL statement.

--
Paige Miller
JKCho
Pyrite | Level 9
My previous question was not that clear I intended.
I meant if there is a better code to put these coefficients in the equation,

rtmade = 16.8313718 -0.9310491*logat-1.0102761*roa+0.7764174*lev-2.4251711*idvc-0.4183952*ids+1.5549358*loss

to obtain ratings(there are many missing ratings so I needed to obtain coefficients to estimate dependent variables). However, there are so many categories. I simply asked if I can make another code instead of writing each SIC and FYEAR coefficients on my equation.
PaigeMiller
Diamond | Level 26

I have never done this with PROC SURVEYREG, but it works in PROC GLM and PROC REG, so I'm guessing it will work in PROC SURVEYREG. You add to the data set CRDSIMPLE records which contain the values you want to predict at (values of logat roa lev idvc ids loss sic fyear) but leave the dependent variable RATING missing. Then when you request predicted values from SURVEYREG with the OUTPUT command, the predicted RATINGS for all records (the ones which have a non-missing Y and the ones which have a missing Y) will be in this output data set.

--
Paige Miller
JKCho
Pyrite | Level 9
output p=pred was the one I want and proc scoring too. Thank you for your help!!!!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 8 replies
  • 1291 views
  • 4 likes
  • 2 in conversation