View source: R/quasianscombe.R
sim_quasianscombe_set_5 | R Documentation |
Data sets Type 5 recreates the phenomenon of heteroskedasticity in the residuals.
sim_quasianscombe_set_5(df, fun = identity, residual_factor = 10)
df |
A data frame from |
fun |
A function to apply to the index to multiply the residuals of the original model. |
residual_factor |
Numeric value to multiply residual to modify their variance. |
This function will take residuals $e_i$ and then get $e'_i = e_i * fun(i)$ and then rescale the $e'_i$ to the range of $e_i$.
df <- sim_quasianscombe_set_1() dataset5 <- sim_quasianscombe_set_5(df) dataset5 plot(dataset5) plot(sim_quasianscombe_set_5(df, fun = rev)) plot(sim_quasianscombe_set_5(df, fun = sqrt)) plot(sim_quasianscombe_set_5(df, fun = log)) plot(sim_quasianscombe_set_5(df, fun = function(x) x^(1+0.6)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.