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

Hi,

I'm new to SAS and am working on a research project.  I would like to run proc glm on a data set but would like to exclude some observations in the data set so that I can compare apples to apples.  So here's the problem...

 

I'm working on analyzing patient satisfaction scores but I want to eliminate observations which have a response rate of greater than 25 or less than 17 so my syntax is as follows:

 

proc glm;

class var1 var2 var3;

model dvar=var1 var2 var3;

run;

 

In this syntax, can I use the if-then or between function for a totally different variable (var4)?  Variable 4 being response rate.  I'd like to use all observations with response rates between 17 and 25 percent so that I can eliminate the few outliers that are extremely high or low.  17-25 percent is the average response rate.

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

How about:

 

proc glm data=myUnnamedData;
where var4 between 0.17 and 0.25;
class var1 var2 var3;
model dvar=var1 var2 var3;
run;
PG

View solution in original post

3 REPLIES 3
PGStats
Opal | Level 21

How about:

 

proc glm data=myUnnamedData;
where var4 between 0.17 and 0.25;
class var1 var2 var3;
model dvar=var1 var2 var3;
run;
PG
newbie10
Calcite | Level 5

Thank you!  I'll try this.

newbie10
Calcite | Level 5

It worked!  Thanks a bunch!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 997 views
  • 0 likes
  • 2 in conversation