*********************************************************************** * This is a program that illustrates the use of PROC FREQ in SAS for * * comparing two diagnostic tests based on data from two samples. * ***********************************************************************; proc format; value yesnofmt 1='yes' 2='no'; run; data sensitivity_diag1; input positive count; format positive yesnofmt.; cards; 1 82 2 18 ; run; proc freq data=sensitivity_diag1; tables positive/binomial alpha=0.05; weight count; title "Exact and Asymptotic 95% Confidence Intervals for Sensitivity with Diagnostic Test #1"; run; data sensitivity_diag2; input positive count; format positive yesnofmt.; cards; 1 140 2 60 ; run; proc freq data=sensitivity_diag2; tables positive/binomial alpha=0.05; weight count; title "Exact and Asymptotic 95% Confidence Intervals for Sensitivity with Diagnostic Test #2"; run; data comparison; input test positive count; format positive yesnofmt.; cards; 1 1 82 1 2 18 2 1 140 2 2 60 ; run; proc freq data=comparison; tables positive*test/chisq; exact chisq; weight count; title "Exact and Asymptotic Tests for Comparing Sensitivities"; run;