Question: For this work: Use these five datasets ( allids , demographics, medications, anthropometrics, and bloodpressure ) in the Homework # 0 4 folder. I. (

For this work: Use these five datasets (allids, demographics, medications, anthropometrics, and bloodpressure) in the Homework #04 folder. I. (3 points) Merge all five datasets and include every piece of information you have. II.(20 points) Extract the matches and the non-matches. a. How many patients has both anthropometrics information and blood pressure information? b. How many patients has both medication information and blood pressure information? c. How many patients has all information in anthropometrics, blood pressure, demographics, and medications? d. How many patients doesnt have medications records? e. How many patients doesnt have anthropometircs information or demographics? Work is to be done in SAS and my codes are: /* Step 1: Define a library for the HW 4 folder */ libname hw4"C:\Users\Michael\Desktop\HW 4"; /* Step 2: List all datasets in the hw4 library to confirm they are accessible */ proc datasets library=hw4; run; quit; /* Step 3: Merge datasets, keeping all information */ data merged_data; merge hw4.allids(in=a) hw4.anthropometrics(in=b) hw4.bloodpressure(in=c) hw4.demographics(in=d); by patient_id; /* Step 4: Convert flags for each dataset */ if a then has_allids =1; else has_allids =0; if b then has_anthropometrics =1; else has_anthropometrics =0; if c then has_bloodpressure =1; else has_bloodpressure =0; if d then has_demographics =1; else has_demographics =0; run; proc sort data=work.merged data; by med_ID; run; data mergedData_Final; merge work.merged_data hw4.medications (in e); by med_ID; if e then has_medications =1; else has_medications =0; run; proc contents data=mergedData_Final; run; proc print data=mergedData_Final; run; proc sql; select count (distinct patient_id) as num_patients_with_both from work.mergedData_Final where has_anthropometrics =1 and has_bloodpressure =1; quit; proc sql; select count (distinct patient_id) as num_patients_with_both from work.mergedData_Final where has_medications =1 and has_bloodpressure =1; quit; proc sql; select count (distinct patient_id) as num_patients_with_all_info from work.mergedData_Final where has_anthropometrics =1 and has_bloodpressure =1 and has_medications =1 and has demographics =1; quit; proc sql; select count (distinct patient_id) as num_patients_with_no_medications from work.mergedData_Final where has_medications =0; quit; check codes and solve for the e

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 Programming Questions!