
Advanced Statistical Techniques for Complete Case Analysis
Explore the intricacies of complete case analysis through macros and likelihood ratio statistics in statistical modeling. Dive into creating complete case datasets and understanding the implications of missing data on statistical outcomes.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
An example: create a complete case dataset. proc proc contents contents data=s5238.chd5238; run run; proc proc means means data=s5238.chd5238; run run;
Likelihood ratio statistic ods select fitstatistics; proc proc logistic logistic data=s5238.chd5238; model chd10yr(event="1")=age; run run; ods select fitstatistics; proc proc logistic logistic data=s5238.chd5238; model chd10yr(event="1")=age chol; run run;
A closer look ods select fitstatistics nobs; proc proc logistic logistic data=s5238.chd5238; model chd10yr(event="1")=age; run run; ods select fitstatistics nobs; proc proc logistic logistic data=s5238.chd5238; model chd10yr(event="1")=age chol; run run;
Complete Case Analysis data data temp; set s5238.chd5238; where chd10yr ne . . and age ne . . and chol ne . .; ods select fitstatistics nobs; proc proc logistic logistic data=temp; model chd10yr(event="1")=age; run run; ods select fitstatistics nobs; proc proc logistic logistic data=temp; model chd10yr(event="1")=age chol; run run;
Write a macro to create a complete case dataset. Step 1, Hard Code %let vars=age chol currsmok male diab sbp; data data tmp (drop=nummiss); set s5238.chd5238(keep=&vars); nummiss=nmiss(of &vars); if nummiss=0 0; run run;
Decide parameters. %let vars=chd10yr age chol currsmok male diab sbp; data data tmp (drop=nummiss); set s5238.chd5238(keep=&vars); nummiss=nmiss(of &vars); if nummiss=0 0 then output; run run;
The completecase macro %macro %macro completecase(outdat=tmp,indat=,vars=); data &outdat (drop=nummiss); set &indat (keep=&vars); nummiss=nmiss(of &vars); if nummiss=0 0; run; %mend %mend completecase;
Macro Completecase %let vars=chd10yr age chol currsmok male diab sbp; options mprint; %macro %macro completecase(outdat=tmp,indat=,vars=); data &outdat (drop=nummiss); set &indat (keep=&vars); nummiss=nmiss(of &vars); if nummiss=0 0; run; %mend %mend completecase; %completecase completecase(indat=s5238.chd5238,vars=&vars) options nomprint;
Run in new SAS session options mprint; %let vars=chd10yr age chol currsmok male diab sbp; %completecase completecase(indat=s5238.chd5238, vars=&vars) options nomprint;