simBACE <- function(
response_type = "gaussian", # type of the response
predictor_types = c("gaussian", "gaussian"), # type of each predictor
var_names = NULL, # custom names, can be left NULL - they will be x1, x2, ...
beta_matrix = NULL, # matrix defining dependencies between predictors (if NULL - generated automatically)
beta_resp = NULL, # betas for y~x1+x2+... dependencies (can be left NULL)
beta_sparsity = 0.7, # how sparse betas should be for predictors (0 = all predictors depend on each other, 1 = they are independent)
ix_matrix = NULL, # interactions between predictors specified using "Tukey-like" notation, see function description
beta_ix = NULL, # betas for interaction terms
intercepts = NULL, # intercepts for variables if not zero
birth = 0.8, # birth rate for tree generation
death = 0.4, # death rate for tree generation
phylo_signal = NULL, # vector of phylogenetic signals for variables y, x1, x2, ...
n_cases = 200, # total number of obs to generate
n_species = 75, # number of species on the tree
missingness = NULL, # vector of missigness scores for each variable, 0 = no missing data, y is the first variable
sigmas = NULL, # SD for random effects of non-phylogenetic species effect and residuals, if NULL - generated automatically
rr = FALSE, # if TRUE - allow for random slopes in gaussian and/or poisson predictors
rr_form = NULL) # names of predictors where random slope is possible, separately for each random effect
The function is now ready, it's in
R/simulate_data- just source filesimBACE_new.R.What you can setup: