View source: R/quasianscombe.R
sim_quasianscombe_set_3 | R Documentation |
Data sets Type 3 get some outliers but conserving the $x$ mean and the same coefficients -but different significance- of the adjusted linear model.
sim_quasianscombe_set_3( df, prop = 0.05, beta1_factor = 0.5, residual_factor = 0.25 )
df |
A data frame from |
prop |
The proportion of value to modify as outliers. |
beta1_factor |
Numeric value to modify the beta1 value. |
residual_factor |
Numeric value to multiply residual to modify their variance. |
This function will:
Calculate the linear regression model and will calculate new trend using 0.5 times beta1
Take prop
% values from the greater 2*prop
x
values and modify the
related y
value to get the original estimation of beta1
Apply residual_factor
factor to residual to get minor variance and
better visual impression of the outliers effect.
df <- sim_quasianscombe_set_1() dataset3 <- sim_quasianscombe_set_3(df) dataset3 plot(dataset3) plot(sim_quasianscombe_set_3(df, prop = 0.1, residual_factor = 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.