Question: Task 2: 2a: Write a DATA step to create a SAS data set named as Demographics_New. This data set must contain all observations and variables

Task 2: 2a: Write a DATA step to create a SAS data set named as Demographics_New. This data set must contain all observations and variables in Demographics and a new variable called Tenure. Tenure is defined as the number of full months from an observations Join_Date till 1 Jan 2021. For example, if an observations Join_Date is 2 Jan 2020, then the observations Tenure value is 11 months. Place Demographics_New in the library created in Task 1. {Hint: SAS function INTCK('month', '2jan2020'd, '1jan2021'd,'continuous') returns a value of 11 months. The 'month' and 'continuous' are system keywords for the INTCK function.} A subset of the observations in Demographics_New is shown here for illustration purposes:Task 2: 2a: Write a DATA step to create a SAS2b: Write a DATA step to modify the Gender values in Demographics_New so that if an observations Gender value is either f or m, replace it by F or M, respectively. Name the modified data set as Demographics_New again and keep it in the library created in Task 1. (Be aware that this new Demographics_New will overwrite the original Demographics_New.)

2c: Write appropriate SAS procedure statements for the purpose of comparing the average Tenure between male and female members in Demographics_New.

member_id Join_date birth_year gender tenure 12345678_34377 28/10/2010 1965 M 122 12345678_71505 23/07/2014 1971 F 77 12345678_32760 29/10/2016 1985 M 50 12345678_39979 07/05/2017 1975 M 43 12345678_85104 20/04/2017 1978 M 44 12345678_9437 21/03/2011 1971 M 117 12345678_99311 01/06/2010 1986 F 127 12345678_13428 15/06/2003 1980 F 210 12345678_30306 04/03/2016 1988 M 57 12345678_10495 30/12/2017 1972 M 36 member_id Join_date birth_year gender tenure 12345678_34377 28/10/2010 1965 M 122 12345678_71505 23/07/2014 1971 F 77 12345678_32760 29/10/2016 1985 M 50 12345678_39979 07/05/2017 1975 M 43 12345678_85104 20/04/2017 1978 M 44 12345678_9437 21/03/2011 1971 M 117 12345678_99311 01/06/2010 1986 F 127 12345678_13428 15/06/2003 1980 F 210 12345678_30306 04/03/2016 1988 M 57 12345678_10495 30/12/2017 1972 M 36

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!