# Intersect expressions

## Description

This function takes two or more QCA expressions (combinations of conjunctions and disjunctions), or even entire minimization objects, and finds their intersection.

## Usage

    intersection(..., snames = "", noflevels)

## Arguments

`...` |  |  |  | One or more expressions, combined with / or minimization objects of class `"QCA_min"`
`snames` |  |  |  | A string containing the sets' names, separated by commas.
`noflevels` |  |  |  | Numerical vector containing the number of levels for each set.

## Details

The initial aim of this function was to provide a software implementation of the intersection examples presented by Ragin (1987: 144-147). That type of example can also be performed with the function `simplify()`, while this function is now mainly used in conjunction with the `modelFit()` function, to assess the intersection between theory and a QCA model.

Irrespective of the input type (character expressions and / or minimiation objects), this function is now a wrapper to the main `simplify()` function (which only accepts character expressions).

It can deal with any kind of expressions, but multivalent crisp conditions need additional information about their number of levels, via the argument `noflevels`.

The expressions can be formulated in terms of either lower case - upper case notation for the absence and the presence of the causal condition, or use the tilde notation (see examples below). Usage of either of these is automatically detected, as long as all expressions use the same notation.

If the `snames` argument is provided, the result is sorted according to the order of the causal conditions (set names) in the original dataset, otherwise it sorts the causal conditions in alphabetical order.

For minimization objects of class `"QCA_min"`, the number of levels, and the set names are automatically detected.

## References

Ragin, C.C. (1987) The Comparative Method: Moving beyond Qualitative and Quantitative Strategies. Berkeley: University of California Press.

## Examples

    # using minimization objects
    ttLF  <- truthTable(LF, outcome = "SURV", incl.cut = 0.8)

    pLF  <- minimize(ttLF, include = "?")

    # for example the intersection between the parsimonious model and
    # a theoretical expectation

    intersection(pLF, "DEV*STB")

    E1: (DEV*~IND + URB*STB)*DEV*STB
      I1: DEV*URB*STB + DEV*~IND*STB

    # negating the model
    intersection(negate(pLF), "DEV*STB")

    E1: (~DEV*~URB + ~DEV*~STB + ~URB*IND + IND*~STB)*DEV*STB
      I1: DEV*IND*STB*~URB

    # in Ragin's (1987) book, the equation E = SG + LW is the result
    # of the Boolean minimization for the ethnic political mobilization.

    # intersecting the reactive ethnicity perspective (R = lw)
    # with the equation E (page 144)
    intersection("~L~W", "SG + LW", snames = "S, L, W, G")

    E1: ~L~W(SG + LW)
      I1: S~L~WG

    # resources for size and wealth (C = SW) with E (page 145)
    intersection("SW", "SG + LW", snames = "S, L, W, G")

    E1: SW(SG + LW)
      I1: SWG + SLW

    # and factorized
    factorize(intersection("SW", "SG + LW", snames = "S, L, W, G"))

    M1: SWG + SLW
      F1: SW(G + L)

    # developmental perspective (D = Lg) and E (page 146)
    intersection("L~G", "SG + LW", snames = "S, L, W, G")

    E1: L~G(SG + LW)
      I1: LW~G

    # subnations that exhibit ethic political mobilization (E) but were
    # not hypothesized by any of the three theories (page 147)
    # ~H = ~(~L~W + SW + L~G)

    intersection(negate("~L~W + SW + L~G"), "SG + LW", snames = "S, L, W, G")

    E1: (GL~S + GL~W + ~L~SW)(SG + LW)
      I1: ~SLWG + SL~WG

    E2: (GL~W + G~SW + ~L~SW)(SG + LW)
      I2: ~SLWG + SL~WG

## Author

Adrian Dusa