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

Hello

 

I have a simple code for proc corr:

proc corr data=sasuser.sasfile190616;

var TAssets Sales ROA Q SalesGro RDSales LTassets;

by FF;

run

 

I want that this procedure will run only for these lines that FF=1. Where I have to add this condition?

 

Thanks a lot!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You can filter your data with a WHERE clause.

 

This can be placed in your code, I generally recommend it goes right after the PROC CORR statement. 

 

WHERE FF=1;

The full code is below, but if you're running it for only one value of FF, then you don't need the BY statement. In general I find its best to include the BY as early as possible in the proc. 

proc corr data=sasuser.sasfile190616;
Where FF=1;
by FF;
var TAssets Sales ROA Q SalesGro RDSales LTassets;
run

View solution in original post

2 REPLIES 2
Reeza
Super User

You can filter your data with a WHERE clause.

 

This can be placed in your code, I generally recommend it goes right after the PROC CORR statement. 

 

WHERE FF=1;

The full code is below, but if you're running it for only one value of FF, then you don't need the BY statement. In general I find its best to include the BY as early as possible in the proc. 

proc corr data=sasuser.sasfile190616;
Where FF=1;
by FF;
var TAssets Sales ROA Q SalesGro RDSales LTassets;
run
yael
Quartz | Level 8

Thanks for your reply.

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1842 views
  • 2 likes
  • 2 in conversation