calc_logit_from_p: Calculate logit (log odds) from probability

Description Usage Arguments Value Examples

Description

Calculate logit (log odds) from probability

Usage

1
calc_logit_from_p(probability, offset_for_01 = NULL)

Arguments

probability

A numerical vector (or single number) with probabilities between 0 and 1.

offset_for_01

A decimal number to add to probability 0 or subtract from 1 to make calculation of logit possible.

Value

A numerical vector (or single number) representing the logit (log odds).

Examples

1
2
3
4
calc_logit_from_p(0.2)

probabilities <- c(0.00, 0.07, 0.12,0.74, 1.00)
calc_logit_from_p(probabilities, offset_for_01 = 0.001)

bennysalo/predict-recidivism documentation built on May 29, 2019, 10:34 a.m.