condTbl {cna} | R Documentation |
Given a solution object x
produced by cna
, msc(x)
extracts all minimally sufficient conditions, asf(x)
all atomic solution formulas, and csf(x, n)
extracts at least n
complex solution formulas. All solution attributes (details
) that are saved in x
are recovered as well. The three functions return a data frame with the additional class attribute condTbl
.
as.condTbl
reshapes the output produced by condition
in such a way as to make it identical to the output returned by msc
, asf
, and csf
.
condTbl
executes condition
and returns a concise summary table featuring consistencies and coverages.
msc(x, details = x$details) asf(x, details = x$details, warn_details = TRUE) csf(x, n = 20, tt = x$truthTab, details = x$details, asfx = asf(x, details, warn_details = FALSE)) ## S3 method for class 'condTbl' print(x, digits = 3, quote = FALSE, row.names = TRUE, ...) condTbl(...) as.condTbl(x, ...)
x |
Object of class “cna”. In |
details |
Either |
warn_details |
Logical; if |
n |
The minimal number of |
tt |
A |
asfx |
Object of class “condTbl” resulting from |
digits |
Number of digits to print in consistency, coverage, exhaustiveness, faithfulness, and coherence scores. |
quote, row.names |
As in |
... |
All arguments in |
Depending on the processed data, the solutions output by cna
are often ambiguous, to the effect that many atomic and complex solutions fit the data equally well. To facilitate the inspection of the cna
output, however, the latter standardly returns only 5 minimally sufficient conditions and 5 atomic and complex solution formulas for each outcome. msc
can be used to extract all minimally sufficient conditions from an object x
of class “cna”, asf
to extract all atomic solution formulas, and csf
to extract at least n
complex solution formulas from x
. All solution attributes (details
) that are saved in x
are recovered as well.
The outputs of msc
, asf
, and csf
can be further processed by the condition
function.
The argument digits
applies to the print
function. It determines how many digits of consistency, coverage, exhaustiveness, faithfulness, and coherence scores are printed. The default value is 3.
The function as.condTbl
takes a list of objects of class “cond” that are returned by the condition
function as input, and reshapes these objects in such a way as to make them identical to the output returned by msc
, asf
, and csf
.
condTbl(...)
is identical with as.condTbl(condition(...))
.
msc
, asf
, csf
, and as.condTbl
return objects of class “condTbl”, a data.frame
which features the following components:
outcome : | the outcomes |
condition : | the relevant conditions or solutions |
consistency : | the consistency scores |
coverage : | the coverage scores |
complexity : | the complexity scores |
inus : | whether the solutions are inus |
exhaustiveness : | the exhaustiveness scores |
faithfulness : | the faithfulness scores |
coherence : | the coherence scores |
redundant : | whether the csf contain redundant proper parts |
The latter five measures are optional and will be appended to the table according to the setting of the argument details
.
Lam, Wai Fung, and Elinor Ostrom. 2010. “Analyzing the Dynamic Complexity of Development Interventions: Lessons from an Irrigation Experiment in Nepal.” Policy Sciences 43 (2):1-25.
cna
, truthTab
, condition
, minimalizeCsf
, d.irrigate
# 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. csf(cna2.irrigate, asfx = cna2.irrigate.asf, details = FALSE) # Generate the first 191 csf. csf(cna2.irrigate, asfx = cna2.irrigate.asf, 191, details = FALSE) # Also extract exhaustiveness scores. csf(cna2.irrigate, asfx = cna2.irrigate.asf, 191, details = "e") # Generate all 684 csf. csf(cna2.irrigate, asfx = cna2.irrigate.asf, 684) # Return solution attributes with 5 digits. print(cna2.irrigate.asf, digits = 5) # Another example to the same effect. print(csf(cna(d.irrigate, ordering = list(c("A","R","F","L","C"),"W"), maxstep = c(4, 4, 12), cov = 0.9)), digits = 5) # 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