BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

Hi all SAS Users,

Have a nice week,

 

Today I want to run PROC REG with a subsample, I know one way is to create a subsample and run PROC REG, but I wondering if there is any way to run directly in PROC REG procedure without another data step for creating a subsample.

 

My code of running for the WHOLE sample as below:

proc reg data=merge_treat_con_copy;
	model wINV_DAY= pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION 
		wTANGIBILITY FCF wLOG_MVE wCAP_INT wGRO_MAR/ tol vif collin;
run;

Now I want to run where INDC3="RTLS".

 

Can you please hint me to sort it out?

Warmest regards and thanks,

Phil.

 

 

 

 

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@Phil_NZ wrote:

Hi all SAS Users,

Have a nice week,

 

Today I want to run PROC REG with a subsample, I know one way is to create a subsample and run PROC REG, but I wondering if there is any way to run directly in PROC REG procedure without another data step for creating a subsample.

 

My code of running for the WHOLE sample as below:

proc reg data=merge_treat_con_copy;
	model wINV_DAY= pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION 
		wTANGIBILITY FCF wLOG_MVE wCAP_INT wGRO_MAR/ tol vif collin;
run;

Now I want to run where INDC3="RTLS".

 

Can you please hint me to sort it out?

Warmest regards and thanks,

Phil.

 


Your question includes the answer.  Just use a WHERE statement.

where INDC3="RTLS";

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26
proc reg data=merge_treat_con_copy(where=(indc3='RTLS'));
--
Paige Miller
Tom
Super User Tom
Super User

@Phil_NZ wrote:

Hi all SAS Users,

Have a nice week,

 

Today I want to run PROC REG with a subsample, I know one way is to create a subsample and run PROC REG, but I wondering if there is any way to run directly in PROC REG procedure without another data step for creating a subsample.

 

My code of running for the WHOLE sample as below:

proc reg data=merge_treat_con_copy;
	model wINV_DAY= pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION 
		wTANGIBILITY FCF wLOG_MVE wCAP_INT wGRO_MAR/ tol vif collin;
run;

Now I want to run where INDC3="RTLS".

 

Can you please hint me to sort it out?

Warmest regards and thanks,

Phil.

 


Your question includes the answer.  Just use a WHERE statement.

where INDC3="RTLS";
Reeza
Super User
  1. Data set option of WHERE
  2. WHERE in the data step
  3. Creation of a view, which doesn't create the view until you run it. 

1 & 2 are available in almost ALL process in SAS. 

 

You've seen examples of all in the past few months so I assume you know how to code them. 

 


@Phil_NZ wrote:

Hi all SAS Users,

Have a nice week,

 

Today I want to run PROC REG with a subsample, I know one way is to create a subsample and run PROC REG, but I wondering if there is any way to run directly in PROC REG procedure without another data step for creating a subsample.

 

My code of running for the WHOLE sample as below:

proc reg data=merge_treat_con_copy;
	model wINV_DAY= pt wFIRM_SIZE LNGDP UNEMPLOYMENT  INFLATION 
		wTANGIBILITY FCF wLOG_MVE wCAP_INT wGRO_MAR/ tol vif collin;
run;

Now I want to run where INDC3="RTLS".

 

Can you please hint me to sort it out?

Warmest regards and thanks,

Phil.

 

 

 

 

 

 


 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1138 views
  • 5 likes
  • 4 in conversation