sim_resp: Response component

Description Usage Arguments Details See Also Examples

View source: R/03-sim_resp.R

Description

One of the components which can be added to a sim_setup.

Usage

1
2
3
sim_resp(simSetup, respFun)

sim_resp_eq(simSetup, ...)

Arguments

simSetup

a sim_setup.

respFun

a function constructing the response variable

...

<data-masking> Name-value pairs. The name gives the name of the column in the output.

The value can be:

  • A vector of length 1, which will be recycled to the correct length.

  • A vector the same length as the current group (or the whole data frame if ungrouped).

  • NULL, to remove the column.

  • A data frame or tibble, to create multiple columns in the output.

Details

Potentially you can define an respFun yourself. Take care that it only has one argument, named dat, and returns the a data.frame.

See Also

agg_all, sim_gen, sim_comp_pop, sim_sample, , sim_comp_sample

Examples

1
base_id() %>% sim_gen_x() %>% sim_gen_e() %>% sim_resp_eq(y = 100 + 2 * x + e)

saeSim documentation built on Feb. 7, 2022, 5:07 p.m.