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).
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
keptdeleted 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
@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.
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)
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
keptdeleted 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
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!
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.
Ready to level-up your skills? Choose your own adventure.