#' Estimate Bland-Altman limits of agreement
#'
#' @param mu mean of the pairwise differences
#' @param SD standard deviation of the pairwise differences
#' @param gamma alpha level for calculating limits of agreement
#' @return a list
estimateLimitsOfAgreement <- function(mu, SD, gamma = 0.05){
# compute limits of agreement
zgamma = stats::qnorm(1 - gamma/2, lower.tail = TRUE)
upperLOA = mu + zgamma * SD
lowerLOA = mu - zgamma * SD
result <- list(mu = mu,
SD = SD,
gamma = gamma,
zgamma = zgamma,
upperLOA = upperLOA,
lowerLOA = lowerLOA)
class(result) <- "LOA"
return(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.