R/pscData_addLik.R

Defines functions pscData_addLik

Documented in pscData_addLik

#' A function that add a likelihood for estimation to the pscObject
#'
#' The purpose of this function is to include the appropriate likelihood to the
#' psc object for estimation procedures
#'
#' @param CFM A counter factual model
#' @return a likelihood function
#' @importFrom survival Surv
pscData_addLik <- function(CFM){

  ret <- "No Likelihood specified"

  if("glm"%in%CFM$mod_class){
    ret <- lik.glm
  }

  if("flexsurvreg"%in%CFM$mod_class){
    ret <- lik.flexsurvreg
  }

  ret
}

Try the psc package in your browser

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

psc documentation built on June 8, 2026, 5:06 p.m.