Assignment3_081923 (1)
.docx
keyboard_arrow_up
School
University of California, Davis *
*We aren’t endorsed by this school
Course
244
Subject
Health Science
Date
Feb 20, 2024
Type
docx
Pages
2
Uploaded by SuperWillpowerButterfly25
SPH 281 – Introduction to SAS– Summer Session II 2023
Assignment 3: Due 8/24/2023 Objectives
: Writing a DATA step with IF-THEN-ELSE statements to recode and create new variables and LABEL statements; using PROC FORMAT to create variable value labels then applying the newly created formats to variables; and checking data with PROC FREQ
HINT:
Remember to check the SAS log regularly to make sure your SAS program ran without errors.
Scenario:
You are a Research Scientist for the California Department of Healthcare Services. Since the Affordable Care Act (ACA) was implemented in 2014, you want to examine access to healthcare. More specifically, you want to know what percent of the population has a usual place to go for healthcare (HUQ030). Use the data set nhanes1516 (you will need to download this from the course website).
Part 1 – Set up your data
1. Age (ridageyr) is a continuous variable (range 0-80). Create a new variable called ‘age_group’ with the following categories:
1=<18
2= 18-29
3= 30-39
4= 40-49
5=>=50
2. The variable ‘huq030’ indicates whether a person had a usual source of health care (see data dictionary at the end). This variable has 5 categories as follows:
1=Yes
2=There is no place
3=There is more than one place
7=refused
9=don’t know
Create a new numeric variable called ‘huq030_group’ that combines the following categories:
1=Yes (1) or There is more than one place (3)
2=There is no place (2)
. = refused (7), don’t know (9), and missing ( .)
3. Create labels for each of your 2 new variables. SPH 281 – Summer session II 2023
Assignment 3
4. Create formats for each of your 2 new variables. Remember, creating formats is a 2-step process:
1) create the format using PROC FORMAT and 2) assign the format to a variable using a FORMAT statement in the DATA STEP or PROC STEP. 5. Check to make sure you created each new variable correctly using PROC FREQ (i.e., For PROC FREQ, use the TABLES statement with old variable * new variable/ list missing;). Points will be taken off if you do not include the SAS code used for checking your new variables. Part 2 – analyze your data
1. What percent of the population has a usual source of healthcare?
Bonus question: What percent of the population aged 50 years and older has a usual source of healthcare?
Copy and paste the SAS code from your program (Use /*comments*/ to organize your code)
Data dictionary
Source: https://wwwn.cdc.gov/Nchs/Nhanes/2015-2016/HUQ_I.htm#HUQ030
SPH 281 – Summer session II 2023
Assignment 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help