foldp: Title Function to calculate ratio of 'p+eps' to '1-p+eps'.

View source: R/foldp.R

foldpR Documentation

Title Function to calculate ratio of p+eps to 1-p+eps.

Description

This is a convenience function that returns \frac{p+\epsilon}{1-p+\epsilon}. It calculates the argument that is supplied to the log function in Tukey's ‘flog’.

Usage

foldp(p, eps)

Arguments

p

Proportion

eps

Offset. The choice eps=0.01 has the same effect as replacing \frac{r}{n-r} by \frac{r+0.5}{n-r+0.5} when n=50, or by \frac{r+1}{n-r+1} when n=100

Value

(p+eps)/(1-p+eps)

Examples

foldp(c(0.2,0.75), 0)

jhmaindonald/qra-R-package documentation built on Nov. 16, 2023, 2:39 p.m.