model_response_lm: Simulate response variable (testing function)

Description Usage Arguments Examples

Description

function description.

Usage

1
2
3
model_response_lm(model_frame, formula = attr(model_frame, "formula"),
  link_inv = replicate(length(formula), identity), generator = rnorm,
  responses = c("response"), effects_save = FALSE, seed = NULL)

Arguments

model_frame

A tibble containing all the covariates to be used. Usually this is obtained as the output of the model_frame function.

formula

An optional list of formulas to simulate the parameters of the response variables.

link_inv

A list of function representing the inverse link function for the parameters.

generator

Function to generate the response variables given the parameters

responses

a numeric value indicating the number of response or a character vector indicating the names of the response variables

effects_save

Optional logical argument to save or not generated random effects

seed

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

Examples

1
2
3
4
5
6
formula <- list(
mean ~ I(0.5 * x1) : I(x2) + re(city, 1, 2),
sd ~ I(1)
)
model_frame <- model_frame(formula, n = 10)
model_response_lm(model_frame)

ErickChacon/datasim documentation built on March 25, 2020, 7:53 p.m.