Package 'zinbcdpmm'

Title: Bayesian ZINB-Ordinal Joint Model with CDPMM Random Effects
Description: Fits a Bayesian joint model for longitudinal zero-inflated negative binomial and ordinal outcomes with CDPMM random effects, as in Liang and Du.
Authors: Shuqing Liang [aut], Jiang Du [aut, cre]
Maintainer: Jiang Du <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-10-24 06:12:00 UTC
Source: https://github.com/liang-shuqing/zinb-ordinal-cdpmm-code

Help Index


Fit joint ZINB-ordinal model with CDPMM random effects

Description

Thin wrapper around fit_joint_model.

Usage

fit_zinb_ordinal(data, chain = 2000, burn = 1000, thin = 5, G = 8, ...)

Arguments

data

A list / zinbcdpmm_data from simulate_zinb_ordinal or with the same fields as generate_data output.

chain

MCMC iterations.

burn

Burn-in.

thin

Thinning interval.

G

Truncation level of the stick-breaking CDPMM (default 8).

...

Additional arguments passed to fit_joint_model.

Value

An object of class zinbcdpmm_fit.


Print and summary methods for zinbcdpmm fits

Description

S3 methods for objects of class zinbcdpmm_fit.

Usage

## S3 method for class 'zinbcdpmm_fit'
print(x, ...)
## S3 method for class 'zinbcdpmm_fit'
summary(object, ...)
## S3 method for class 'summary.zinbcdpmm_fit'
print(x, digits = 3, ...)

Arguments

x

A zinbcdpmm_fit or its summary.

object

A zinbcdpmm_fit.

digits

Digits for printing.

...

Unused.


Simulate longitudinal ZINB + ordinal data

Description

Thin wrapper around generate_data. Returns an object of class zinbcdpmm_data.

Usage

simulate_zinb_ordinal(
  n = 100,
  nis = 10,
  seed = 2026,
  random_nis = FALSE,
  nis_range = 1:20,
  scenario = 1,
  C = 5,
  re_dist = "normal",
  mvt_df = 4,
  rho = NULL,
  zi_intercept = NULL,
  ...
)

Arguments

n

Number of subjects.

nis

Visits per subject (scalar or length-n vector).

seed

RNG seed.

random_nis

If TRUE, sample visit counts from nis_range.

nis_range

Integer range for random visit counts.

scenario

Simulation scenario (1 or 2).

C

Number of ordinal categories.

re_dist

Random-effects truth: \"normal\", \"mixture\", or \"mvt\".

mvt_df

Degrees of freedom when re_dist = \"mvt\".

rho

Common RE correlation (default 0.5).

zi_intercept

Optional override of zero-inflation intercept.

...

Passed to generate_data.

Value

A list with class zinbcdpmm_data.