Description Usage Arguments See Also Examples
View source: R/03-sim_gen_cont.R
One of the components which can be added to a sim_setup
. It is applied after functions added with sim_gen
.
1 | sim_gen_cont(simSetup, generator, nCont, type, areaVar = NULL, fixed = TRUE)
|
simSetup |
a |
generator |
generator function used to generate random numbers. |
nCont |
gives the number of contaminated observations. Values between 0
and 1 will be treated as probability. If type is 'unit' and length is
larger than 1, the expected length is the number of areas. If type is
'area' and length is larger than 1 the values are interpreted as area
positions; i.e. |
type |
"unit" or "area" - unit- or area-level contamination. |
areaVar |
character with variable name(s) identifying areas. |
fixed |
TRUE fixes the observations which will be contaminated. FALSE will result in a random selection of observations or areas. |
1 2 3 | sim_base_lm() %>%
sim_gen_cont(gen_norm(name = "e"), nCont = 0.05, type = "unit", areaVar = "idD") %>%
as.data.frame
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.