# 2000 General Social Survey-Sex and Party affiliation
# Agresti (1996) p. 38:
gss <- data.frame(
expand.grid(sex=c("female", "male"),
party=c("dem", "indep", "rep")),
count=c(762,484,327,239, 468,477))
# expand it:
# GSS <- gss[rep(1:nrow(gss), gss[["count"]]),]
GSS = untable(gss, freq = "count")
calc.LR(GSS$party, GSS$sex)
Run the code above in your browser using DataLab