View source: R/helper.functions.r
wtd.median | R Documentation |
Takes in variable and finds median, works with sampling weights. Makes use of the wtd.quantile function, part of the Hmisc package.
wtd.median(x, w = NULL, data, ...)
x |
A variable |
w |
(Optional) Sampling weights of variable |
data |
(Optional) Name of dataset that contains x (and w) variable |
Returns the median value of the variable
library(RCPA3)
wtd.median(x=nes$approve.pres.hc, w=nes$wt)
wtd.median(x=nes$approve.pres.hc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.