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

Hello 

I got a question : in the scenario 2 (workbook prep guide ) we are asked to "Remove observations with RestHR values that are greater than or equal to 70". but in the code we kept the observations that are equal to 70 so my answer for the number of observations was 4 and in the book was stated as 6 (as they kept 2 observations with RestHR=70).

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jimbarbour
Meteorite | Level 14

I think you mean that you deleted the observations that are equal to 70.

I got a question : in the scenario 2 (workbook prep guide ) we are asked to "Remove observations with RestHR values that are greater than or equal to 70". but in the code we kept deleted the observations that are equal to 70 so my answer for the number of observations was 4 and in the book was stated as 6 (as they kept 2 observations with RestHR=70).

 

I've seen this before in Prep guides.  Sometimes the answer they give is just wrong.  Unfortunately, SAS' quality control on Prep guides isn't very good.  Famously, one of their answers specified a Libname that was longer than 8 characters, which will cause the code to fail.  💥

 

Jim

View solution in original post

3 REPLIES 3
ballardw
Super User

@samira31 wrote:

Hello 

I got a question : in the scenario 2 (workbook prep guide ) we are asked to "Remove observations with RestHR values that are greater than or equal to 70". but in the code we kept the observations that are equal to 70 so my answer for the number of observations was 4 and in the book was stated as 6 (as they kept 2 observations with RestHR=70).

 

 


Show the code you used.

It sounds more like you only kept values greater than 70.

 

Please re-read your initial post. You claim of keeping "the observations that are equal to 70" and " they kept 2 observations with RestHR=70" is not consistent.

 

Also, make sure you are using the correct input data set. If you modified values or removed observation previously the numbers may not match.

samira31
Calcite | Level 5

the code I used is :

data work.stress1;
set cert.stress;
if RestHr<70;
Totaltime=(Timemin*60)+Timesec;
If Totaltime>=600;
run;
proc print data=work.stress1;
run;

 So I omitted the observations with restHr that are equal to 70( two observations)

jimbarbour
Meteorite | Level 14

I think you mean that you deleted the observations that are equal to 70.

I got a question : in the scenario 2 (workbook prep guide ) we are asked to "Remove observations with RestHR values that are greater than or equal to 70". but in the code we kept deleted the observations that are equal to 70 so my answer for the number of observations was 4 and in the book was stated as 6 (as they kept 2 observations with RestHR=70).

 

I've seen this before in Prep guides.  Sometimes the answer they give is just wrong.  Unfortunately, SAS' quality control on Prep guides isn't very good.  Famously, one of their answers specified a Libname that was longer than 8 characters, which will cause the code to fail.  💥

 

Jim

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 736 views
  • 2 likes
  • 3 in conversation