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.

 

 

 

 

 

 


 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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