NOW AVAILABLE: Essentials of Poltical Analysis 7e | R Companion 4e | SPSS 7e | Stata 5e | Excel 1e 🎵
NOW AVAILABLE: Essentials 7e | R Companion 4e | SPSS 7e | Stata 5e | Excel 1e 🎵
NOW AVAILABLE: Essentials 7e | More Textbooks 🎵

Run R Code Example Online

# Descriptive Statistics for Ordinal-Level Variable
#############################################################
library("poliscidata")
#############################################################

# The values of ordinal-level variables can be compared; there is an order to them.
# The immigpo_level variable in the NES dataset is an example of a ordinal-level variable.
# There are more tools for description than we have for nominal-level variables.

cat("Frequency Distribution Table:\n")
freqC(nes$immigpo_level, nes$wt)

cat("\nMode:\n")
wtd.mode(nes$immigpo_level, nes$wt)

cat("\nMedian:\n")
wtd.median(nes$immigpo_level, nes$wt)