median_dist: Calculate the median of a habitual intake distribution

View source: R/median_dist.R

median_distR Documentation

Calculate the median of a habitual intake distribution

Description

This function calculates the median of a habitual intake distribution. It handles gamma and log-normal distributions.

Usage

median_dist(shape = NULL, rate = NULL, meanlog = NULL, sdlog = NULL, plot = F)

Arguments

shape

Shape parameter for gamma distribution

rate

Rate parameter for gamma distribution

meanlog

Mean parameter for gamma distribution

sdlog

Standard deviation parameter for gamma distribution

plot

Plot (T/F)?

Value

The median of the distribution

Examples

median_dist(shape=1, rate=0.5)
median_dist(shape=1, rate=0.5, plot=T)
median_dist(meanlog=3, sdlog=1)
median_dist(meanlog=3, sdlog=1, plot=T)

cfree14/nutriR documentation built on Oct. 31, 2024, 6:27 p.m.