sim_outcome_glmm: Simulate a (multivariate) longitudinal outcome

View source: R/sim_outcome_glmm.R

sim_outcome_glmmR Documentation

Simulate a (multivariate) longitudinal outcome

Description

Simulate a (multivariate) longitudinal outcome

Usage

sim_outcome_glmm(
  data,
  formula,
  reg_coefs,
  resid_sd = NULL,
  ranef_vcov,
  type = "gaussian",
  return_ranefs = FALSE,
  seed = NULL,
  ...
)

Arguments

data

a data.frame containing covariate data

formula

a list of model formulas for the longitudinal outcomes

reg_coefs

a named list of regression coefficients for each model, with names equal to the corresponding response variable. Each of the list elements is a (named) vector. If named, the names will be matched with the names of the design matrix that is created from formula and data.

resid_sd

named vector of residual standard deviations, with names equal to the corresponding response variable (for types "gaussian" and "Gamma")

ranef_vcov

a random effects variance-covariance matrix or a named list of such matrices when there are more than two levels (and names being equal to the grouping variables)

type

named vector of model types. Available model types are "gaussian", "binomial", "Gamma", and "poisson".

return_ranefs

logical; should the random effects be returned? If TRUE, a list with data and ranefs is returned.

seed

the seed value

...

arguments passed to other functions

Examples

# Bivariate outcome in a multi-level setting







NErler/simvalidator documentation built on May 17, 2022, 7:54 a.m.