data_sim | R Documentation |
A tidy reimplementation of the functions implemented in mgcv::gamSim()
that can be used to fit GAMs. An new feature is that the sampling
distribution can be applied to all the example types.
data_sim( model = "eg1", n = 400, scale = 2, theta = 3, dist = c("normal", "poisson", "binary", "negbin", "tweedie"), seed = NULL )
model |
character; either |
n |
numeric; the number of observations to simulate. |
scale |
numeric; the level of noise to use. |
theta |
numeric; the dispersion parameter θ to use. The default is entirely arbitrary, chosen only to provide simulated data that exhibits extra dispersion beyond that assumed by under a Poisson. |
dist |
character; a sampling distribution for the response variable. |
seed |
numeric; the seed for the random number generator. Passed to
|
data_sim("eg1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.