sign.boot {equivalence} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
sign.boot(x, i, p1 = 0.2, p2 = 0.8)
x |
~~Describe x here~~ |
i |
~~Describe i here~~ |
p1 |
~~Describe p1 here~~ |
p2 |
~~Describe p2 here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function(x, i, p1=0.2, p2=0.8) { x <- x[i] n <- length(x) Nplus <- sum(x > 0) Nzero <- sum(x == 0) Nminus <- n - Nplus - Nzero if(sum(Nzero) > 0) cat("WARNING:", sum(Nzero), "ties occurred.\n") S1 <- qbinom(0.95, n, p1) S2 <- qbinom(0.05, n, p2) result <- sum(Nplus >= S1 & Nplus <= S2) }