mhglm_sim

0th

Percentile

Simulate response patterns

Simulate response patterns for generalized linear models of gaussian or binomial families, with both an intercept and slope covariate. Used primarily for testing purposes.

Keywords
datagen
Usage
mhglm_sim(n, m_per_level, sd_intercept, sd_slope,
          family = c("gaussian", "binomial"), seed)
Arguments
n

an integer scalar, the number of observations at the lowest grouping level.

m_per_level

an integer vector, the number of grouping levels nested under the level above.

sd_intercept

a numeric vector, the standard deviations of the intercept random effects.

sd_slope

a numeric vector, the standard deviations of the slope random effects.

family

a character scalar, either "gaussian" or "binomial".

seed

a single value, interpreted as an integer, or NULL as in set.seed.

Details

returns a data.frame with design matrix, response, and group levels.

Aliases
  • mhglm_sim
Examples
# NOT RUN {
mhglm_sim(n = 2, m_per_level = c(3, 3), sd_intercept = c(1, 2), 
        sd_slope = c(2, 1), family = "gaussian", seed = 123)

mhglm_sim(n = 2, m_per_level = c(3, 3), sd_intercept = c(1, 2), 
        sd_slope = c(2, 1), family = "binomial", seed = 123)
# }
Documentation reproduced from package mbest, version 0.6, License: Apache License (== 2.0) | file LICENSE

Community examples

Looks like there are no examples yet.