Elliptical joint confidence region for relative positive and negative predictive value
Source:R/DTComPair.R
ellipse.pv.rpv.Rd
Returns a 100(1-alpha)% elliptical joint confidence region for the parameter vector {log(relative positive predictive value), log(relative negative predictive value)}.
Arguments
- x
an object returned by the
pv.rpv
function.- alpha
significance level alpha used to compute the 100(1-alpha)% region. The default is 0.05, for a 95% region.
- npoints
the number of points used in the ellipse. Default is 100.
- exponentiate
a logical value indicating whether or not to exponentiate the values for the centre of the ellipse and for the the ellipsoidal outline. Defaults to FALSE.
Value
A list containing:
- centre
the centre of the ellipse.
- ellipse
an
npoints
x 2 matrix with the x and y coordinates for the ellipsoidal outline. Suitable forplot
-ing.
References
Moskowitz, C.S., and Pepe, M.S. (2006). Comparing the predictive values of diagnostic tests: sample size and analysis for paired study designs. Clin Trials, 3(3):272-9.
See also
pv.rpv
and ellipse::ellipse
.
Examples
data(Paired1) # Hypothetical study data
ftable(Paired1)
#> y2 0 1
#> d y1
#> 0 0 155 22
#> 1 53 31
#> 1 0 32 22
#> 1 78 319
paired.layout <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
paired.layout
#> Two binary diagnostic tests (paired design)
#>
#> Test1: 'y1'
#> Test2: 'y2'
#>
#> Diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 319 22 341
#> Test2 neg. 78 32 110
#> Total 397 54 451
#>
#> Non-diseased:
#> Test1 pos. Test1 neg. Total
#> Test2 pos. 31 22 53
#> Test2 neg. 53 155 208
#> Total 84 177 261
#>
rpv.results <- pv.rpv(paired.layout)
ellipse.data <- ellipse.pv.rpv(rpv.results)
if(interactive()){
plot(ellipse.data$ellipse, type = "l", ylim = c(-0.4, 0.2), xlim = c(-0.2, 0.2))
points(ellipse.data$centre[1], ellipse.data$centre[2], col = "red", pch = 19)
abline(h = 0, v = 0, lty = 3)
}