Learn R Programming

MultiDiscreteRNG (version 0.1.0)

calc.bin.prob.B: Collapse binomial data outcomes to binary variable

Description

This function computes the binary probability and identifies a threshold to split discrete binomial outcomes. It summarizes each binomial distribution by providing the probability mass function, the probability of exceeding a median-based threshold, and the location of the threshold for the binary split.

Usage

calc.bin.prob.B(B.n.vec, B.prob.vec)

Value

A list containing the binary probability vector, the list of binomial probability mass functions for each variable, and the corresponding threshold indices

Arguments

B.n.vec

Numeric vector of trial counts for each variable

B.prob.vec

Numeric vector of success probabilities for each variable

Examples

Run this code
B.n.vec <- c(3, 4, 5)
B.prob.vec <- c(0.5, 0.5, 0.5)
p <- calc.bin.prob.B(B.n.vec, B.prob.vec)

Run the code above in your browser using DataLab