# csQCA using Krook (2010)
#-------------------------
data(d.Kro)
head(d.Kro)
# find all minimally necessary combinations with an inclusion score
# of at least 0.9 and coverage score of at least 0.65
Kro.ss <- superSubset(d.Kro, outcome = "WNP", incl.cut = 0.9,
cov.cut = 0.65)
Kro.ss
# Venn diagram of combinations;
# first extract membership scores
head(Kro.coms <- Kro.ss$coms)
require(VennDiagram)
vn.Kro.nec <- venn.diagram(
x = list(
"WNP" = which(d.Kro$WNP == 1),
"wm+LP" = which(Kro.coms[, 1] == 1),
"WS+LP" = which(Kro.coms[, 2] == 1),
"ES+LP" = which(Kro.coms[, 3] == 1)),
filename = NULL,
cex = 2.5, cat.cex = 2, cat.pos = c(-10, 10, 0, 0),
cat.dist = c(0.25, 0.25, 0.12, 0.12),
fill = gray(c(0.3, 0.5, 0.7, 0.9))
)
grid.draw(vn.Kro.nec)
# mvQCA using Hartmann and Kemmerzell (2010)
#-------------------------------------------
data(d.HK)
head(d.HK)
# find all minimally necessary combinations with perfect inclusion
HK.ss <- superSubset(d.HK, outcome = "PB",
conditions = c("C", "F", "T", "V"))
HK.ss
# combination membership scores for all cases (only first ten lines)
HK.ss$coms[1:10, , drop = FALSE]
# fsQCA using Emmenegger (2011)
#------------------------------
data(d.Emm)
head(d.Emm)
# find all minimally sufficient combinations with an inclusion score
# of at least 0.9 and coverage score of at least 0.4; also return
# PRI (proportional reduction in inconsistency) scores
Emm.ss <- superSubset(d.Emm, outcome = "JSR", relation = "suf",
incl.cut = 0.9, cov.cut = 0.4, PRI = TRUE)
Emm.ss
# same criteria, but for the negation of the outcome
Emm.ss.n <- superSubset(d.Emm, outcome = "JSR", neg.out = TRUE,
relation = "suf", incl.cut = 0.9, cov.cut = 0.4, use.tilde = TRUE)
Emm.ss.n
# plot all four combinations
head(Emm.coms <- Emm.ss.n$coms)
par(mfrow = c(2, 2))
for(i in 1:4){
plot(Emm.coms[, i], 1 - d.Emm$JSR, pch = 19, ylab = "~JSR",
xlab = names(Emm.coms)[i], xlim = c(0, 1), ylim = c(0, 1),
main = paste("Combination", print(i)))
mtext(paste(
"Inclusion = ", round(Emm.ss.n$incl.cov$incl[i], 3),
"; Coverage = ", round(Emm.ss.n$incl.cov$cov[i], 3)),
cex = 0.7, line = 0.4)
abline(h = 0.5, lty = 2, col = gray(0.5))
abline(v = 0.5, lty = 2, col = gray(0.5))
abline(0, 1)
}
Run the code above in your browser using DataLab