# -----
# Lipset binary crisp data
data(LC)
# the associated truth table
ttLC <- truthTable(LC, "SURV", sort.by = "incl, n")
ttLC
# conservative solution (Rihoux & De Meur 2009, p.57)
cLC <- eqmcc(ttLC)
cLC
# view the Venn diagram for the associated truth table
library(venn)
venn(cLC)
# add details and case names
eqmcc(ttLC, details = TRUE, show.cases = TRUE)
# negating the outcome
ttLCn <- truthTable(LC, "~SURV", sort.by = "incl, n")
eqmcc(ttLCn)
# using a tilde instead of upper/lower case names
eqmcc(ttLCn, use.tilde = TRUE)
# parsimonious solution, positive output
pLC <- eqmcc(ttLC, include = "?", details = TRUE, show.cases = TRUE)
pLC
# the associated simplifying assumptions
pLC$SA
# parsimonious solution, negative output
pLCn <- eqmcc(ttLCn, include = "?", details = TRUE, show.cases = TRUE)
pLCn
# -----
# Lipset multi-value crisp data (Cronqvist & Berg-Schlosser 2009, p.80)
data(LM)
# truth table
ttLM <- truthTable(LM, "SURV", conditions = "DEV, URB, LIT, IND",
sort.by = "incl", show.cases = TRUE)
# conservative solution, positive output
eqmcc(ttLM, details = TRUE, show.cases = TRUE)
# parsimonious solution, positive output
eqmcc(ttLM, include = "?", details = TRUE, show.cases = TRUE)
# negate the outcome
ttLMn <- truthTable(LM, "~SURV", conditions = "DEV, URB, LIT, IND",
sort.by = "incl", show.cases = TRUE)
# conservative solution, negative output
eqmcc(ttLMn, details = TRUE, show.cases = TRUE)
# parsimonious solution, positive output
eqmcc(ttLMn, include = "?", details = TRUE, show.cases = TRUE)
# -----
# Lipset fuzzy sets data (Ragin 2009, p.112)
data(LF)
# truth table using a very low inclusion cutoff
ttLF <- truthTable(LF, "SURV", incl.cut = 0.7,
show.cases = TRUE, sort.by="incl")
# conservative solution
eqmcc(ttLF, details = TRUE, show.cases = TRUE)
# parsimonious solution
eqmcc(ttLF, include = "?", details = TRUE, show.cases = TRUE)
# intermediate solution using directional expectations
iLF <- eqmcc(ttLF, include = "?", details = TRUE, show.cases = TRUE,
dir.exp = "1,1,1,1,1")
# -----
# Cebotari & Vink (2013, 2015)
data(CVF)
ttCVF <- truthTable(CVF, outcome = "PROTEST", incl.cut = 0.8,
show.cases = TRUE, sort.by = "incl, n")
pCVF <- eqmcc(ttCVF, include = "?", details = TRUE, show.cases = TRUE)
pCVF
# inspect the PI chart
pCVF$PIchart
# DEMOC*ETHFRACT*poldis is dominated by DEMOC*ETHFRACT*GEOCON
# using row dominance to solve the PI chart
pCVFrd <- eqmcc(ttCVF, include = "?", row.dom = TRUE,
details = TRUE, show.cases = TRUE)
# plot the prime implicants on the outcome
pims <- pCVFrd$pims
par(mfrow = c(2, 2))
for(i in 1:4) {
XYplot(pims[, i], CVF$PROTEST, cex.axis = 0.6)
}
# -----
# temporal QCA (Ragin & Strand 2008)
data(RS)
eqmcc(RS, "REC", details = TRUE, show.cases = TRUE)Run the code above in your browser using DataLab