sim_model: Simulate databases based in models

Description Usage Arguments Value Author(s) Examples

Description

sim_model simulate a database based on common models. The structure used to create the data is similar as the bamlss.formula.

Usage

1
2
sim_model(formula = list(mean ~ 1 + 2 * x1, sd ~ 1), generator = rnorm,
  n = 1000, init_data = NULL, seed = NULL, extent = 1)

Arguments

formula

List of the parameters, indicating how they should be computed. similar to formula for lm, glm, bamlss, with the difference that it included the coefficients and link function explicitly.

generator

Function to generate the response variables given the parameters

n

Number of observations to be simulated

init_data

Initial data including some variables to not been simulated.

seed

Seed to be defined with function set.seed to obtain reproducible results

extent

Spatial extent for the simulation of coordinates when a spatial effect is included.

Value

a tibble containing the simulated predictors, parameters and response variable

Author(s)

Erick Albacharro Chacon-Montalvan

Examples

1
2
3
4
5
f <- list(
 mean ~ 5 + 0.5 * x1 + 0.1 * x2 + 0.7 * id1,
 sd ~ exp(x1)
)
data <- sim_model(f, rnorm, 100)

ErickChacon/day2day documentation built on May 6, 2019, 4:03 p.m.