Hello! I am using PROC REG to estimate parameters, and I want to use the estimated coefficients for significant (p<.05) variables to score a new dataset for observations which are missing the modeled variable. I can output the parameters using the outest= option but I don't know how to easily apply these parameters to the dataset which has known values for the independent variables but unknown values for the dependent variable. For example,
ods output SelParmEst=reg_parms_&modeled_ind_var; proc reg data=work.have; &modeled_ind_var : model &modeled_ind_var = x y z/selection=backward sls=.05; run;
I see a reference to a SCORE statement for PROC REG, but I must not have the right version of SAS?
I can see this process done in 1 step using PROC DISCRIM, as below.
%let discrim_var=y;
data missing_&discrim_var not_missing_&discrim_var;
set work.have;
if missing(&discrim_var) then output missing_&discrim_var;
else output not_missing_&discrim_var;
run;
proc discrim data=work.have testdata=work.missing_&discrim_var testout=results_&discrim_var;
.......;
run;
Is there another procedure that I should be applying than PROC REG?
BR, Koen
BR, Koen
Just use the normal OUTEST= option, like it shows in the examples for PROC SCORE.
proc reg data=work.have outest=reg_parms_&modeled_ind_var ;
&modeled_ind_var : model &modeled_ind_var = x y z/selection=backward sls=.05;
run;
Then use that dataset as the SCORE= dataset in your PROC SCORE call.
Thank you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.