Learn R Programming

normref (version 0.0.0.1)

plot_normtable: Plot norm curves from a NormTable object

Description

plot_normtable() plots norm curves as a function of the predictor, along with the sample data, based on a NormTable object.

Usage

plot_normtable(
  normtable,
  lty = 1,
  lwd = 3,
  pch = 1,
  cex = 0.5,
  col = "aquamarine4",
  xlab = "Age",
  ylab = "Percentile",
  ...
)

Value

graphical output and the ggplot object used to create it.

Arguments

normtable

a NormTable object (created by normtable_create() with new_data = FALSE).

lty

line type(s) for curves.

lwd

line width(s) for curves.

pch

symbol for sample points.

cex

point size (default: 0.5).

col

point colour (default: "aquamarine4").

xlab

x-axis label (default: "Age").

ylab

y-axis label (default: "Percentile").

...

additional graphical parameters passed to graphics::plot(), graphics::lines(), or graphics::points().

See Also

normtable_create()

Examples

Run this code
# \donttest{
data("ids_data")

mydata_BB_y14 <- shape_data(
  data       = ids_data,
  age_name   = "age",
  score_name = "y14",
  family     = "BB"
)

mod_BB_y14 <- fb_select(
  data       = mydata_BB_y14,
  age_name   = "age",
  score_name = "shaped_score",
  family     = "BB",
  selcrit    = "BIC"
)

norm_mod_BB_y14 <- normtable_create(
  model      = mod_BB_y14,
  data       = mydata_BB_y14,
  age_name   = "age",
  score_name = "shaped_score"
)

# default plot
plot_normtable(norm_mod_BB_y14)
# }

Run the code above in your browser using DataLab