Diagnostic Uncertainty

A software tool for calculating the uncertainty of diagnostic accuracy measures

Theodora Chatzimichail, MD  
tc@hcsl.com
Aristides T. Hatjimihail, MD, PhD
 ath@hcsl.com

Hellenic Complex Systems Laboratory, Kostis Palamas 21, 66131 Drama, Greece.

Clear["`*"];
Off[General::stop];
Needs["HypothesisTesting`"]
mcsns[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=1-(1/2) Erfc[(mD-t)/(√2 sD)];
cmcsns[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(√(((E^(-((((mD-t))^2)/(sD^2)))) ((((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2))+(sD^2) ((sD^2)/nD+(u^2))))/(sD^4)))/(√(2 π))
dfsns[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[(((((((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2))+(sD^2) (((sD^2)/nD)+(u^2))))^2)/(((((((sD^4)/nD)+(((sD^2) (((mD-t))^2))/(2 (-1+nD)))))^2)/(-2+nD+nH))+((((((mD^2)+(sD^2)-2 mD t+(t^2)))^2) (u^4))/(-1+nU)))),If[u>0,Min[nD-1,nU-1],nD-1]],If[u>0,nD+nU-2,nD-1]]
mcspc[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=(1/2) Erfc[(mH-t)/(√2 sH)];
cmcspc[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(√(((E^(-((((mH-t))^2)/(sH^2)))) ((((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2))+(sH^2) ((sH^2)/nH+(u^2))))/(sH^4)))/(√(2 π))
dfspc[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[(((((((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2))+(sH^2) (((sH^2)/nH)+(u^2))))^2)/(((((((sH^4)/nH)+(((sH^2) (((mH-t))^2))/(2 (-1+nH)))))^2)/(-2+nD+nH))+((((((mH^2)+(sH^2)-2 mH t+(t^2)))^2) (u^4))/(-1+nU)))),If[u>0,Min[nH-1,nU-1],nH-1]],If[u>0,nH+nU-2,nH-1]]
mcoda[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=(nD+nD Erf[(mD-t)/(√2 sD)]+nH Erfc[(mH-t)/(√2 sH)])/(2 (nD+nH))
cmcoda[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/2) √((1/(((nD+nH))^2))((2 (E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)))/(π (sD^4))+(2 (E^(-((((mH-t))^2)/(sH^2)))) (nH^2) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)))/(π (sH^4))+(2 (E^(-((((mD-t))^2)/(sD^2)))) nD ((sD^2)+nD (u^2)))/(π (sD^2))+(2 (E^(-((((mH-t))^2)/(sH^2)))) nH ((sH^2)+nH (u^2)))/(π (sH^2))+((2+nD) (2+nH) (nD+nH) (((-2+Erfc[(mD-t)/(√2 sD)]+Erfc[(mH-t)/(√2 sH)]))^2))/(((4+nD+nH))^2)))
dfoda[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[(((((2 (E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)))/(π (sD^4)))+((2 (E^(-((((mH-t))^2)/(sH^2)))) (nH^2) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)))/(π (sH^4)))+((2 (E^(-((((mD-t))^2)/(sD^2)))) nD ((sD^2)+nD (u^2)))/(π (sD^2)))+((2 (E^(-((((mH-t))^2)/(sH^2)))) nH ((sH^2)+nH (u^2)))/(π (sH^2)))+(((2+nD) (2+nH) (nD+nH) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2))/(((4+nD+nH))^2))))^2)/((1/((-1+nU) (π^2) (sD^8) (sH^8)))4 (E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) ((((E^((((mH-t))^2)/(sH^2))) (nD^2) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2))+(E^((((mD-t))^2)/(sD^2))) (nH^2) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2))))^2) (u^4)+(1/(-2+nD+nH))(((((2 (E^(-((((mD-t))^2)/(sD^2)))) nD)/π)+((2 (E^(-((((mH-t))^2)/(sH^2)))) nH)/π)+(((E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (((mD-t))^2))/((-1+nD) π (sD^2)))+(((E^(-((((mH-t))^2)/(sH^2)))) (nH^2) (((mH-t))^2))/((-1+nH) π (sH^2)))+(((2+nD) (2+nH) (nD+nH) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2))/(((4+nD+nH))^2))))^2)),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,2nD+2nH+nU,2nD+2nH+1]]
mcppv[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=
(nD (1+Erf[(mD-t)/(√2 sD)]))/(nD+nH+nD Erf[(mD-t)/(√2 sD)]+nH Erf[(mH-t)/(√2 sH)])
cmcppv[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/(√π))(√(((E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (nH^2) (((4+nD+nH))^2) (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2)+2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (-1+nH) nH (((4+nD+nH))^2) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2)+(E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (-1+nH) (nH^2) (((4+nD+nH))^2) (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[(mH-t)/(√2 sH)]))^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) nD (-1+nH) (nH^2) (((4+nD+nH))^2) (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[(mH-t)/(√2 sH)]))^2)+(-1+nD) (2+nD) (-1+nH) (2+nH) (((nD+nH))^3) π (sD^4) (sH^4) (((-2+Erfc[(mD-t)/(√2 sD)]))^2) (((-2+Erfc[(mH-t)/(√2 sH)]))^2))/((-1+nD) (-1+nH) (((4+nD+nH))^2) (sD^4) (sH^4) (((-2 (nD+nH)+nD Erfc[(mD-t)/(√2 sD)]+nH Erfc[(mH-t)/(√2 sH)]))^4))))
dfppv[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[-(((-2+nD+nH) (-1+nU) ((((E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (nH^2) (((4+nD+nH))^2) (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (-1+nH) nH (((4+nD+nH))^2) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+(E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (-1+nH) (nH^2) (((4+nD+nH))^2) (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) nD (-1+nH) (nH^2) (((4+nD+nH))^2) (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)+(-1+nD) (2+nD) (-1+nH) (2+nH) (((nD+nH))^3) π (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)))^2))/((nD^2) (2-nD-nH) (nH^2) (((4+nD+nH))^4) (((2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (sH^2) (((mH-t))^2) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)-(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)-2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^4) (sH^4) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)+(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sD^2) (sH^4) (((mD-t))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)-(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)-2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)))^2)+(1-nU) (((2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (-1+nH) nH (((4+nD+nH))^2) (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) (nD^2) (nH^2) (((4+nD+nH))^2) (sD^4) (sH^2) (((mH-t))^2) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) nD (-1+nH) (nH^2) (((4+nD+nH))^2) (sD^4) (sH^4) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)+(E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (-1+nH) (nH^2) (((4+nD+nH))^2) (sD^2) (sH^4) (((mD-t))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)+(-1+nD) (2+nD) (-1+nH) (2+nH) (((nD+nH))^3) π (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2)))^2))),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,2nD+2nH+nU,2nD+2nH+1]]
mcnpv[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=1/(1+(nD Erfc[(mD-t)/(√2 sD)])/(nH Erfc[(mH-t)/(√2 sH)]))
cmcnpv[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=√((((E^(-((((mH-t))^2)/(sH^2)))) (nD^2) (nH^2) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/((-1+nH) π (sH^4))+(2 (E^(-((((mH-t))^2)/(sH^2)))) (nD^2) nH ((sH^2)+nH (u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/(π (sH^2))+((E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (nH^2) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/((-1+nD) π (sD^4))+(2 (E^(-((((mD-t))^2)/(sD^2)))) nD (nH^2) ((sD^2)+nD (u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/(π (sD^2))+((2+nD) (2+nH) (((nD+nH))^3) ((Erfc[(mD-t)/(√2 sD)])^2) ((Erfc[(mH-t)/(√2 sH)])^2))/(((4+nD+nH))^2))/(((nD Erfc[(mD-t)/(√2 sD)]+nH Erfc[(mH-t)/(√2 sH)]))^4))
dfnpv[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mH-t))^2)/(sH^2)))) (nD^2) (nH^2) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/((-1+nH) π (sH^4)))+((2 (E^(-((((mH-t))^2)/(sH^2)))) (nD^2) nH ((sH^2)+nH (u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(π (sH^2)))+(((E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (nH^2) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/((-1+nD) π (sD^4)))+((2 (E^(-((((mD-t))^2)/(sD^2)))) nD (nH^2) ((sD^2)+nD (u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(π (sD^2)))+(((2+nD) (2+nH) (((nD+nH))^3) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(((4+nD+nH))^2))))^2)/((1/((-1+nU) (π^2) (sD^8) (sH^8)))4 (E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) (nD^4) (nH^4) (u^4) ((((E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2)+(1/(-2+nD+nH))(((((2 (E^(-((((mH-t))^2)/(sH^2)))) (nD^2) nH ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/π)+(((E^(-((((mH-t))^2)/(sH^2)))) (nD^2) (nH^2) (((mH-t))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/((-1+nH) π (sH^2)))+((2 (E^(-((((mD-t))^2)/(sD^2)))) nD (nH^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/π)+(((E^(-((((mD-t))^2)/(sD^2)))) (nD^2) (nH^2) (((mD-t))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/((-1+nD) π (sD^2)))+(((2+nD) (2+nH) (((nD+nH))^3) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(((4+nD+nH))^2))))^2)),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,2nD+2nH+nU,2nD+2nH+1]]
mcdor[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=((-2+Erfc[(mD-t)/(√2 sD)]) Erfc[(mH-t)/(√2 sH)])/(Erfc[(mD-t)/(√2 sD)] (-2+Erfc[(mH-t)/(√2 sH)]))
cmcdor[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/(√π))2 √(((E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2) ((Erfc[(mD-t)/(√2 sD)])^2)+2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2) ((Erfc[(mD-t)/(√2 sD)])^2)+(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[(mH-t)/(√2 sH)]))^2) ((Erfc[(mH-t)/(√2 sH)])^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[(mH-t)/(√2 sH)]))^2) ((Erfc[(mH-t)/(√2 sH)])^2))/((-1+nD) nD (-1+nH) nH (sD^4) (sH^4) ((Erfc[(mD-t)/(√2 sD)])^4) (((-2+Erfc[(mH-t)/(√2 sH)]))^4)))
dfdor[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[-(((-2+nD+nH) (-1+nU) ((((E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2))/((1-nU) (((2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (sH^2) (((mH-t))^2) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^4) (sH^4) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)+(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sD^2) (sH^4) (((mD-t))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2)+(2-nD-nH) (((2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^4) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (sH^2) (((mH-t))^2) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)-(E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD nH (sD^4) (((mH-t))^2) ((sH^2)+2 (-1+nH) (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)-2 (E^(-((((mH-t))^2)/(sH^2)))) (-1+nD) nD (-1+nH) (sD^4) (sH^2) ((sH^2)+nH (u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^4) (sH^4) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)+(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sD^2) (sH^4) (((mD-t))^2) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)-(E^(-((((mD-t))^2)/(sD^2)))) nD (-1+nH) nH (sH^4) (((mD-t))^2) ((sD^2)+2 (-1+nD) (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)-2 (E^(-((((mD-t))^2)/(sD^2)))) (-1+nD) (-1+nH) nH (sD^2) (sH^4) ((sD^2)+nD (u^2)) (((-2+Erfc[((mH-t)/((Sqrt[2]) sH))]))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2))),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,nD+nH+nU-3, nD+nH-2]]
mcplr[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=
(1+Erf[(mD-t)/(√2 sD)])/(1+Erf[(mH-t)/(√2 sH)])
cmcplr[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=√(2/π) √((1/(((1+Erf[(mH-t)/(√2 sH)]))^4))(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)) (((1+Erf[(mD-t)/(√2 sD)]))^2))/(sH^4)+((E^(-((((mH-t))^2)/(sH^2)))) ((sH^2)/nH+(u^2)) (((1+Erf[(mD-t)/(√2 sD)]))^2))/(sH^2)+((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)) (((1+Erf[(mH-t)/(√2 sH)]))^2))/(sD^4)+((E^(-((((mD-t))^2)/(sD^2)))) ((sD^2)/nD+(u^2)) (((1+Erf[(mH-t)/(√2 sH)]))^2))/(sD^2)))
dfplr[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)) (((1+Erf[((mD-t)/((Sqrt[2]) sD))]))^2))/(sH^4))+(((E^(-((((mH-t))^2)/(sH^2)))) (((sH^2)/nH)+(u^2)) (((1+Erf[((mD-t)/((Sqrt[2]) sD))]))^2))/(sH^2))+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(sD^4))+(((E^(-((((mD-t))^2)/(sD^2)))) (((sD^2)/nD)+(u^2)) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(sD^2))))^2)/((1/((-1+nU) (sD^8) (sH^8)))(E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) (u^4) ((((E^((((mD-t))^2)/(sD^2))) (mH^2) (sD^4)+(E^((((mD-t))^2)/(sD^2))) (sD^4) (sH^2)+(E^((((mH-t))^2)/(sH^2))) (mD^2) (sH^4)+(E^((((mH-t))^2)/(sH^2))) (sD^2) (sH^4)-2 (E^((((mD-t))^2)/(sD^2))) mH (sD^4) t-2 (E^((((mH-t))^2)/(sH^2))) mD (sH^4) t+(E^((((mD-t))^2)/(sD^2))) (sD^4) (t^2)+(E^((((mH-t))^2)/(sH^2))) (sH^4) (t^2)+2 (E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) Erf[((mD-t)/((Sqrt[2]) sD))]+(E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) ((Erf[((mD-t)/((Sqrt[2]) sD))])^2)+2 (E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) Erf[((mH-t)/((Sqrt[2]) sH))]+(E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) ((Erf[((mH-t)/((Sqrt[2]) sH))])^2)))^2)+(1/(-2+nD+nH))((((((E^(-((((mH-t))^2)/(sH^2)))) (((1+Erf[((mD-t)/((Sqrt[2]) sD))]))^2))/nH)+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((1+Erf[((mD-t)/((Sqrt[2]) sD))]))^2))/(2 (-1+nH) (sH^2)))+(((E^(-((((mD-t))^2)/(sD^2)))) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/nD)+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(2 (-1+nD) (sD^2)))))^2)),Min[nD-1,nH-1,nU-1]],2nD+2nH+nU]
mcnlr[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=Erfc[(mD-t)/(√2 sD)]/Erfc[(mH-t)/(√2 sH)]
cmcnlr[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=√(2/π) √((1/((Erfc[(mH-t)/(√2 sH)])^4))(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/(sH^4)+((E^(-((((mH-t))^2)/(sH^2)))) ((sH^2)/nH+(u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/(sH^2)+((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/(sD^4)+((E^(-((((mD-t))^2)/(sD^2)))) ((sD^2)/nD+(u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/(sD^2)))
dfnlr[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(sH^4))+(((E^(-((((mH-t))^2)/(sH^2)))) (((sH^2)/nH)+(u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(sH^2))+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(sD^4))+(((E^(-((((mD-t))^2)/(sD^2)))) (((sD^2)/nD)+(u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(sD^2))))^2)/((1/(-2+nD+nH))((((((E^(-((((mH-t))^2)/(sH^2)))) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/nH)+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(2 (-1+nH) (sH^2)))+(((E^(-((((mD-t))^2)/(sD^2)))) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/nD)+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(2 (-1+nD) (sD^2)))))^2)+(1/((-1+nU) (sD^8) (sH^8)))(E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) (u^4) ((((E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2)),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,nD+nH+nU-3, nD+nH-2]]

mcyi[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=(1/2) (Erf[(mD-t)/(√2 sD)]-Erf[(mH-t)/(√2 sH)])
cmcyi[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/(√(2 π)))(√(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)))/(sD^4)+((E^(-((((mD-t))^2)/(sD^2)))) ((sD^2)/nD+(u^2)))/(sD^2)+((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)))/(sH^4)+((E^(-((((mH-t))^2)/(sH^2)))) ((sH^2)/nH+(u^2)))/(sH^2)))
dfyi[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)))/(sD^4))+(((E^(-((((mD-t))^2)/(sD^2)))) (((sD^2)/nD)+(u^2)))/(sD^2))+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)))/(sH^4))+(((E^(-((((mH-t))^2)/(sH^2)))) (((sH^2)/nH)+(u^2)))/(sH^2))))^2)/(((((((E^(-((((mD-t))^2)/(sD^2))))/nD)+((E^(-((((mH-t))^2)/(sH^2))))/nH)+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2))/(2 (-1+nD) (sD^2)))+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2))/(2 (-1+nH) (sH^2)))))^2)/(-2+nD+nH))+(1/((-1+nU) (sD^8) (sH^8)))(E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) ((((E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2))+(E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2))))^2) (u^4)),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,nD+nH+nU-3, nD+nH-2]]
mced[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=(1/2) √((((1+Erf[(mH-t)/(√2 sH)]))^2)+((Erfc[(mD-t)/(√2 sD)])^2))
cmced[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/(√(2 π)))(√((((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)) (((1+Erf[(mH-t)/(√2 sH)]))^2))/(sH^4)+((E^(-((((mH-t))^2)/(sH^2)))) ((sH^2)/nH+(u^2)) (((1+Erf[(mH-t)/(√2 sH)]))^2))/(sH^2)+((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/(sD^4)+((E^(-((((mD-t))^2)/(sD^2)))) ((sD^2)/nD+(u^2)) ((Erfc[(mD-t)/(√2 sD)])^2))/(sD^2))/((((1+Erf[(mH-t)/(√2 sH)]))^2)+((Erfc[(mD-t)/(√2 sD)])^2))))
dfed[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(sH^4))+(((E^(-((((mH-t))^2)/(sH^2)))) (((sH^2)/nH)+(u^2)) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(sH^2))+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(sD^4))+(((E^(-((((mD-t))^2)/(sD^2)))) (((sD^2)/nD)+(u^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(sD^2))))^2)/(((((((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2)+((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)))^2) (((((((E^(-((((mH-t))^2)/(sH^2)))) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/nH)+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2))/(2 (-1+nH) (sH^2)))+(((E^(-((((mD-t))^2)/(sD^2)))) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/nD)+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2))/(2 (-1+nD) (sD^2)))))^2)/((-2+nD+nH) ((((((1+Erf[((mH-t)/((Sqrt[2]) sH))]))^2)+((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)))^2))+((E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) (u^4) ((((E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2))+2 (E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) Erf[((mH-t)/((Sqrt[2]) sH))]+(E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) ((Erf[((mH-t)/((Sqrt[2]) sH))])^2)+(E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)))^2))/((-1+nU) (sD^8) (sH^8) (((1+2 Erf[((mH-t)/((Sqrt[2]) sH))]+((Erf[((mH-t)/((Sqrt[2]) sH))])^2)+((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)))^2)))),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,nD+nH+nU-3, nD+nH-2]]
mccz[t_,mD_,mH_,sD_,sH_,nD_,nH_]:=-(1/4) (-2+Erfc[(mD-t)/(√2 sD)]) Erfc[(mH-t)/(√2 sH)]

