View source: R/brm_simulate_continuous.R
brm_simulate_continuous | R Documentation |
Simulate and append non-time-varying continuous
covariates to an existing brm_data()
dataset.
brm_simulate_continuous(data, names, mean = 0, sd = 1)
data |
Classed |
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 |
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. |
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).
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.
Other simulation:
brm_simulate_categorical()
,
brm_simulate_outline()
,
brm_simulate_prior()
,
brm_simulate_simple()
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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.