simulate_zero_inflated_beta_random_effect_data: Simulate data according to zero-inflated beta random effects...

View source: R/simulate_zero_inflated_beta_data.R

simulate_zero_inflated_beta_random_effect_dataR Documentation

Simulate data according to zero-inflated beta random effects model

Description

Simulate data according to zero-inflated beta random effects model

Usage

simulate_zero_inflated_beta_random_effect_data(
  subject_n = 50,
  time_n = 5,
  v = 2,
  alpha = as.matrix(c(0, 0.5, -1)),
  beta = as.matrix(c(-0.5, -0.5, 0.5)),
  X = NA,
  Z = NA,
  s1 = 0.2,
  s2 = 0.2,
  sim_seed = 100
)

Arguments

subject_n

number of subjects

time_n

number of time points for each subject

v

the dispersion parameter in beta component

alpha

the coefficients in logistic component

beta

the coefficients in beta component

X

the covariates in logistic component

Z

the covariates in beta component

s1

the stardard deviation of random effect in logistic component

s2

the stardard deviation of random effect in beta component

sim_seed

the random seed

Value

a named list

  • Y the bacterial abundance generated from the model

  • X the covariates in logistic component

  • Z the covariates in beta component

  • alpha the coefficients in logistic component

  • beta the coefficients in beta component

  • s1 the stardard deviation of random effect in logistic component

  • s2 the stardard deviation of random effect in beta component

  • subject_ind the IDs for each subject

  • time_ind time points

Examples

simulate_zero_inflated_beta_random_effect_data(
  subject_n = 100, time_n = 5,
  X = as.matrix(c(rep(0, 50 * 5), rep(1, 50 * 5))),
  alpha = as.matrix(c(-0.5, 1)),
  beta = as.matrix(c(-0.5, 0.5)),
  s1 = 1, s2 = 0.8,
  v = 5,
  sim_seed = 100
)

chvlyl/ZIBRE documentation built on Oct. 22, 2023, 1:06 p.m.