BookmarkSubscribeRSS Feed
andresmorago
Calcite | Level 5

Hi

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 ;
 
 

Jb80U

1 REPLY 1
Reeza
Super User

Couple of ways:

  1. Run both in the same proc
  2. Store the input data set name when appending the files
ods select parameterEstimates = regEst;
proc reg data = main outest = main_regression1;
model1: model x= a b c;
model2: model x = a b d;
run ; quit;
data regression_summary ;
length source input_dsn $50.;
set main_regression1 main_regression2 INDSNAME=source ;
input_dsn = source;
run ;

@andresmorago wrote:

Hi

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 ;
 
 

Jb80U


 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 1 reply
  • 779 views
  • 0 likes
  • 2 in conversation