brm_simulate_continuous {brms.mmrm}R Documentation

Append simulated continuous covariates

Description

Simulate and append non-time-varying continuous covariates to an existing brm_data() dataset.

Usage

brm_simulate_continuous(data, names, mean = 0, sd = 1)

Arguments

data

Classed tibble as from brm_data() or brm_simulate_outline().

names

Character vector with the names of the new covariates to simulate and append. Names must all be unique and must not already be column names of data.

mean

Numeric of length 1, mean of the normal distribution for simulating each covariate.

sd

Positive numeric of length 1, standard deviation of the normal distribution for simulating each covariate.

Details

Each covariate is a new column of the dataset with one independent random univariate normal draw for each patient. All covariates simulated this way are independent of everything else in the data, including other covariates (to the extent that the random number generators in R work as intended).

Value

A classed tibble, like from brm_data() or brm_simulate_outline(), but with new numeric covariate columns and with the names of the new covariates appended to the brm_covariates attribute.

See Also

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

Examples

data <- brm_simulate_outline()
brm_simulate_continuous(
  data = data,
  names = c("age", "biomarker")
)
brm_simulate_continuous(
  data = data,
  names = c("biomarker1", "biomarker2"),
  mean = 1000,
  sd = 100
)

[Package brms.mmrm version 0.1.0 Index]