conf_envelope: Create confidence envelopes from a 'uhc_data_frame'

View source: R/uhc_plots.R

conf_envelopeR Documentation

Create confidence envelopes from a uhc_data_frame

Description

Simplifies sampled distributions in a uhc_data_frame to confidence envelopes

Usage

conf_envelope(x, levels = c(0.95, 1))

Arguments

x

⁠[uhc_data]⁠ An object of class uhc_data_frame, as returned by the function as.data.frame.uhc_data().

levels

⁠[numeric]⁠ A numeric vector specifying the desired confidence levels. Defaults to c(0.95, 1) to create 95% and 100% confidence intervals.

Details

This can dramatically improve plotting time for UHC plots by simplifying the many sampled lines down to the boundaries of a polygon.

Value

Returns a data.frame with columns:

  • var: The name of the variable

  • x: The x-coordinate of the density plot (the value of var).

  • label: If var is a factor, the label for the value given by x.

  • U: The y-coordinate of the density plot for the use distribution.

  • A: The y-coordinate of the density plot for the availability distribution.

  • ⁠CI*_lwr⁠: The lower bound of the confidence envelope for the corresponding confidence level.

  • ⁠CI*_upr⁠: The upper bound of the confidence envelope for the corresponding confidence level.

Author(s)

Brian J. Smith

See Also

prep_uhc(), plot.uhc_envelopes()


jmsigner/amt documentation built on April 24, 2024, 9:16 a.m.