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

In SAS 9.4 scenario 2, one of the condition is to "remove observations with RestHR values that are greater than or equal to 70."

This condition should be written like:

                  where RestHR < 70;

or, the answer is correct and it should be like:

                  where RestHR <= 70;

I just want to check if I understand the question correctly or if i misunderstood the operation sigh.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

Remove observations with RestHR values that are greater than or equal to 70

is the same as

Keep observations with RestHR values that are smaller than 70

isn't it?

So:    where RestHR < 70;

 

Unless the where clause is used in a delete statement for example, in which case

   Remove observations with RestHR values that are greater than or equal to 70

is written

   where RestHR >= 70;

 

 

 

 

View solution in original post

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Remove observations with RestHR values that are greater than or equal to 70

is the same as

Keep observations with RestHR values that are smaller than 70

isn't it?

So:    where RestHR < 70;

 

Unless the where clause is used in a delete statement for example, in which case

   Remove observations with RestHR values that are greater than or equal to 70

is written

   where RestHR >= 70;

 

 

 

 

monicaco
Calcite | Level 5
In this case in SAS Book 9.4 preparation, Is the code solution for scenario 2 wrong (page 395)?+
-------
One Direction is:

• Remove observations with RestHR values that are greater than or equal to 70.

data work.stress1;
set cert.stress;
where RestHR <=70;
* this line should be "WHERE RESTHR < 70"*;
TotalTime=(timemin*60)+timesec;
if TotalTime<600 then delete;
run;

proc print data=work.stress1;
run;

Answer for each question
Question 1: 4 observation
Question 2: NA because there are only 4 observation



I appreciate any comment

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 586 views
  • 0 likes
  • 3 in conversation