qq_plot: Quantile-quantile plots against the standard Normal...

View source: R/plot_functions.R

qq_plotR Documentation

Quantile-quantile plots against the standard Normal distribution.

Description

qq_plot constructs quantile-quantile plots against the standard normal distribution (also known as quantile-normal plots).

Usage

qq_plot(
  object = NULL,
  formula = NULL,
  data = NULL,
  pch = 20,
  col = "indianred3",
  ylab = NULL,
  ...
)

Arguments

object

When chaining, this holds an object produced in the earlier portions of the chain. Most users can safely ignore this argument. See details and examples.

formula

A formula with shape: ~ x or ~ x|z where x is a numerical variable and z is a factor.

data

A data frame where the variables in the formula can be found.

pch

Point character passed to gf_qq.

col

Colour of the reference line, passed to gf_line.

ylab

Optional character passed as label for the y-axis.

...

Further arguments passed to gf_qq.

Examples

data(kfm, package = "ISwR")
require(sjlabelled, quietly = TRUE)
kfm <- kfm |>
  var_labels(
    dl.milk = "Breast-milk intake (dl/day)",
    sex = "Sex",
    weight = "Child weight (kg)",
    ml.suppl = "Milk substitute (ml/day)",
    mat.weight = "Maternal weight (kg)",
    mat.height = "Maternal height (cm)"
  )

kfm |>
  qq_plot(~dl.milk)

qq_plot(~ dl.milk | sex, data = kfm)

pubh documentation built on Oct. 8, 2024, 9:08 a.m.