wtd.mode: Find Mode of Variable

Description Usage Arguments Details Value Examples

View source: R/wtd.mode.r

Description

Takes in variable and finds mode, works with sampling weights

Usage

1

Arguments

x

A variable

weights

Sampling weights of variable (optional)

Details

Makes use of the freq function, part of the descr package

Value

Returns the modal value of the variable

Examples

1
2
3
   library(poliscidata)
   
   wtd.mode(gss$zodiac, gss$wtss)

Example output

[1] "LEO"

poliscidata documentation built on July 8, 2020, 6:23 p.m.