wtd.median {RCPA3} | R Documentation |
Find Median of Variable with Option to Weight Observations
Description
Takes in variable and finds median, works with sampling weights. Makes use of the wtd.quantile function, part of the Hmisc package.
Usage
wtd.median(x, w = NULL, data, ...)
Arguments
x |
A variable |
w |
(Optional) Sampling weights of variable |
data |
(Optional) Name of dataset that contains x (and w) variable |
Value
Returns the median value of the variable
Examples
library(RCPA3)
wtd.median(x=nes$approve.pres.hc, w=nes$wt)
wtd.median(x=nes$approve.pres.hc)
[Package RCPA3 version 1.2.1 Index]