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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 517 views
  • 2 likes
  • 3 in conversation