I am taking the practice exam for base programming, and was confused about the difference between the project requirements and answer key. Here is the description of the projects. It clearly says to subset the data using the variable kilograms between 40 and 200, inclusively. However, the answer code is kilograms <40 or kilograms >200 (please see the screenshots below). The results from PROC MEANS analysis are slightly different from what I manually calculated from the raw data, which for group A is 76.02 and group B is 86.25. Thanks in advance!
It isn't actually subsetting the data. It is replacing out of range values. The extra piece of information is the in the bullet following the one highlighted. It is preserving the values inclusively between 40 and 200 and only executing the DO group to replace the values if they are outside this range.
The code in your picture actually is separating into two groups based on a range from 40 to 200 inclusive.
The test (40 <= A and A <= 200) is the same as NOT (A<40 or A>200).
It isn't actually subsetting the data. It is replacing out of range values. The extra piece of information is the in the bullet following the one highlighted. It is preserving the values inclusively between 40 and 200 and only executing the DO group to replace the values if they are outside this range.
Thank you for clarify this.
This is a knowledge-sharing community for SAS Certified Professionals and anyone who wants to learn more about becoming SAS Certified. Ask questions and get answers fast. Share with others who are interested in certification and who are studying for certifications.To get the most from your community experience, use these getting-started resources:
Community Do's and Don'ts
How to add SAS syntax to your post
How to get fast, helpful answers