brm_simulate_simple {brms.mmrm}R Documentation

Simple MMRM simulation.

Description

Simple function to simulate a dataset from a simple specialized MMRM.

Usage

brm_simulate_simple(
  n_group = 2L,
  n_patient = 100L,
  n_time = 4L,
  hyper_beta = 1,
  hyper_tau = 0.1,
  hyper_lambda = 1
)

Arguments

n_group

Positive integer of length 1, number of treatment groups.

n_patient

Positive integer of length 1, number of patients per treatment group.

n_time

Positive integer of length 1, number of discrete time points (e.g. scheduled study visits) per patient.

hyper_beta

Positive numeric of length 1, hyperparameter. Prior standard deviation of the fixed effect parameters beta.

hyper_tau

Positive numeric of length 1, hyperparameter. Prior standard deviation parameter of the residual log standard deviation parameters tau

hyper_lambda

Positive numeric of length 1, hyperparameter. Prior shape parameter of the LKJ correlation matrix of the residuals among discrete time points.

Details

Refer to the methods vignette for a full model specification. The brm_simulate_simple() function simulates a dataset from a simple pre-defined MMRM. It assumes a cell means structure for fixed effects, which means there is one fixed effect scalar parameter (element of vector beta) for each unique combination of levels of treatment group and discrete time point. The elements of beta have independent univariate normal priors with mean 0 and standard deviation hyper_beta. The residual log standard deviation parameters (elements of vector tau) have normal priors with mean 0 and standard deviation hyper_tau. The residual correlation matrix parameter lambda has an LKJ correlation prior with shape parameter hyper_lambda.

Value

A list of three objects:

See Also

Other simulation: brm_simulate_categorical(), brm_simulate_continuous(), brm_simulate_outline(), brm_simulate_prior()

Examples

set.seed(0L)
simulation <- brm_simulate_simple()
simulation$data

[Package brms.mmrm version 0.1.0 Index]