webuse hanley tabulate disease by disease, sort : tabulate rating graph bar (count), over(rating) by(disease) * cut point 4 for positivity * T+ = rating>=4 * T- = rating< 4 gen test4="NEGATIVE" replace test4="POSITIVE" if rating>=4 tab rating test4 sort rating order test4, after(rating) tabulate test4 disease, column gen test3="NEGATIVE" replace test3="POSITIVE" if rating>=3 tab rating test3 sort rating order test3, before(test4) tabulate test3 disease, column ***** 1) Use the roctab command to obtain descriptive statistics for ROC analysis roctab disease rating roctab disease rating, detail graph ***** 2) Define a new rating newrating = rating + 100 gen newrating=rating+100 ***** Compare the ROC analysis of rating and newrating roctab disease rating roctab disease newrating *** ROC curves are equal because with a constant shift in the *** biomarker values (+100) we obtain the same relative frequencies in *** diseased and non diseased. As a consequence sensitivity and *** specificity will be equal help cutpt cutpt disease rating, noadjust roctab disease rating, graph msymbol(none) addplot(scatteri `e(sens)' `=1 - e(spec)') legend(label(3 "Cutpoint")) **************** confidence interval for prevalence ***************** ci proportions disease, wald display 51/109 display .46788991+1.96*sqrt(.46788991*(1-0.46788991)/109) display .46788991-1.96*sqrt(.46788991*(1-0.46788991)/109) **************** confidence interval for sensitivity***************** tabulate test4 disease, column gen test4_bin=0 replace test4_bin=1 if rating>=4 ci proportions test4_bin if disease==1, wald