loglik: The core function to compute the total likelihood of the...

Description Usage Arguments Value Examples

View source: R/loglik.R

Description

The core function to compute the total likelihood of the joint model given the selected marginal distribution for the multivariate count outcome and the dataset

Usage

1
loglik(params, method, data)

Arguments

params

A vector of fixed effect and standard deviations of the random effects.

method

An argument of either "dirmult" or "multl" defining the marginal distribution of the multivariate count outcome.

data

A complete observation for all subjects including the multivariate count outcome, the covariates and the continuous outcomes for two time points.

Value

The total loglikelihood values for the given parameters values.

Examples

1
2
3
4
5
6
7
8
9
# params should be in the format of params = {betas_C, betas_Y,uC's, uS's,theta or rho,uY,ev}, where
# The following example is for the multinomial logistics mixed model
betas_C <- c(0.5,3.5,1.3,0.8,0.15)
betas_Y <- c(2.3,0.1)
uC<- c(1,0.8)
uS <- c(0.5,0.6)
uY <- 0.9; ev <- 0.7; rho <- 0.1;
params <- c(betas_C,betas_Y, uC,uS,rho,uY,ev)
ll <- loglik(params,method = "multl",data)

IvonneMartin/JMoverCat documentation built on July 21, 2020, 12:12 a.m.