Type Pakage Pakage diffdepprop Feruary 19, 2015 Title Calulates Cofidee Itervals for two Depedet Proportios Versio 0.1-9 Date 2013-05-03 Author Maitaier Daiela Wezel <dai-wezel@gmx.et> The pakage iludes futios to alulate ofidee itervals for the differee of depedet proportios. There are two futios implemeted to edit the data (dihotomisig with the help of utpoits, outig aordae ad disordae of two tests or situatios). For the alulatio of the ofidee itervals etries of the fourfold tale are eeded. Depeds gee, rootsolve, PropCIs Liese GPL NeedsCompilatio o Repository CRAN Date/Puliatio 2013-05-03 19:07:38 R topis doumeted: diffdepprop-pakage.................................... 2 out.fourfold........................................ 3 data.p............................................ 4 diffpi............................................ 5 exat.od.......................................... 6 exat.midp.......................................... 7 p.v............................................ 8 p.t............................................. 9 uod............................................ 10 wald............................................ 11 wilso............................................ 12 wilso........................................... 13 wilso.phi.......................................... 14 1
2 diffdepprop-pakage Idex 15 diffdepprop-pakage Calulates Cofidee Itervals for two Depedet Proportios Details The pakage iludes futios to alulate ofidee itervals for the differee of depedet proportios. There are two futios implemeted to edit the data (dihotomisig with the help of utpoits, outig aordae ad disordae of two tests or situatios). For the alulatio of the ofidee itervals etries of the fourfold tale are eeded. Pakage: diffdepprop Type: Pakage Versio: 0.1-9 Date: 2013-05-03 Liese: GPL>=2 Maitaier: Daiela Wezel <dai-wezel@gmx.et> Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. Clopper, C. ad Pearso, E.S. (1934). The use of ofidee or fiduial limits illustrated i the ase of the iomial. Biometrika 26, 404-413. Vollset, S.E. (1993). Cofidee itervals for a iomial proportio. Statistis i Mediie 12. 809-824. Lage, K. ad Bruer, E. (2012). Sesitivity, Speifiity ad ROC-urves i multiple reader diagosti trials-a uified, oparametri approah. Statistial Methodology 9, 490-500. Fleiss, Joseph L. et al. (2003). Statistial Methods for Rates ad Proportios. Wiley. See Also PropCIs
out.fourfold 3 # a=10, =15, =5, d=20, =50, type I error is 0.05 wilso = wilso(10,15,5,20,50,0.05) # =15, =5, =50, type I error is 0.05 exat.od = exat.od(15, 5, 50, 0.05) out.fourfold Couts the umers of disordae ad oordae of two tests I the ase two depedet tests shall e ompared a fourfold tale is mostly eeded. out.fourfold outs the umers of oordae ad disordae of oth tests. out.fourfold(data, ol.test1, ol.test2) data ol.test1 ol.test2 ame of the data umer of olum represetig the first test umer of olum represetig the seod test A vetor otaiig the four etries of the fourfold tale, row wise listed # reate a data set with zero ad oes for eah of oth tests v1=(rep(1,10),rep(0,4),rep(1,8),rep(0,8)) v2=(rep(0,10),rep(1,5),rep(0,5),rep(1,10)) =(seq(1,30,1)) ew=id(,v1,v2) # out the umer of oordae ad disordae out.fourfold(ew,1,2)
4 data.p data.p Creates iary data of a give data set Biary data are sometimes eeded to aalyse these data. Data of two situatio (e.g. diagosti tests) with otious outome are assumed to e give. With the help of the utpoit for eah test, these data a e dihotomise. data.p(dat, ol.test1, ol.test2, p.test1, p.test2) dat ol.test1 ol.test2 p.test1 p.test2 ame of the data set you wat to e dihotomise umer of the olum of the first test i the data set, whih shall e dihotomised umer of the olum of the seod test i the data set, whih shall e dihotomised utpoit for the first test utpoit for the seod test A matrix otaiig the two tests with iary data # reate a data set v1=(seq(1,10,0.5)) v2=(seq(2,11,0.5)) =(seq(1,19,1)) ew=id(,v1,v2) # utpoit of the first test is 1.6, of the seod test 2.3 result=data.p(ew,2,3,1.6,2.3)
diffpi 5 diffpi Calulates various ofidee itervals for the differee of two depedet proportios This futio gives 12 differet two-sided ofidee itervals. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. The followig itervals are listed: Wald, Wald with otiuity orretio, Agresti, Tago, Exat (Clopper Pearso ad mid-p), Profile Likelihood, Wilso (without ad with otiuity orretios) ad oparametri approahes usig rak methods (with ormal ad t-approximatio). diffpi(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets Details Details are give for eah futio separately. A matrix otaiig the method, the differee estimator ad the orrespodig ofidee limits. Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. Clopper, C. ad Pearso, E.S. (1934). The use of ofidee or fiduial limits illustrated i the ase of the iomial. Biometrika 26, 404-413. Vollset, S.E. (1993). Cofidee itervals for a iomial proportio. Statistis i Mediie 12. 809-824.
6 exat.od Lage, K. ad Bruer, E. (2012). Sesitivity, Speifiity ad ROC-urves i multiple reader diagosti trials-a uified, oparametri approah. Statistial Methodology 9, 490-500. Fleiss, Joseph L. et al. (2003). Statistial Methods for Rates ad Proportios. Wiley. # a=59, =23, =3, d=37, =122, type I error is 0.05 diffpi(59,23,3,37,122,0.05) exat.od Calulates a exat oditioal ofidee iterval usig a Clopper Pearso iterval. exat.od gives a two-sided exat oditial ofidee iterval for the differee of two depedet proportios. It is uilt of a Clopper Pearso Iterval. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. exat.od(,,, ) first umer of disordat pairs i a fourfold tale as desried aove seod umer of disordat pairs i a fourfold tale as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Clopper, C. ad Pearso, E.S. (1934). The use of ofidee or fiduial limits illustrated i the ase of the iomial. Biometrika 26, 404-413. Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650.
exat.midp 7 # =10, =20, =50, type I error is 0.05 of.it=exat.od(10,20,50,0.05) exat.midp Calulates a exat oditioal ofidee iterval usig a mid-p iterval. exat.midp gives a two-sided exat oditioal ofidee iterval for the differee of two depedet proportios. It is uilt of a mid-p Iterval. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. exat.midp(,,, ) first umer of disordat pairs i a fourfold tale as desried aove seod umer of disordat pairs i a fourfold tale as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Vollset, S.E. (1993). Cofidee itervals for a iomial proportio. Statistis i Mediie 12. 809-824. Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. # =10, =20, =50, type I error is 0.05 of.it=exat.midp(10,20,50,0.05)
8 p.v p.v Calulates a rak-ased ofidee iterval p.v gives a two-sided rak-ased ofidee iterval with ormal approximatio for the differee of two depedet proportios. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. p.v(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets Details The ormal approximatio is used for the ritial value for the iterval. A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Lage, K. ad Bruer, E. (2012). Sesitivity, Speifiity ad ROC-urves i multiple reader diagosti trials-a uified, oparametri approah. Statistial Methodology 9, 490-500. # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=p.v(10,15,5,20,50,0.05)
p.t 9 p.t Calulates a rak-ased ofidee iterval p.t gives a two-sided rak-ased ofidee iterval with t- approximatio for the differee of two depedet proportios. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. p.t(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets Details The t-approximatio is used for the ritial value for the iterval. A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Lage, K. ad Bruer, E. (2012). Sesitivity, Speifiity ad ROC-urves i multiple reader diagosti trials-a uified, oparametri approah. Statistial Methodology 9, 490-500. # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=p.t(10,15,5,20,50,0.05)
10 uod uod Calulates a uoditioal true profile likelihood ofidee iterval. uod gives a two-sided true profile likelihood ofidee iterval for the differee of two depedet proportios. It is uilt y the solutio of a iequality. Data are assumed to e of a fourfold tale, whih otais the umer of oordae ad the umer of disordae of two depedet methods. uod(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets Details The true profile likelihood ofidee iterval has as lower limit the miimum of the solutios for the iequality of the maximum likelihood futio ad the quatile of the ormal distriutio. The upper limit is defied as the maximum solutio of this iequality. A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650.
wald. 11 # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=uod(10,15,5,20,50,0.05) wald. Calulates a Wald ofidee iterval with otiuity orretio wald. gives a two-sided Wald ofidee iterval with otiuity orretio for the differee of two depedet proportios. The otiuity orretio fator is 1. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. wald.(,,, ) first umer of disordat pairs i a fourfold tale as desried aove seod umer of disordat pairs i a fourfold tale as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Fleiss, Joseph L. et al. (2003). Statistial Methods for Rates ad Proportios. Wiley. # =10, =20, =50, type I error is 0.05 of.it=wald.(10,20,50,0.05)
12 wilso wilso Calulates a Wilso ofidee iterval wilso gives a two-sided Wilso ofidee iterval for the differee of two depedet proportios. There is o otiuity orretio performed. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. wilso(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=wilso(10,15,5,20,50,0.05)
wilso. 13 wilso. Calulates a Wilso ofidee iterval with otiuity orretio wilso. gives a two-sided Wilso ofidee iterval with otiuity orretio for the differee of two depedet proportios. The otiuity orretio is performed to the sore limits. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. wilso.(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=wilso.(10,15,5,20,50,0.05)
14 wilso.phi wilso.phi Calulates a Wilso ofidee iterval with otiuity orretio wilso.phi gives a two-sided Wilso ofidee iterval with otiuity orretio for the differee of two depedet proportios. Data are assumed to e of a fourfold tale, whih otais the umers of oordae ad the umers of disordae of two depedet methods. The otiuity orretio is performed to the d phi whih is alulated y the etries of the fourfold tale. wilso.phi(a,,, d,, ) a d first umer of oordat paires as desried aove first umer of disordat paires as desried aove seod umer of disordat paires as desried aove seod umer of oordat paires as desried aove umer of oserved ojets A list with lass "htest" otaiig the followig ompoets: of.it a ofidee iterval for the differee i proportios d differee i proportios Newome, R.G. (1998). Improved ofidee itervals for the differee etwee iomial proportios ased o paired data. Statistis i Mediie 17. 2635-2650. # a=10, =15, =5, d=20, =50, type I error is 0.05 of.it=wilso.phi(10,15,5,20,50,0.05)
Idex out.fourfold, 3 data.p, 4 diffdepprop (diffdepprop-pakage), 2 diffdepprop-pakage, 2 diffpi, 5 exat.od, 6 exat.midp, 7 p.v, 8 p.t, 9 uod, 10 wald., 11 wilso, 12 wilso., 13 wilso.phi, 14 15