R/zzz.R

Defines functions .onLoad

.onLoad <- function(lib,pkg){
  if(requireNamespace("memisc",quietly = TRUE)){
    
    memisc::setSummaryTemplate(
      mclogit = c(
        "Likelihood-ratio" = "($LR:f1#)",
        #p             = "($p:#)",
        "Log-likelihood" = "($logLik:f1#)",
        Deviance      = "($deviance:f1#)",
        AIC           = "($AIC:f1#)",
        BIC           = "($BIC:f1#)",
        N             = "($N:d)"
      ),
      mmclogit = c(
        #"Likelihood-ratio" = "($LR:f1#)",
        #p             = "($p:#)",
        #"Log-likelihood" = "($logLik:f1#)",
        Deviance      = "($deviance:f1#)",
        #AIC           = "($AIC:f1#)",
        #BIC           = "($BIC:f1#)",
        N             = "($N:d)"
      ),
      mblogit = c(
        "Log-likelihood" = "($logLik:f1#)",
        Deviance      = "($deviance:f1#)",
        AIC           = "($AIC:f1#)",
        BIC           = "($BIC:f1#)",
        N             = "($N:d)"
      )
    )    
  }
  
  if (requireNamespace("emmeans", quietly = TRUE))
    emmeans::.emm_register(c("mblogit"), pkg)
  
  options(mblogit.basecat.sep="/")
  options(mblogit.show.basecat=TRUE)
  options(summary.stats.mclogit=c("Deviance","N"))
  options(summary.stats.mmclogit=c("Deviance","N"))
}

Try the mclogit package in your browser

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

mclogit documentation built on Oct. 29, 2022, 1:09 a.m.