powered by
Takes in variable and finds mode, works with sampling weights. Makes use of the freq function, part of the descr package.
wtd.mode(x, w, data, ...)
Returns the modal value(s) of the variable, if mode exists
A variable
(Optional) Sampling weights of variable
(Optional) A dataset
(Optional) Additional arguments pass to descr::freq function
library(RCPA3) wtd.mode(x=nes$angry.about.things, w=nes$wt) wtd.mode(x=nes$angry.about.things) wtd.mode(x=nes$discrim.vs.men, w=nes$wt) wtd.mode(x=nes$discrim.vs.men)
Run the code above in your browser using DataLab