proc surveyreg data=crdsimple;
class sic fyear idvc ids loss;
model rating = sic fyear 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;
data crd3;
set crd2;
if sic = 0100 then rtmade1 = rtmade+2.9293598;
if fyear = 1993 then rtmade2 = rtmade1-3.5688886;
if sic = 1000 then rtmade1 = rtmade+2.4553097;
if fyear = 2008 then rtmade2 = rtmade1--1.0594573;
run;
Hi!!!!
Throughout the above codes, I could obtain coefficient to estimate by dependent variable!
However, the problem is... that I have so many categorical variables and need to input so many coefficients of SICs and FYEARs.
As you can see the last code, I did a little but I have more than 500 categories...
Does anyone know better ways to code to reflect categorical coefficients?
I appreciate your helpful comments so much!!!!
@JKCho wrote:
proc surveyreg data=crdsimple; class sic fyear idvc ids loss; model rating = sic fyear 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;
data crd3; set crd2; if sic = 0100 then rtmade1 = rtmade+2.9293598; if fyear = 1993 then rtmade2 = rtmade1-3.5688886; if sic = 1000 then rtmade1 = rtmade+2.4553097; if fyear = 2008 then rtmade2 = rtmade1--1.0594573; run;
Hi!!!!
Throughout the above codes, I could obtain coefficient to estimate by dependent variable!
However, the problem is... that I have so many categorical variables and need to input so many coefficients of SICs and FYEARs.
As you can see the last code, I did a little but I have more than 500 categories...
Does anyone know better ways to code to reflect categorical coefficients?
I appreciate your helpful comments so much!!!!
So, where are those coefficients coming from? If you mean that you need to use something from the output of the Surveyreg procedure then you should direct the needed output into a data set from the proc.
maybe
proc surveyreg data=crdsimple; class sic fyear idvc ids loss; model rating = sic fyear logat roa lev idvc ids loss/ solution; ods output Parameterestimates =work.parms; run;
And work.parms would have the coefficients needed.
You would likely need to transpose modify the output set to use in the fashion you are attempting.
@JKCho wrote:
proc surveyreg data=crdsimple; class sic fyear idvc ids loss; model rating = sic fyear 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;
data crd3; set crd2; if sic = 0100 then rtmade1 = rtmade+2.9293598; if fyear = 1993 then rtmade2 = rtmade1-3.5688886; if sic = 1000 then rtmade1 = rtmade+2.4553097; if fyear = 2008 then rtmade2 = rtmade1--1.0594573; run;
Hi!!!!
Throughout the above codes, I could obtain coefficient to estimate by dependent variable!
However, the problem is... that I have so many categorical variables and need to input so many coefficients of SICs and FYEARs.
As you can see the last code, I did a little but I have more than 500 categories...
Does anyone know better ways to code to reflect categorical coefficients?
I appreciate your helpful comments so much!!!!
So, where are those coefficients coming from? If you mean that you need to use something from the output of the Surveyreg procedure then you should direct the needed output into a data set from the proc.
maybe
proc surveyreg data=crdsimple; class sic fyear idvc ids loss; model rating = sic fyear logat roa lev idvc ids loss/ solution; ods output Parameterestimates =work.parms; run;
And work.parms would have the coefficients needed.
You would likely need to transpose modify the output set to use in the fashion you are attempting.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.