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 # folder. I. points Merge all five datasets and include every piece of information you have. II points Extract the matches and the nonmatches. 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 : Define a library for the HW folder libname hwC:UsersMichaelDesktopHW ; Step : List all datasets in the hw library to confirm they are accessible proc datasets libraryhw; run; quit; Step : Merge datasets, keeping all information data mergeddata; merge hwallidsina hwanthropometricsinb hwbloodpressureinc hwdemographicsind; by patientid; Step : Convert flags for each dataset if a then hasallids ; else hasallids ; if b then hasanthropometrics ; else hasanthropometrics ; if c then hasbloodpressure ; else hasbloodpressure ; if d then hasdemographics ; else hasdemographics ; run; proc sort datawork.merged data; by medID; run; data mergedDataFinal; merge work.mergeddata hwmedications in e; by medID; if e then hasmedications ; else hasmedications ; run; proc contents datamergedDataFinal; run; proc print datamergedDataFinal; run; proc sql; select count distinct patientid as numpatientswithboth from work.mergedDataFinal where hasanthropometrics and hasbloodpressure ; quit; proc sql; select count distinct patientid as numpatientswithboth from work.mergedDataFinal where hasmedications and hasbloodpressure ; quit; proc sql; select count distinct patientid as numpatientswithallinfo from work.mergedDataFinal where hasanthropometrics and hasbloodpressure and hasmedications and has demographics ; quit; proc sql; select count distinct patientid as numpatientswithnomedications from work.mergedDataFinal where hasmedications ; 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
