View source: R/generate_data.R
generate_data | R Documentation |
All distributions share the same latent variable \eta_{ij} = a + b_i
with b_i = N(0, \sigma_r)
.
generate_data(
a = 0,
sigma_random = 0.5,
n_random = 20,
n_replicate = 10,
nb_size = 1,
b_size = 5,
zero_inflation = 0.5
)
a |
the intercept of the latent variable |
sigma_random |
The standard error for the random effect |
n_random |
the number of random effect levels (groups). |
n_replicate |
the number of observation per random effect level. |
nb_size |
the size parameter of the negative binomial distribution.
Passed to the |
b_size |
the size parameter of the binomial distribution. Passed to the
|
zero_inflation |
the probability the the observed value stems for the a point mass in zero. |
The Poisson distribution uses \lambda = e^{\eta_{ij}}
.
The negation binomial distribution uses \mu = e^{\eta_{ij}}
.
The binomial distribution uses
\pi_{ij} = e^{\eta_{ij}}/(e^{\eta_{ij}}+ 1)
.
A data.frame
ìd
the id of the random effect.
eta
the latent variable.
zero_inflation
use the point mass in zero.
poisson
the Poisson distributed variable.
zipoisson
the zero-inflated Poisson distributed variable.
negbin
the negative binomial distributed variable.
zinegbin
the zero-inflated negative binomial distributed variable.
binom
the binomial distributed variable.
Other utils:
plot.dispersion_check()
,
plot.distribution_check()
set.seed(20181202)
head(generate_data())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.