pubh (version 1.1.16)

qq_plot: 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

Run this code
# NOT RUN {
data(kfm, package = "ISwR")
require(sjlabelled)
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) %>%
  axis_labs()

qq_plot(~ dl.milk|sex, data = kfm) %>%
  axis_labs()
# }

Run the code above in your browser using DataCamp Workspace