Learn R Programming

Rrepest (version 1.5.4)

weighted.iqr: Weighted inter-quantile range

Description

Computes the weighted inter-quantile range of a numeric vector.

Usage

weighted.iqr(x, w = rep(1, length(x)), rang = c(0.25, 0.75))

Value

Scalar containing the inter-quantile range

Arguments

x

(numeric vector) Variable of interest for which to compute the inter-quantile range

w

(numeric vector) Vector with the weights

rang

(numeric vector) Two numbers between 0 and 1 indicating the desired inter-quantile range

Examples

Run this code
weighted.iqr(x = mtcars$mpg, w = mtcars$wt,  rang = c(.5,.9))
  

Run the code above in your browser using DataLab