/* ex3_1.do Example 3.1 programs required binscrn2.ado (v 1.1.0 or later) data required: hpns.dta hypothetical prenatal screening data last update: 20 July 2005 see fig3_1.do for generation of confidence ellipse plot that accompanies this example. */ version 8 set more off cap semt_profile cap log close cap pro drop doit program define doit log using ${semt_log}ex3_1, replace di "{txt} *** Example 3.1 *** di di "{txt} Comparing accuracy with unpaired data" di qui use ${semt_data}hpns,clear qui expand nobs di di " Table 3.3" table arm y d, col di di qui binscrn2 y d arm di "{txt} relative True and False Positive Fractions with 95% CI's " di di "{txt} rFPF(EA,CVS) = {res}" %4.3f r(rfpf) " (" %4.3f `r(rfpf_lb)' "," %4.3f `r(rfpf_ub)' ")" di "{txt} rTPF(EA,CVS) = {res}" %4.3f `r(rtpf)' " (" %4.3f `r(rtpf_lb)' "," %4.3f `r(rtpf_ub)' ")" di di "{txt} {ul:joint} 95% conf. region for rFPF x rTPF:{res} (" %4.3f `r(rfpfj_lb)' "," /// %4.3f `r(rfpfj_ub)' ") x (" %4.3f `r(rtpfj_lb)' "," %4.3f `r(rtpfj_ub)' ")" di di "******************************** di qui binscrn2 y d arm, level(90) di "{txt} relative Negative and Positive Predictive Values with 90% CI's " di di "{txt} rNPV(EA,CVS) = {res}" %4.3f r(rnpv) " (" %4.3f `r(rnpv_lb)' "," %4.3f `r(rnpv_ub)' ")" di "{txt} rPPV(EA,CVS) = {res}" %4.3f `r(rppv)' " (" %4.3f `r(rppv_lb)' "," %4.3f `r(rppv_ub)' ")" di di "{txt} {ul:joint} 90% conf. region for rNPV x rPPV:{res} (" %4.3f `r(rnpvj_lb)' "," /// %4.3f `r(rnpvj_ub)' ") x (" %4.3f `r(rppvj_lb)' "," %4.3f `r(rppvj_ub)' ")" di di "******************************** di qui binscrn2 y d arm di "{txt} relative Negative and Positive Diagnostic Likelihood Ratios with 95% CI's " di di "{txt} rDLR+(EA,CVS) = {res}" %4.3f r(rdlrp) " (" %4.3f `r(rdlrp_lb)' "," %4.3f `r(rdlrp_ub)' ")" di "{txt} rDLR-(EA,CVS) = {res}" %4.3f r(rdlrn) " (" %4.3f `r(rdlrn_lb)' "," %4.3f `r(rdlrn_ub)' ")" di di "{txt} see fig3_1.do for generation elliptical confidence region for the joint [ln(rDLR+), ln(rDLR-)] di qui log close end ******************* doit