Reputation: 1106
Im running 2 different regressions from the same dataset. I would like to name them differently to prevent confusion. How can i assign the label name
proc reg data = main outest = main_regression1;
model x= a b c;
run ;
proc reg data = main outest = main_regression2;
model x= a b d;
run ;
data regression_summary ;
set main_regression1 main_regression2 ;
run ;
Upvotes: 0
Views: 455
Reputation: 12909
You can add multiple models within a single proc reg
and assign each one a label.
proc reg data = main outest = est;
FirstModel: model x = a b c;
SecondModel: model x = a b d;
run;
Output of est
:
_MODEL_ _TYPE_ ...
FirstModel PARMS ...
SecondModel PARMS ...
Upvotes: 2
Reputation: 1044
You can use the (in=)
option to create a temporary flag variable and then assign a value to it in another variable. For example:
data regression_summary ;
set main_regression1 (in=A) main_regression2 ;
if A=1 then LABEL = "Model 1";
else if A=0 then LABEL = "Model 2";
run ;
Upvotes: 1