qqladder: Ladder-of-powers quantile-normal plots

View source: R/qqladder.R

qqladderR Documentation

Ladder-of-powers quantile-normal plots

Description

Explore Tukey's ladder of powers graphically using quantile plots to identify a transform that converts varinto a normally distributed variable.

This is intended to replicate the qladder command in Stata.

Usage

qqladder(
  data,
  var,
  point_color = "cyan4",
  line_color = "black",
  line_type = "solid"
)

Arguments

data

A tibble or data frame.

var

A numeric vector of data values.

point_color

Color for the quantile points (default = "cyan4").

line_color

Color for the normal line (default = "black").

line_type

Line type for the normal line (default = "solid").

Value

A tibble.

References

https://www.stata.com/manuals/rladder.pdf

Examples


qqladder(data = auto,
         var = mpg)

qqladder(data = auto,
         var = mpg,
         point_color = "purple")

qqladder(data = auto,
         var = weight,
         point_color = "purple",
         line_type = "dashed")


# To adjust the theme of all of the patches using patchwork package and an &
# instead of +
qqladder(data = auto,
         var = weight) &
  ggplot2::theme_classic()



emilelatour/lamisc documentation built on April 9, 2024, 10:33 a.m.