File: ci.GartNam.R

package info (click to toggle)
r-cran-optimalcutpoints 1.1-5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 432 kB
  • sloc: makefile: 2
file content (9 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
ci.GartNam <-
function(x, y, n, conf.level) {
	z <- qnorm(1-((1-conf.level)/2))
    
    	ll <- (2*n$d*n$h*x*y-sqrt((2*n$d*n$h*x*y)^2-4*(n$h*n$d*y^2-z^2*n$d*y*(1-y))*(n$h*n$d*x^2-z^2*n$h*x*(1-x))))/(2*(n$h*n$d*y^2-z^2*n$d*y*(1-y)))
    	ul <- (2*n$d*n$h*x*y+sqrt((2*n$d*n$h*x*y)^2-4*(n$h*n$d*y^2-z^2*n$d*y*(1-y))*(n$h*n$d*x^2-z^2*n$h*x*(1-x))))/(2*(n$h*n$d*y^2-z^2*n$d*y*(1-y)))
    
    	res <- list (ci = matrix(c(ll,ul), ncol = 2))    
}