# NOT RUN {
# Crisp-set data from Lam and Ostrom (2010) on the impact of development interventions
# ------------------------------------------------------------------------------------
# CNA with causal ordering that corresponds to the ordering in Lam & Ostrom (2010); coverage
# cut-off at 0.9 (consistency cut-off at 1).
cna.irrigate <- cna(d.irrigate, ordering = list(c("A","R","F","L","C"),"W"), cov = .9,
maxstep = c(4, 4, 12), details = TRUE)
cna.irrigate
# The previous function call yields a total of 12 complex solution formulas, only
# 5 of which are returned in the default output.
# Here is how to extract all 12 complex solution formulas along with all
# solution attributes.
csf(cna.irrigate)
# With only the standard attributes plus exhaustiveness and faithfulness.
csf(cna.irrigate, details = c("e", "f"))
# Extract all atomic solution formulas.
asf(cna.irrigate)
# Extract all minimally sufficient conditions.
msc(cna.irrigate)
# Extract only the conditions (solutions).
csf(cna.irrigate)$condition
asf(cna.irrigate)$condition
msc(cna.irrigate)$condition
# A CNA of d.irrigate without a presupposed ordering is even more ambiguous.
cna2.irrigate <- cna(d.irrigate, cov = .9, maxstep = c(4,4,12), details = TRUE)
# To speed up the construction of complex solution formulas, first extract atomic solutions
# and then pass these asf to csf.
cna2.irrigate.asf <- asf(cna2.irrigate)
# By default, at least 20 csf are generated.
# }
# NOT RUN {
csf(cna2.irrigate, asfx = cna2.irrigate.asf, details = FALSE)
# }
# NOT RUN {
# Generate the first 191 csf.
# }
# NOT RUN {
csf(cna2.irrigate, asfx = cna2.irrigate.asf, 191, details = FALSE)
# }
# NOT RUN {
# Also extract exhaustiveness scores.
# }
# NOT RUN {
csf(cna2.irrigate, asfx = cna2.irrigate.asf, 191, details = "e")
# }
# NOT RUN {
# Generate all 684 csf.
# }
# NOT RUN {
csf(cna2.irrigate, asfx = cna2.irrigate.asf, 684)
# }
# NOT RUN {
# Return solution attributes with 5 digits.
print(cna2.irrigate.asf, digits = 5)
# Another example to the same effect.
# }
# NOT RUN {
print(csf(cna(d.irrigate, ordering = list(c("A","R","F","L","C"),"W"),
maxstep = c(4, 4, 12), cov = 0.9)), digits = 5)
# }
# NOT RUN {
# Feed the outputs of msc, asf, and csf into the condition function to further inspect the
# properties of minimally sufficient conditions and atomic and complex solution formulas.
condition(msc(cna.irrigate)$condition, d.irrigate)
condition(asf(cna.irrigate)$condition, d.irrigate)
condition(csf(cna.irrigate)$condition, d.irrigate)
# Reshape the output of the condition function in such a way as to make it identical to the
# output returned by msc, asf, and csf.
as.condTbl(condition(msc(cna.irrigate)$condition, d.irrigate))
as.condTbl(condition(asf(cna.irrigate)$condition, d.irrigate))
as.condTbl(condition(csf(cna.irrigate)$condition, d.irrigate))
condTbl(csf(cna.irrigate)$condition, d.irrigate) # Same as preceding line
# }
Run the code above in your browser using DataLab