Description Usage Arguments Details Author(s) References See Also Examples

If partially marginalized posterior distribution (i.e. `Reduce`

=1 in the computation of `lmeNBBayes`

) is a target distribution, the DIC is computed using the focused likelihood

*
Pr(Y[i]=y[i]| { a[G[h]] }[h=1]^{M}, { r[G_h] }[h=1]^{M}, { H[h] }[h=1]^{M}, beta)
*.

If not, then the DIC is computed using the focused likelihood
*
Pr(Y[i] |a[G[h[i]]],r[G[h[i]]], ,beta)
*.

1 2 3 4 |

`olmeNBB` |
The output of |

`data` |
See |

`ID` |
See the description in |

`useSample` |
A vector of length the total number of repeated measures (i.e. the
same as the length of |

`focus` |
Focused likelihood |

`lower.alpha` |
Used only when |

`upper.alpha` |
Used only when |

`inc.alpha` |
Used only when |

`ys` |
A vector containing the response values |

`rs` |
A vector containing the size parameters of negative binomial. The length of rs must be the same as the length of ys. |

`aGs` |
A vector containing the shape1 parameters of the approximated infinite mixture of betas. |

`bGs` |
A vector containing the shape2 parameters of the approximated infinite mixture of betas.
The length must be the same as the length of |

`ps` |
A vector containing the probability parameters of the approximated infinite mixture of betas.
The length must be the same as the length of |

Denote *P* be a vector of "focused" parameters.

Using Spiegelhalter et. al.(2002)'s notation, the effective number of parmeters can be computed as:

*p[D]=D.bar - D( P.bar)*

where *D* is the deviance and the *P.bar* is the expectation of *P*.

When `focus`

= `FG`

then the focused parameters, denoted as *P*, are the random effect distribution
(i.e.,infinite mixture of beta distribution) and the regression coefficients. In the computation, the expected regression coefficients are obtained by simply computing the mean of the posterior samples of coefficients. The expected infinite mixture of beta distribution is obtained in the following steps:

STEP 1: Provide a fine grids of points between [0,1]. We chose the grid of points to be

`alphas <- seq(lower.alpha,upper.alpha,inc.alpha)`

.

STEP 2: For each sampled infinite mixture of betas,
Evaluate its value at every grid provided from STEP 1 for each sample.
Obtain `B`

by `length(alphas)`

matrix.

STEP 3: Given the matrix from STEP2, at each grid of points, we compute the average value of density.
Obtain a vector of length `length(alpha)`

, that contains the estimated expected random effect density at fine grid of points.

STEP 4: Given the estimated expected coefficients and the estimated expected random effect density,
evaluate *D(P.bar)* by integrating the conditional likelihood given random effects with respect to the estimated expected random effect density from STEP 3.

Kondo, Y.

Kondo, Y., Zhao, Y. and Petkau, A.J., "A flexible mixed effect negative binomial regression model for detecting unusual increases in MRI lesion counts in individual multiple sclerosis patients".

Spiegelhalter, D.J.; Best, N. G.; Carlin, B.P., van der Linde, A. (2002). "Bayesian measures of model complexity and fit (with discussion)". Journal of the Royal Statistical Society, Series B 64 (4): 583-639.

`lmeNBBayes`

`dqmix`

`index.batch.Bayes`

1 | ```
## See the examples of function lmeNBBayes
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.