Learn R Programming

poliscidata (version 2.3.0)

wtd.mode: Find Mode of Variable

Description

Takes in variable and finds mode, works with sampling weights

Usage

wtd.mode(x, weights = NULL)

Arguments

x

A variable

weights

Sampling weights of variable (optional)

Value

Returns the modal value of the variable

Details

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

Examples

Run this code
# NOT RUN {
   library(poliscidata)
   
   wtd.mode(gss$zodiac, gss$wtss)
# }

Run the code above in your browser using DataLab