d.low: Low values are desirable

Description Usage Arguments Details Value See Also Examples

View source: R/d.low.R

Description

Maps a numeric variable to a 0-1 scale such that low values are desirable.

Usage

1
d.low(x, cut1, cut2, des.min = 0, des.max = 1, scale = 1)

Arguments

x

Vector of numeric or integer values.

cut1, cut2

Values of the original data that define where the desirability function changes.

des.min, des.max

Minimum and maximum desirability values. Defaults to zero and one, respectively.

scale

Controls how steeply the function increases or decreases.

Details

Values less than cut1 will have a high desirability. Values greater than cut2 will have a low desirability. Values between cut1 and cut2 will have intermediate values.

Value

Numeric vector of desirability values.

See Also

d.high, d.4pl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(1)
x <- rnorm(1000, mean=100, sd =5) # generate data
d <- d.low(x, cut1=90, cut2=110, scale=1)

# plot data
hist(x, breaks=30)
# add line
des.line(x, "d.low", des.args=c(cut1=90, cut2=110, scale=1))

hist(x, breaks=30)
des.line(x, "d.low", des.args=c(cut1=90, cut2=110, des.min=0.1,
des.max=0.95, scale=1.5))

stanlazic/desiR documentation built on May 26, 2017, 4:36 p.m.