sim_quasianscombe_set_4: Generate _quasi_ Anscombe data sets Type 4: 2 Clusters

View source: R/quasianscombe.R

sim_quasianscombe_set_4R Documentation

Generate quasi Anscombe data sets Type 4: 2 Clusters

Description

Data sets Type 4 recreate two cluster keeping the coefficient of the original regression model.

Usage

sim_quasianscombe_set_4(df, rescale_to = c(0.1, 0.2), prop = 0.15)

Arguments

df

A data frame from sim_quasianscombe_set_1 (or similar).

rescale_to

Rescale the x value before create the second cluster.

prop

The proportion of value to modify as the second group/cluster.

Details

This function will:

  • Disorder the order of x values.

  • Rescale the x value to specific original quantiles.

  • Then take a proportion of value and translate to left keeping the original mean of x.

  • Finally add some value to the associated y value and subtract to the complement group to have the same regression model in terms of coefficients.

Examples


df <- sim_quasianscombe_set_1()

dataset4 <- sim_quasianscombe_set_4(df)

dataset4

plot(dataset4)

plot(sim_quasianscombe_set_4(df, rescale_to = c(0, .1), prop = 0.5))


jbkunst/klassets documentation built on Dec. 7, 2022, 9:18 p.m.