UCLA Creating a SAS Data sets Reading Spreadsheet and Database Data
Question Description
detail see the attached file, this is the first question.
1. Creating a SAS Data Set
a. Retrieve and submit the starter program p106e01.
What is the name of the variable that contains gender values?
What are the two observed gender values?
b. Add a DATA step before the PROC PRINT step to create a new data set named work.youngadult. Use the data set orion.customer_dim as input. Include a WHERE statement to select only female customers.
Submit the program and confirm that work.youngadult was created with 30 observations and
11 variables.
c. Modify the program to select female customers whose ages are between 18 and 36. Submit the program and confirm that work.youngadult was created with 15 observations and 11 variables.
d. Modify the program to select 18- to 36-year-old female customers who have the word Gold in their Customer_Group values. Submit the program and confirm that work.youngadult was created with five observations and 11 variables.
e. Add an assignment statement to the DATA step to create a new variable, Discount, and assign it
a value of .25.
f. Modify the PROC PRINT step to print the new data set as shown below. Use an ID statement to display Customer_ID instead of the Obs column. Results should contain five observations.
Customer_ Customer_
Customer_ID Customer_Name Age Gender Customer_Group Discount
5 Sandrina Stephano 28 F Orion Club Gold members 0.25
9 Cornelia Krahl 33 F Orion Club Gold members 0.25
45 Dianne Patchin 28 F Orion Club Gold members 0.25
49 Annmarie Leveille 23 F Orion Club Gold members 0.25
2550 Sanelisiwe Collier 19 F Orion Club Gold members 0.25