Med: Calculate lower and upper median

View source: R/misc.R

MedR Documentation

Calculate lower and upper median

Description

Calculates the lower and and median of a vector as proposed in Comment 4.2 in the paper.

Usage

Med(x)

Arguments

x

A numeric vector.

Value

A list with the upper, lower, and usual median (where the latter is the average of the former two).

References

Chernozhukov V., Demirer M., Duflo E., Fernández-Val I. (2020). “Generic Machine Learning Inference on Heterogenous Treatment Effects in Randomized Experiments.” arXiv preprint arXiv:1712.04802. URL: https://arxiv.org/abs/1712.04802.

Examples

set.seed(1)
x <- runif(100)
Med(x)


mwelz/GenericML documentation built on Dec. 24, 2024, 7:39 p.m.