Question 21

You are analyzing a dataset 'CustomerSurvey' with variables 'AgeGroup', 'Satisfaction', and 'Gender'. You need to create a two-way table showing the distribution of 'Satisfaction' across different 'AgeGroup's. However, you only want to include customers whose 'Gender' is 'Female'. Which PROC FREQ statement, with the CROSSLIST option, correctly produces this table?
  • Question 22

    You have a dataset called 'Employees' with variables 'EmployeelD', 'Department', and 'Salary'. You want to categorize employees into three groups based on their salaries: 'High', 'Medium', and 'Low'. 'High' salary is defined as greater than $100,000, 'Medium' salary is between $50,000 and $100,000, and 'Low' salary is less than $50,000. Which code snippet correctly creates a new variable 'SalaryGroup' and assigns the appropriate category to each employee?
  • Question 23

    You have a dataset called 'SALES' with variables 'REGION', 'PRODUCT', 'SALES AMOUNT', and 'PROFIT'. You need to create a new dataset 'HIGH SALES' containing only observations with 'SALES AMOUNT' greater than 1000 and only the variables 'REGION' and 'PROFIT'. Which of the following DATA step code segments achieves this correctly?
  • Question 24

    Given the STUDENTS data set below:

    What will be the values for First. State and Last. State for Ellen's observation?
  • Question 25

    You have a SAS dataset named 'CUSTOMERS' with variables 'CUSTOMER ID', 'NAME', and 'CITY'. You want to create a report that displays only the customer ID, name, and city for customers residing in 'New York City'. Additionally, you need to display a header with the date and time when the report was generated. Which PROC PRINT statement achieves this, employing the LABEL option to enhance readability and the NOOBS option to eliminate observation numbers?