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)
You add SIC and FYEAR into the MODEL statement, since your code has already placed them into the CLASS statement.
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 ?
You add SIC and FYEAR into the MODEL statement, since your code has already placed them into the CLASS statement.
Each year, and each SIC should have a regression coefficient estimated, which you can view with the SOLUTION option to the MODEL statement.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.