simulate_block_data: Simulate correlated blocks of variables
Description
simulate_block_data() creates a dataset of blocks of data where variables
within each block are correlated. The correlation for each pair of variables
is sampled uniformly from lower_corr to upper_corr, and the values of
each are sampled using MASS::mvrnorm().
Usage
simulate_block_data(
block_sizes,
lower_corr,
upper_corr,
n,
block_name = "block",
sep = "_",
var_name = "x"
)
Value
a tibble with sum(block_sizes) columns and n rows.
Arguments
block_sizes
a vector of block sizes. The size of each block is the
number of variables within it.
lower_corr
the lower bound of the correlation within each block
upper_corr
the upper bound of the correlation within each block
n
the number of observations or rows
block_name
description prepended to the variable to indicate the block it belongs to
sep
a character, what to separate the variable names with