View source: R/generate_weak_dataset.R
Generates clustered nonlinear spatial exposure effects in a linear model where distance distribution and count is correlated with the cluster function
1 2 3 4 5 6 7 8 9 10 11 12 13 | generate_weak_dataset(
n = 100,
prop_cluster = c(0.5, 0.5),
cluster_functions = list(fun_one = function(x) pweibull(x, shape = 6, scale = 0.5,
lower.tail = FALSE), fun_two = function(x) 0),
num_distances = list(Rural = 15, Urban = 15),
rdist_generator = list(Rural = function(x) rbeta(x, 1, 1), Urban = function(x)
rbeta(x, 1, 1)),
prop_exposed = 0.95,
Z = cbind(1, rbinom(n = n, 1, 0.5)),
delta = c(26, -0.5),
seed = NULL
)
|
n |
number of observations |
prop_cluster |
vector of cluster proportions |
cluster_functions |
list of length |
prop_exposed |
proportion of observations with exposure to spatial features |
Z |
matrix of standard regression coefficients - assumes first column is an intercept |
delta |
vector of regression coefficients |
seed |
random number generator seed |
mean_num_distances |
mean number of simulated distances to include |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.