View source: R/quasianscombe.R
sim_quasianscombe_set_2 | R Documentation |
Data sets Type 2 shows how a no linear relationship between x
and y
can
lead in the same regression model (in terms of parameter values) of
the Type 1.
sim_quasianscombe_set_2( df, fun = function(x) { x^2 }, residual_factor = 0.25 )
df |
A data frame from |
fun |
A function to apply, this is applied to normalized version of |
residual_factor |
Numeric value to multiply residual to modify their variance. |
df <- sim_quasianscombe_set_1() dataset2 <- sim_quasianscombe_set_2(df) dataset2 plot(dataset2) plot(sim_quasianscombe_set_2(df, residual_factor = 0)) fun1 <- function(x){ 2 * sin(x*diff(range(x))) } plot(sim_quasianscombe_set_2(df, fun = fun1)) fun2 <- abs plot(sim_quasianscombe_set_2(df, fun = fun2)) fun3 <- function(x){ (x - mean(x)) * sin(x*diff(range(x))) } plot(sim_quasianscombe_set_2(df, fun = fun3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.