Skip to content

Commit

Permalink
Remove unnecessary step.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmgarnier committed May 6, 2024
1 parent 2f1fd41 commit 40f5035
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/boring.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@
rho <- cor(x, y, method = "spearman")

if (is.na(conf_level)) {
result <- c(estimate = rho)
c(estimate = rho)
} else {
n <- length(x)
e_fx <- exp(2 * ((0.5 * log((1 + rho) / (1 - rho))) - c(1, -1) *
(abs(qnorm((1 - conf_level) / 2))) * (1 / sqrt(sum(n) - 3))))
ci <- (e_fx - 1) / (e_fx + 1)
result <- c(
c(
estimate = rho,
lower_ci = max(ci[1], -1),
upper_ci = min(ci[2], 1)
)
}

result
}

#' @title Multivariate Unimodality Index
Expand Down

0 comments on commit 40f5035

Please sign in to comment.