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.

 

 

 

 

 

 


 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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