ellipse.pv.rpv: Elliptical joint confidence region for relative positive and...

View source: R/DTComPair.R

ellipse.pv.rpvR Documentation

Elliptical joint confidence region for relative positive and negative predictive value

Description

Returns a 100(1-alpha)% elliptical joint confidence region for the parameter vector {log(relative positive predictive value), log(relative negative predictive value)}.

Usage

ellipse.pv.rpv(x, alpha = 0.05, npoints = 100, exponentiate = FALSE)

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 for plot-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)
paired.layout <- tab.paired(d=d, y1=y1, y2=y2, data=Paired1)
paired.layout 
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)
}


DTComPair documentation built on Sept. 24, 2024, 5:08 p.m.