Learn R Programming

poliscidata (version 2.3.0)

somersD: Calculates Somer's D

Description

This function calculates the Somer's D measure of association statistic. This function makes use of the svytable function from the survey package.

Usage

somersD(formula, data)

Arguments

formula

A formula in the form ~ indepvar + depvar

data

A design dataset (e.g. gssD, nesD, statesD, or worldD)

Value

Return Somer's D measure of association statistic, a number between 0 and 1.

Examples

Run this code
# NOT RUN {
   library(poliscidata)
   
   somersD(~ dem_educ3 + envjob_3, nesD)
# }

Run the code above in your browser using DataLab