View source: R/detailMeasures.R
| detailMeasures | R Documentation |
detailMeasures can calculate all available measures for sufficiency and necessity evaluation (e.g. prevalence-adjusted consistency and antecedent-adjusted coverage), independently of whether they are used for model building, as well as additional solution attributes (e.g. exhaustiveness or faithfulness).
detailMeasures(
cond, x, what = TRUE,
inus.def = "implication", inus.func.minim = FALSE,
cycle.type = c("factor", "value"), ...)
cond |
Character vector specifying a set of minimally sufficient conditions (msc) or solution formulas (asf or csf) in the standard format
(cf. |
x |
Data frame, |
what |
Character vector specifying the evaluation measures and additional solution attributes to be computed. Possible elements are all the measures in |
inus.def, inus.func.minim |
Passed to |
cycle.type |
Character string specifying what type of cycles to be detected: |
... |
Further arguments passed to the |
The cna function can build its models using one out of four measures for sufficiency evaluation and one out of four measures for necessity evaluation (cf. section 3.2 of the cna package vignette, call vignette("cna"), or De Souter & Baumgartner 2025). The measures that are not used for model building may still be useful for cross-validation or selecting among the resulting models. The detailMeasures function can calculate all these measures, independently of whether they are used for model building. The measures can be passed to the detailMeasures function by their names or aliases in showConCovMeasures.
In addition, detailMeasures computes exhaustiveness, faithfulness, and coherence, which are three measures for overall data fit (cf. sections 5.2 and 5.3 of vignette("cna")). It identifies formulas with cyclic substructures and determines whether they have inus form or redundant parts. How much information these two attributes carry depends on how the models were built: csf returned by cna at its default inus.only = TRUE are free of structural redundancies, so redundant is FALSE and inus TRUE for all of them; models built with inus.only = FALSE or supplied by the user need not be either. These additional solution attributes are passed to the detailMeasures function by their names in showDetailMeasures.
Notes: First, coherence, fm_structural, fm_empirical and redundant apply to complex solution formulas (csf) only; when they are requested for asf, placeholder values are returned (coherence is set to 1, redundant to FALSE, and the two fm* measures to NA). inus, cyclic, exhaustiveness and faithfulness, by contrast, are computed and meaningful for msc, asf, and csf alike. Second, redundant and inus are interdependent as follows: if redundant is TRUE for a csf, then inus is FALSE for that csf (see example below). Third, whether the csf-only attributes are computed or returned as placeholders depends on the class of cond: conditions from a solution table (cf. cna-solutions) carry the class stdAtomic or stdComplex, but if that class is dropped—for instance by applying c() to the vector—the type is re-derived from the syntax, and a csf that consists of a single asf is treated as an asf.
An object of class “condTbl”, a data.frame with the columns outcome and condition followed by the requested measures and solution attributes.
De Souter, Luna and Michael Baumgartner. 2025. “New sufficiency and necessity measures for model building with Coincidence Analysis.” Zenodo. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5281/zenodo.13619580")}
cna, msc, asf, csf, configTable, condition, cyclic, showMeasures, showConCovMeasures, showDetailMeasures, func_minim, redundant
cond <- csf(cna(d.women))$condition
detailMeasures(cond, d.women)
detailMeasures(cond, d.women, what = c("ex", "fa", "PAcon", "PACcov", "AACcon",
"AAcov"))
# The functional-minimality measures are computed for csf only; for the asf in
# the first row, the placeholder value NA is returned.
detailMeasures(c("ES*ws*WNP -> QU",
"(ES + WM <-> QU)*(WS + ES*WM + QU*LP + WM*LP <-> WNP)"),
d.women, what = c("fm_empirical", "fm_structural"))
# Mixing msc, asf and csf.
detailMeasures(c("ES*ws*WNP -> QU", "QU*LP + WM*LP <-> WNP",
"(ES + WM <-> QU)*(WS + ES*WM + QU*LP + WM*LP <-> WNP)"),
d.women)
# In the following example, the csf is not inus, although all its component asfs are:
cond <- c("(f+a*D <-> C)", "(C+A*B <-> D)", "(c+a*E <-> F)",
"(f+a*D <-> C)*(C+A*B <-> D)*(c+a*E <-> F)")
ct <- full.ct(cond)
detailMeasures(cond, ct)
# The reason is that one of the asfs is redundant:
redundant(cond[4])
# INUS form can additionally be required to include functional minimality
# (inus.func.minim, cf. is.inus and func_minim). The second csf below contains
# a factor that is functionally redundant in the sense of fm_structural().
aircon <- selectCases("(A + B <-> E1)*(A*b + A*C <-> E2)")
cond2 <- csf(cna(aircon))$condition
detailMeasures(cond2, aircon, what = "inus")
detailMeasures(cond2, aircon, what = "inus", inus.func.minim = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.