dot-create_triangle_dist: Create Triangular Distribution

.create_triangle_distR Documentation

Create Triangular Distribution

Description

Creates a discrete step/triangular distribution that can be used to sample values for sensitivity or specificity of a reference test or prevalence of a population.

Usage

.create_triangle_dist(
  m,
  w,
  h,
  threestate = FALSE,
  suspect = 2/3,
  step_size = 0.005,
  p_proportion = TRUE
)

Arguments

m

This is a point estimate for the parameter in which you are obtaining the distribution, e.g. sensitivity, specificity, or prevalence.

w

vector A vector that provides the half widths of the 3 regions, (w1 closest, w3 farthest).

h

vector A vector of "y" (pseudo-value until scaled to be a probability) corresponding to the height of the shoulder and the height of the plateau.

threestate

logical (TRUE/FALSE) Indicates whether or not there is a "suspect" region (i.e. positive/suspect/negative).

suspect

A fraction that indicates what percentage of the remaining probability would be assigned to the suspect region. For instance, if the function gives sensitivity and then the probability of "suspect" is (1 - sensitivity) * suspect.

step_size

distance between the "x" in the discrete distribution, resolution of possible observations of the created distribution.

p_proportion

whether to express "p" as a proportion of its sum.

Value

data.frame of "x", "y", and "p".

Author(s)

DiagTestKit-package


ABS-dev/DiagTestKit documentation built on Sept. 23, 2024, 9:37 a.m.