eda_3pt splits the data into 3 groups (whose summary locations are defined by their respective medians), and two half slopes linking the groups. The function will return a scatter plot showing the half-slopes in red solid lines. The solid grey slope linking both tail-end groups shows the desired shape for both half-slopes. The goal is to have the two halve slopes line up as closely as possible to the solid grey slope via re-expression techniques when seeking a linear relationship between both variables.

The function will also return the half-slopes ratio hsrtio and the direction of re-expression for both X and Y values on the ladder of powers.

eda_3pt(
  dat,
  x,
  y,
  x.lab = NULL,
  y.lab = NULL,
  adj = -0.12,
  dir = TRUE,
  pch = 20,
  col = "grey40",
  ...
)

Arguments

dat

Data frame

x

Column name assigned the x axis

y

Column name assigned the y axis

x.lab

X label for output plot

y.lab

Y label for output plot

adj

Adjustment parameter for y label

dir

Boolean indicating if suggested ladder of power direction should be displayed

pch

Plot point size as a fraction (can be larger than 1.0)

col

Plot point color

...

Other parameters passed to the graphics::plot function.

Details

Outputs a plot showing the three point summary as well as a list of parameters:

  • hsrtio: The ratio between both slopes. A value close to one suggests that no transformation is needed.

  • xmed: The x-coordinate values for the three summary points.

  • ymed: The y-coordinate values for the three summary points.

References

  • Velleman, P. F., and D. C. Hoaglin. 1981. Applications, Basics and Computing of Exploratory Data Analysis. Boston: Duxbury Press.

  • D. C. Hoaglin, F. Mosteller, and J. W. Tukey. 1983. Understanding Robust and Exploratory Data Analysis. Wiley.

  • Tukey, John W. 1977. Exploratory Data Analysis. Addison-Wesley.

Examples


hsratio <- eda_3pt(cars, speed, dist)

hsratio <- eda_3pt(cars, speed, dist^(1/3), y.lab=expression("Dist"^{1/3}), adj=-0.1)