View source: R/quasianscombe.R
sim_quasianscombe_set_1 | R Documentation |
This function generate a data set Type 1 creating first a x
a random vector
then apply a linear transformation using beta0
and beta1
and finally
adding a normal distributed noise using error_sd
creating y
values.
sim_quasianscombe_set_1( n = 500, beta0 = 3, beta1 = 0.5, x_dist = purrr::partial(rnorm, mean = 5, sd = 1), error_dist = purrr::partial(rnorm, sd = 0.5) )
n |
Number of observations |
beta0 |
beta0, default value: 3, |
beta1 |
beta1, default value: 0.5 |
x_dist |
A random number generation function. Default is a |
error_dist |
A random number generation function. Default is a |
This is the typical first example when regression analysis is taught.
Internally this is the same procedure of sim_xy
.
df <- sim_quasianscombe_set_1() df plot(df) plot(df, add_lm = FALSE) plot(sim_quasianscombe_set_1(n = 1000)) plot(sim_quasianscombe_set_1(n = 1000, beta0 = 0, beta1 = 1, x_dist = runif))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.