cmccz[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=(1/(2 √(2 π)))(√(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) ((sH^2)/(2 (-1+nH))+(u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2))/(sH^4)+((E^(-((((mH-t))^2)/(sH^2)))) ((sH^2)/nH+(u^2)) (((-2+Erfc[(mD-t)/(√2 sD)]))^2))/(sH^2)+((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((sD^2)/(2 (-1+nD))+(u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/(sD^4)+((E^(-((((mD-t))^2)/(sD^2)))) ((sD^2)/nD+(u^2)) ((Erfc[(mH-t)/(√2 sH)])^2))/(sD^2)))
dfcz[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=Min[Max[((((((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((sH^2)/(2 (-1+nH)))+(u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2))/(sH^4))+(((E^(-((((mH-t))^2)/(sH^2)))) (((sH^2)/nH)+(u^2)) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2))/(sH^2))+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) (((sD^2)/(2 (-1+nD)))+(u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(sD^4))+(((E^(-((((mD-t))^2)/(sD^2)))) (((sD^2)/nD)+(u^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(sD^2))))^2)/((1/(-2+nD+nH))((((((E^(-((((mH-t))^2)/(sH^2)))) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2))/nH)+(((E^(-((((mH-t))^2)/(sH^2)))) (((mH-t))^2) (((-2+Erfc[((mD-t)/((Sqrt[2]) sD))]))^2))/(2 (-1+nH) (sH^2)))+(((E^(-((((mD-t))^2)/(sD^2)))) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/nD)+(((E^(-((((mD-t))^2)/(sD^2)))) (((mD-t))^2) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2))/(2 (-1+nD) (sD^2)))))^2)+(1/((-1+nU) (sD^8) (sH^8)))(E^(-((2 (((mD-t))^2))/(sD^2))-((2 (((mH-t))^2))/(sH^2)))) (u^4) (((4 (E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2))-4 (E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) Erfc[((mD-t)/((Sqrt[2]) sD))]+(E^((((mD-t))^2)/(sD^2))) (sD^4) ((mH^2)+(sH^2)-2 mH t+(t^2)) ((Erfc[((mD-t)/((Sqrt[2]) sD))])^2)+(E^((((mH-t))^2)/(sH^2))) (sH^4) ((mD^2)+(sD^2)-2 mD t+(t^2)) ((Erfc[((mH-t)/((Sqrt[2]) sH))])^2)))^2)),If[u>0,Min[nD-1,nH-1,nU-1],Min[nD-1,nH-1]]],If[u>0,nD+nH+nU-3, nD+nH-2]]
studentTCI[m_,s_,d_,p_]:=If[m∈Reals&&s∈Reals&&s>0&&d∈Reals&&d>0&&p<1&&p>0&&StudentTCI[m,s,d,ConfidenceLevel->p][[1]]∈Reals&& StudentTCI[m,s,d,ConfidenceLevel->p][[2]]∈Reals,StudentTCI[m,s,d,ConfidenceLevel->p],{Indeterminate,Indeterminate}];
mu[t_,mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=
If[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH}∈Reals&&c[mf]@@{t,mD,mH,sD,sH,u,nD,nH}>=0 &&c[mf]@@{t,mD,mH,sD,sH,0,nD,nH}∈Reals&&c[mf]@@{t,mD,mH,sD,sH,0,nD,nH}>=0 ,{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0],√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2)),Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]},{Indeterminate,Indeterminate,Indeterminate},{Indeterminate,Indeterminate,Indeterminate}];
mru[t_,mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=
If[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH}∈Reals&&c[mf]@@{t,mD,mH,sD,sH,u,nD,nH}>=0 &&c[mf]@@{t,mD,mH,sD,sH,0,nD,nH}∈Reals&&c[mf]@@{t,mD,mH,sD,sH,0,nD,nH}>=0&&d[mf]@@{t,mD,mH,sD,sH,nD,nH}∈Reals&&d[mf]@@{t,mD,mH,sD,sH,nD,nH}>=0,{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH},(√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2)))/d[mf]@@{t,mD,mH,sD,sH,nD,nH},Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH}},{Indeterminate,Indeterminate,Indeterminate},{Indeterminate,Indeterminate,Indeterminate}];
mci[t_,p_,mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=
If[d[mf]@@{t,mD,mH,sD,sH,nD,nH}∈Reals&&d[mf]@@{t,mD,mH,sD,sH,nD,nH}>=0 ,{If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1]],
If[mf==dor|| mf==plr||mf==nlr,d[mf]@@{t,mD,mH,sD,sH,nD,nH},Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1],Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1]],If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1]]},{Indeterminate,Indeterminate,Indeterminate},{Indeterminate,Indeterminate,Indeterminate}];
pci[p_,mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_,pr_]:=Text@Labeled[Quiet[Plot[{If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1]],
If[d[mf]@@{t,mD,mH,sD,sH,nD,nH}∈Reals&&d[mf]@@{t,mD,mH,sD,sH,nD,nH}>=0 ,If[mf==dor|| mf==plr||mf==nlr,d[mf]@@{t,mD,mH,sD,sH,nD,nH},Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1],Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1]],Indeterminate],If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1]]},{t,lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH]},Exclusions->"Singularities",AspectRatio->1,AxesLabel->{"d",txt[mf]},PlotStyle->{ColorData["HTML","SlateBlue"], {RGBColor[1,.47,0],Thick},ColorData["HTML","Green"]},PlotLegends->Placed[{"lower bound","point estimation","upper bound"},Bottom], ImageSize->Automatic]], Column[{ToString[NumberForm[N[100 p],{4,2}]]<>" % confidence intervals of "<>ltxt[mf]<>" ("<>txt[mf]<>")","versus diagnostic threshold (d) curves"},Center],Top]
lpci[p_,mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_,pr_]:=Text@Labeled[ListLinePlot[Table[Quiet[Table[{t,mci[t,p,mf,mD,mH,sD,sH,u,nD,nH,nU][[i]]},{t,lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],0.1}]],{i,1,3}],AspectRatio->1,AxesLabel->{"d",txt[mf]},PlotStyle->{ColorData["HTML","SlateBlue"],{ RGBColor[1,.47,0],Thick},ColorData["HTML","Green"]},PlotLegends->Placed[{"lower bound","point estimation","upper bound"},Bottom], ImageSize->Automatic], Column[{ToString[NumberForm[N[100 p],{4,2}]]<>" % confidence intervals of "<>ltxt[mf]<>" ("<>txt[mf]<>")","versus diagnostic threshold (d) curves"},Center],Top]
pu[mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0],√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2)),Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]},{t,lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{lb[pr,mD,mH,sD,sH],0}, AxesLabel->{"d","u("<>txt[mf]<>")"},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> "))","versus diagnostic threshold (d) curves"},Center],Top]
pru[mf_,mD_,mH_,sD_,sH_,u_,nD_,nH_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH},(√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2)))/d[mf]@@{t,mD,mH,sD,sH,nD,nH},Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH}},{t,lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{lb[pr,mD,mH,sD,sH],0}, AxesLabel->{"d","u("<>txt[mf]<>")/"<>txt[mf]},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"relative standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> ")/"<>txt[mf]<>")","versus diagnostic threshold (d) curves"},Center],Top]
pun[mf_,t_,mD_,mH_,sD_,sH_,u_,r_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,n r, n(1-r)},0],√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,n r, n(1-r)},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,n r, n(1-r)},0])^2)),Max[c[mf]@@{t,mD,mH,sD,sH,0,n r, n(1-r)},0]},{n,Max[Ceiling[2/r],Ceiling[2/(1-r)],20],Switch[pr,True,Max[10 Ceiling[2/r],10 Ceiling[2/(1-r)],10000],False,Max[5Ceiling[2/r],5Ceiling[2/(1-r)],5000]]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{Max[Ceiling[2/r],Ceiling[2/(1-r)],20],0}, AxesLabel->{"n","u("<>txt[mf]<>")"},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> "))","versus total population sample size (n) curves"},Center],Top]
prun[mf_,t_,mD_,mH_,sD_,sH_,u_,r_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,n r, n(1-r)},0]/d[mf]@@{t,mD,mH,sD,sH,n r, n(1-r)},(√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,n r, n(1-r)},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,n r, n(1-r)},0])^2)))/d[mf]@@{t,mD,mH,sD,sH,n r, n(1-r)},Max[c[mf]@@{t,mD,mH,sD,sH,0,n r, n(1-r)},0]/d[mf]@@{t,mD,mH,sD,sH,n r, n(1-r)}},{n,Max[Ceiling[2/r],Ceiling[2/(1-r)],20],Switch[pr,True,Max[10 Ceiling[2/r],10 Ceiling[2/(1-r)],10000],False,Max[5Ceiling[2/r],5Ceiling[2/(1-r)],5000]]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{Max[Ceiling[2/r],Ceiling[2/(1-r)],20],0}, AxesLabel->{"n","u("<>txt[mf]<>")/"<>txt[mf]},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"relative standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> ")/"<>txt[mf]<>")","versus total population sample size (n) curves"},Center],Top]
puu[mf_,t_,mD_,mH_,sD_,sH_,nD_,nH_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0],√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2)),Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]},{u,0,Switch[pr,True,0.5sH,False,0.15 sH]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{0,0}, AxesLabel->{"(Subscript[u, m])","u("<>txt[mf]<>")"},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> "))","versus measurement uncertainy ((Subscript[u, m])) curves"},Center],Top]
pruu[mf_,t_,mD_,mH_,sD_,sH_,nD_,nH_,pr_]:=Text@Labeled[Quiet[Plot[{Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH},√(((Max[c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},0])^2)-((Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0])^2))/d[mf]@@{t,mD,mH,sD,sH,nD,nH},Max[c[mf]@@{t,mD,mH,sD,sH,0,nD,nH},0]/d[mf]@@{t,mD,mH,sD,sH,nD,nH}},{u,0,Switch[pr,True,0.5sH,False,0.15 sH]},Exclusions->"Singularities",AspectRatio->1,AxesOrigin->{0,0}, AxesLabel->{"(Subscript[u, m])","u("<>txt[mf]<>")/"<>txt[mf]},PlotStyle->{ RGBColor[1,.47,0],{ColorData["HTML","SlateBlue"],Dashing[{Large,Small}]},{ColorData["HTML","Green"],Dashing[{Large,Small}]}},PlotLegends->Placed[{"combined","measurement","sampling"},Bottom], ImageSize->Automatic]],Column[{"relative standard uncertainty of "<>ltxt[mf]<> " (u("<>txt[mf]<> ")/"<>txt[mf]<>")","versus measurement uncertainy ((Subscript[u, m])) curves"},Center],Top]
pcin[p_,mf_,t_,mD_,mH_,sD_,sH_,u_,r_,nU_,pr_]:=Text@Labeled[Quiet[Plot[{If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[1]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[1]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[1]],0],1]],
If[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n}∈Reals&&d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n}>=0 ,If[mf==dor|| mf==plr||mf==nlr,d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},Min[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},1],Min[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},1]],Indeterminate],If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[2]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[2]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,r n, (1-r)n},c[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n},df[mf]@@{t,mD,mH,sD,sH,u,r n, (1-r)n,nU},p][[2]],0],1]]},{n,Max[Ceiling[2/r],Ceiling[2/(1-r)],20],Switch[pr,True,Max[10 Ceiling[2/r],10 Ceiling[2/(1-r)],10000],False,Max[5Ceiling[2/r],5Ceiling[2/(1-r)],5000]]},Exclusions->"Singularities",AspectRatio->1,AxesLabel->{"n",txt[mf]},PlotStyle->{ColorData["HTML","SlateBlue"], {RGBColor[1,.47,0],Thick},ColorData["HTML","Green"]},PlotLegends->Placed[{"lower bound","point estimation","upper bound"},Bottom], ImageSize->Automatic]], Column[{ToString[NumberForm[N[100 p],{4,2}]]<>" % confidence intervals of "<>ltxt[mf]<>" ("<>txt[mf]<>")","versus total population sample size (n) curves"},Center],Top]
pciu[p_,mf_,t_,mD_,mH_,sD_,sH_,nD_,nH_,nU_,pr_]:=Text@Labeled[Quiet[Plot[{If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[1]],0],1]],
If[d[mf]@@{t,mD,mH,sD,sH,nD,nH}∈Reals&&d[mf]@@{t,mD,mH,sD,sH,nD,nH}>=0 ,If[mf==dor|| mf==plr||mf==nlr,d[mf]@@{t,mD,mH,sD,sH,nD,nH},Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1],Min[d[mf]@@{t,mD,mH,sD,sH,nD,nH},1]],Indeterminate],If[mf==dor|| mf==plr||mf==nlr,Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1],Min[Max[studentTCI[d[mf]@@{t,mD,mH,sD,sH,nD,nH},c[mf]@@{t,mD,mH,sD,sH,u,nD,nH},df[mf]@@{t,mD,mH,sD,sH,u,nD,nH,nU},p][[2]],0],1]]},{u,0,Switch[pr,True,0.5sH,False,0.15 sH]},Exclusions->"Singularities",AspectRatio->1,AxesLabel->{"(Subscript[u, m])",txt[mf]},PlotStyle->{ColorData["HTML","SlateBlue"], {RGBColor[1,.47,0],Thick},ColorData["HTML","Green"]},PlotLegends->Placed[{"lower bound","point estimation","upper bound"},Bottom], ImageSize->Automatic]], Column[{ToString[NumberForm[N[100 p],{4,2}]]<>" % confidence intervals of "<>ltxt[mf]<>" ("<>txt[mf]<>")","versus measurement uncertainty ((Subscript[u, m])) curves"},Center],Top]
tru[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=
Text@Grid[Quiet[Transpose[
{{Style["diagnostic accuracy measures: relative standard uncertainties",Bold],Style["diagnostic accuracy measures",Bold],"sensitivity","specificity","overall diagnostic accuracy","positive predictive value", "negative predictive value", "diagnostic odds ratio", "likelihood ratio for a positive result","likelihood ratio for a negative result","Youden's index","Euclidean distance","concordance probability"},
{SpanFromLeft,SpanFromLeft,"Se","Sp","ODA","PPV", "NPV", "DOR", "LR+","LR-","J","ED","CZ"},
{SpanFromLeft,
Style["combined",Bold],
NumberForm[N@mru[t,sns,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,spc,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,oda,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,ppv,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,npv,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,dor,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,plr,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,nlr,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,yi,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,ed,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mru[t,cz,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}]},
{SpanFromLeft,
Style["measurement",Bold],
NumberForm[N@mru[t,sns,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,spc,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,oda,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,ppv,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,npv,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,dor,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,plr,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,nlr,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,yi,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,ed,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mru[t,cz,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}]},
{SpanFromLeft,
Style["sampling",Bold],
NumberForm[N@mru[t,sns,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,spc,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,oda,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,ppv,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,npv,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,dor,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,plr,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,nlr,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,yi,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,ed,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mru[t,cz,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}]}}]],
Frame->All, FrameStyle->Blend[{Blue,Cyan},0.35],Spacings->{1,1},ItemSize->Automatic]
tu[t_,mD_,mH_,sD_,sH_,u_,nD_,nH_]:=
Text@Grid[Quiet[Transpose[
{{Style["diagnostic accuracy measures: standard uncertainties",Bold],Style["diagnostic accuracy measures",Bold],"sensitivity","specificity","overall diagnostic accuracy","positive predictive value", "negative predictive value", "diagnostic odds ratio", "likelihood ratio for a positive result","likelihood ratio for a negative result","Youden's index","Euclidean distance","concordance probability"},
{SpanFromLeft,SpanFromLeft,"Se","Sp","ODA","PPV", "NPV", "DOR", "LR+","LR-","J","ED","CZ"},
{SpanFromLeft,
Style["combined",Bold],
NumberForm[N@mu[t,sns,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,spc,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,oda,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,ppv,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,npv,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,dor,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,plr,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,nlr,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,yi,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,ed,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}],
NumberForm[N@mu[t,cz,mD,mH,sD,sH,u,nD,nH][[1]],{10,6}]},
{SpanFromLeft,
Style["measurement",Bold],
NumberForm[N@mu[t,sns,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,spc,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,oda,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,ppv,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,npv,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,dor,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,plr,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,nlr,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,yi,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,ed,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}],
NumberForm[N@mu[t,cz,mD,mH,sD,sH,u,nD,nH][[2]],{10,6}]},
{SpanFromLeft,
Style["sampling",Bold],
NumberForm[N@mu[t,sns,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,spc,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,oda,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,ppv,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,npv,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,dor,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,plr,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,nlr,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,yi,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,ed,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}],
NumberForm[N@mu[t,cz,mD,mH,sD,sH,u,nD,nH][[3]],{10,6}]}}]],
Frame->All, FrameStyle->Blend[{Blue,Cyan},0.35],Spacings->{1,1},ItemSize->Automatic]
tci[t_,p_,mD_,mH_,sD_,sH_,u_,nD_,nH_,nU_]:=
Text@Grid[Quiet[Transpose[
{{Style[Style[StringJoin["diagnostic accuracy measures: ",ToString[NumberForm[N[100 p],{4,2}]], "% confidence intervals"]],Bold],Style["diagnostic accuracy measures",Bold],"sensitivity","specificity","overall diagnostic accuracy","positive predictive value", "negative predictive value", "diagnostic odds ratio", "likelihood ratio for a positive result","likelihood ratio for a negative result","Youden's index","Euclidean distance","concordance probability"},
{SpanFromLeft,SpanFromLeft,"Se","Sp","ODA","PPV", "NPV", "DOR", "LR+","LR-","J","ED","CZ"},
{SpanFromLeft,
Style["point estimation",Bold],
NumberForm[N@mci[t,p,sns,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,spc,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,oda,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,ppv,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,npv,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,dor,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,plr,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,nlr,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,yi,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,ed,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}],
NumberForm[N@mci[t,p,cz,mD,mH,sD,sH,u,nD,nH,nU][[2]],{10,6}]},
{SpanFromLeft,
Style["lower bound",Bold],
NumberForm[N@mci[t,p,sns,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,spc,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,oda,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,ppv,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,npv,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,dor,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,plr,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,nlr,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,yi,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,ed,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}],
NumberForm[N@mci[t,p,cz,mD,mH,sD,sH,u,nD,nH,nU][[1]],{10,6}]},
{SpanFromLeft,
Style["upper bound",Bold],
NumberForm[N@mci[t,p,sns,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,spc,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,oda,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,ppv,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,npv,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,dor,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,plr,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,nlr,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,yi,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,ed,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}],
NumberForm[N@mci[t,p,cz,mD,mH,sD,sH,u,nD,nH,nU][[3]],{10,6}]}}]],
Frame->All, FrameStyle->Blend[{Blue,Cyan},0.35],Spacings->{1,1},ItemSize->Automatic]

d[mf_]:=Switch[mf,sns,mcsns,spc,mcspc,oda,mcoda,ppv,mcppv,npv,mcnpv,dor,mcdor,plr,mcplr,nlr,mcnlr,yi,mcyi,ed,mced,cz,mccz]
c[mf_]:=Switch[mf,sns,cmcsns,spc,cmcspc,oda,cmcoda,ppv,cmcppv,npv,cmcnpv,dor,cmcdor,plr,cmcplr,nlr,cmcnlr,yi,cmcyi,ed,cmced,cz,cmccz]
b[mf_]:=Switch[mf,oda,mcvoda,ppv,mcvppv,npv,mcvnpv]
df[mf_]:=Switch[mf,sns,dfsns,spc,dfspc,oda,dfoda,ppv,dfppv,npv,dfnpv,dor,dfdor,plr,dfplr,nlr,dfnlr,yi,dfyi,ed,dfed,cz,dfcz]
txt[mf_]:=Switch[mf,sns,"Se",spc,"Sp",oda,"ODA",ppv,"PPV",npv,"NPV",dor,"DOR",plr,"LR+",nlr,"LR-",yi,"J",ed,"ED",cz,"CZ"]
ltxt[mf_]:=Switch[mf,sns,"sensitivity",spc,"specificity",oda,"overall diagnostic accuracy",ppv,"positive predictive value",npv,"negative predictive value",dor,"diagnostic odds ratio",plr,"likelihood ratio for a positive result",nlr, "likelihood ratio for a negative result",yi,"Youden's index",ed,"Euclidean distance",cz,"concordance probability"]
lb[pr_,mD_,mH_,sD_,sH_]:=Switch[pr,True,Max[mD-4sD,mH-4sH],False,Max[mD-2.5sD,mH-2.5sH]]
ub[pr_,mD_,mH_,sD_,sH_]:=Switch[pr,True,Min[mD+4sD,mH+4sH],False,Min[mD+2.5sD,mH+2.5sH]]
pro[pr_]:=Switch[pr,True,SetOptions[Plot,PlotRange->All],False,SetOptions[Plot,PlotRange->Automatic]]

TabView[{"Plots"->
TabView[{"Plots vs diagnostic threshold"->
TabView[{
"DAM uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pu[mf,mD,mH,sD,sH,u,nD,nH,pr],
Style["standard uncertainty plot",Bold],
{{mf,ppv,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurement uncertainty",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM relative uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pru[mf,mD,mH,sD,sH,u,nD,nH,pr],
Style["standard uncertainty plot",Bold],
{{mf,oda,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurement uncertainty",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM CI plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
If[mf==dor|| mf==plr||mf==nlr,lpci[p,mf,mD,mH,sD,sH,u,nD,nH,nU,pr],pci[p,mf,mD,mH,sD,sH,u,nD,nH,nU,pr],pci[p,mf,mD,mH,sD,sH,u,nD,nH,nU,pr]],
Style["confidence interval plot",Bold],
{{mf,npv,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["confidence level",Bold],
{{p,0.95,"p"},0.900,0.999,0.001,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurements sample",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nU,80,"sample size"},20,1000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top]}],
"Plots vs measurement uncertainty"->
TabView[{
"DAM uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
puu[mf,t,mD,mH,sD,sH,nD,nH,pr],
Style["standard uncertainty plot",Bold],
{{mf,nlr,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM relative uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pruu[mf,t,mD,mH,sD,sH,nD,nH,pr],
Style["standard uncertainty plot",Bold],
{{mf,spc,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM CI plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pciu[p,mf,t,mD,mH,sD,sH,nD,nH,nU,pr],
Style["confidence interval plot",Bold],
{{mf,cz,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["confidence level",Bold],
{{p,0.95,"p"},0.900,0.999,0.001,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurements sample",Bold],
{{nU,80,"sample size"},20,1000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top]}],
"Plots vs population sample size"->
TabView[{
"DAM uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pun[mf,t,mD,mH,sD,sH,u,r,pr],
Style["standard uncertainty plot",Bold],
{{mf,dor,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["prevalence rate of disease condition",Bold],
{{r,0.067,"r"},0.001,0.999,.001,ImageSize->Tiny,
Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurement uncertainty",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM relative uncertainty plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
prun[mf,t,mD,mH,sD,sH,u,r,pr],
Style["standard uncertainty plot",Bold],
{{mf,sns,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["prevalence rate of disease condition",Bold],
{{r,0.067,"r"},0.001,0.999,.001,ImageSize->Tiny,
Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurement uncertainty",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM CI plots"->
Manipulate[pro[pr,mD,mH,sD,sH];
pcin[p,mf,t,mD,mH,sD,sH,u,r,nU, pr],
Style["confidence interval plot",Bold],
{{mf,plr,"diagnostic accuracy measure:"},{sns->"sensitivity (Se)",spc->"specificity (Sp)",oda->"overall diagnostic accuracy (ODA)",ppv->"positive predictive value (PPV)",npv->"negative predictive value (NPV)",dor->"diagnostic odds ratio (DOR)",plr->"likelihood ratio for a positive result (LR+)",nlr-> "likelihood ratio for a negative result (LR-)",yi->"Youden's index (J)",ed->"Euclidean distance (ED)",cz->"concordance probability (CZ)"},ControlPlacement->Left},
{{pr,True,"plot range"},{True->"full",False->"partial"},ControlPlacement->Left},
Delimiter,
Style["confidence level",Bold],
{{p,0.95,"p"},0.900,0.999,0.001,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},lb[pr,mD,mH,sD,sH],ub[pr,mD,mH,sD,sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["prevalence rate of disease condition",Bold],
{{r,0.067,"r"},0.001,0.999,.001,ImageSize->Tiny,
Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurements sample",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nU,80,"sample size"},20,1000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top]}]}],
"Calculators"->
TabView[{"DAM uncertainty calculator"->
Manipulate[
tu[t,mD,mH,sD,sH,u,nD,nH],
"",
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},Max[mD-4sD,mH-4sH],Min[mD+4sD,mH+4sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["standard measurement uncertainty",Bold],
{{u,0.046,"u"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM relative uncertainty calculator"->
Manipulate[
tru[t,mD,mH,sD,sH,u,nD,nH],
"",
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},Max[mD-4sD,mH-4sH],Min[mD+4sD,mH+4sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["standard measurement uncertainty",Bold],
{{u,0.046,"u"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top],
"DAM CI calculator"->
Manipulate[
tci[t,p,mD,mH,sD,sH,u,nD,nH,nU],
"",
Style["confidence level",Bold],
{{p,0.95,"p"},0.900,0.999,0.001,Appearance->"Labeled",ImageSize->Tiny},
Delimiter,
Style["diagnostic threshold",Bold],
{{t,2.26,"d"},Max[mD-4sD,mH-4sH],Min[mD+4sD,mH+4sH],.01,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["non-diseased population sample",Bold],
{{mH,0,"mean"},0,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sH,1.0,"standard deviation"},1.0,6.0,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nH,2488,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["diseased population sample",Bold],
{{mD,2.99,"mean"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{sD,0.75,"standard deviation"},0.1,6,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nD,179,"sample size"},2,10000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
Style["measurements sample",Bold],
{{u,0.046,"standard measurement uncertainty"},0,sH,.01,ImageSize->Tiny,Appearance->"Labeled"},
{{nU,80,"sample size"},20,1000,1,ImageSize->Tiny,Appearance->"Labeled"},
Delimiter,
SaveDefinitions->True,ContinuousAction->False,TrackedSymbols->True,ControlPlacement->Left,Alignment->Top]}]},
ImageSize->Automatic]

Abbreviations
DAM: Diagnostic Accuracy Measure
CI: Confidence Interval

Disclaimer of Warranties
The notebook is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or Hellenic Complex Systems Laboratory or any of its members be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the notebook or the use or other dealings in the notebook.

About
Diagnostic Uncertainty
Version Number 1.1.1.4
Hellenic Complex Systems Laboratory 2024
The notebook is distributed under  an Attribution - NonCommercial - ShareAlike 4.0 International Creative Commons License.