Learn R Programming

immer (version 1.5-13)

probs2logits: Conversion of Probabilities into Logits

Description

Converts probabilities into logits

Usage

probs2logits(probs)

logits2probs(y)

Value

A vector with logits or probabilities

Arguments

probs

Vector containing probabilities

y

Vector containing logits

Examples

Run this code
#############################################################################
# EXAMPLE 1: Probability-logit-conversions: a toy example
#############################################################################

# define vector of probabilities
probs <- c( .3, .25, .25, .2)
sum(probs)

# convert probabilities into logits
y <- immer::probs2logits( probs )
# retransform logits into probabilities
immer::logits2probs(y)

Run the code above in your browser using DataLab