zto1 {mgcViz}R Documentation

Constructing a decreasing function from (0,1) to (0,1)

Description

This function returns a non-increasing function from (0, 1) to (0, 1). It takes inputs o, a and m, and it returns the function f(p)={z=max(0, p-o); return(max((1-z)^a, m))}. The function f(p) can be used, for instance, for transforming p-values before plotting them.

Usage

zto1(o, a, m)

Arguments

o, a, m

the output function's parameters, as described above.

Value

A function whose parameters o, a and m have been fixed.

Examples

library(mgcViz)
x <- seq(0, 1, by = 0.01)
plot(x, zto1(0.05, 2, 0.1)(x), ylim = c(0, 1), type = 'l')
lines(x, zto1(0.05, 1, 0.2)(x), col = 2)
lines(x, zto1(0.1, 3, 0)(x), col = 3)

[Package mgcViz version 0.1.11 Index]