wtd.median {poliscidata} | R Documentation |
Find Median of Variable
Description
Takes in variable and finds median, works with sampling weights
Usage
wtd.median(x, weights = NULL)
Arguments
x |
A variable |
weights |
Sampling weights of variable (optional) |
Details
Makes use of the wtd.quantile function, part of the Hmisc package
Value
Returns the median value of the variable
Examples
library(poliscidata)
wtd.median(nes$budget_deficit_x, nes$wt)
[Package poliscidata version 2.3.0 Index]