R/logLik.LD50.R

Defines functions logLik.LD50

Documented in logLik.LD50

#' logLik.LD50 Return Log Likelihood of a fit for LD50
#' @title Return Log Likelihood of a fit generated by LD50
#' @author Marc Girondot \email{marc.girondot@@gmail.com}
#' @return The Log Likelihood value for the fitted model with data
#' @param object A result file generated by fitRMU
#' @param ... Not used
#' @description Return Log Likelihood of a fit generated by LD50
#' @family LD50 functions
#' @examples
#' \dontrun{
#' data <- data.frame(Doses=c(80, 120, 150, 150, 180, 200),
#' Alive=c(10, 12, 8, 6, 2, 1),
#' Dead=c(0, 1, 5, 6, 9, 15))
#' LD50_logistic <- LD50(data, equation="logistic")
#' logLik(LD50_logistic)
#' AIC(LD50_logistic)
#' }
#' @method logLik LD50
#' @export


logLik.LD50 <- function(object, ...) {
  l <- -object$value
  n <- sum(!is.na(as.numeric(as.matrix(object$data))))
  attributes(l) <- list(nall=n , nobs=n , df=length(object$par) , class="logLik")
  return(l)
}

Try the HelpersMG package in your browser

Any scripts or data that you put into this service are public.

HelpersMG documentation built on Oct. 5, 2023, 5:08 p.m.