AIC_BIC_based_marginalLikelihood function

Marginal likelihoods based on AIC or BIC

Marginal likelihoods based on AIC or BIC

This function computes the marginal likelihoods based on the AIC or on the BIC, that will later be used to calculate the TBF.

AIC_BIC_based_marginalLikelihood(fullModel = NULL, candidateModels = NULL, data, discreteSurv = TRUE, AIC = TRUE, package = "nnet", maxit = 150, numberCores = 1)

Arguments

  • fullModel: formula of the model including all potential variables
  • candidateModels: Instead of defining the full model we can also specify the candidate models whose deviance statistic and d.o.f should be computed
  • data: the data
  • discreteSurv: Boolean variable telling us whether a `simple' multinomial regression is looked for or if the goal is a discrete survival-time model for multiple modes of failure is needed.
  • AIC: if TRUE, AIC will be used, else we use BIC
  • package: Which package should be used to fit the models; by default the nnet package is used; we could also specify to use the package 'VGAM'
  • maxit: Only needs to be specified with package nnet: maximal number of iterations
  • numberCores: How many cores should be used in parallel?

Returns

a vector with the marginal likelihoods of all candidate models

Examples

# data extraction: data("VAP_data") # the definition of the full model with three potential predictors: FULL <- outcome ~ ns(day, df = 4) + gender + type + SOFA # here the define time as a spline with 3 knots # now we can compute the marginal likelihoods based on the AIC f.ex: mL_AIC <- AIC_BIC_based_marginalLikelihood(fullModel = FULL, data = VAP_data, discreteSurv = TRUE, AIC = TRUE)

Author(s)

Rachel Heyard

  • Maintainer: Rachel Heyard
  • License: GPL (>= 2)
  • Last published: 2018-10-12

Useful links