powered by
Takes in variable and finds median, works with sampling weights
wtd.median(x, weights = NULL)
A variable
Sampling weights of variable (optional)
Returns the median value of the variable
Makes use of the wtd.quantile function, part of the Hmisc package
# NOT RUN { library(poliscidata) wtd.median(nes$budget_deficit_x, nes$wt) # }
Run the code above in your browser using DataLab