Learn R Programming

QCA (version 3.3)

factorize: Factorize Boolean expressions

Description

This function finds all combinations of common factors in a Boolean expression written in SOP - Sum Of Products form.

Usage

factorize(input, snames = "", noflevels, pos = FALSE, use.tilde = FALSE, ...)

Arguments

input

A string containing the SOP expression, or an object of class "qca".

snames

A string containing the sets' names, separated by commas.

noflevels

Numerical vector containing the number of levels for each set.

pos

Logical, if possible factorize using product(s) of sums.

use.tilde

Logical, use a tilde to negate the sets.

...

Other arguments (mainly for backwards compatibility).

Value

A list with two components:

initial The input expression.
factored All possible factorizations of the input expression.

Details

Factorization is a process of finding common factors in a Boolean expression, written in a SOP - sum of products (or DNF - disjunctive normal form). Whenever possible, the factorization can also be performed in a POS - product of sums form.

Conjunctions should preferably be indicated with a star * sign, but this is not necessary when conditions have single letters or when the expression is expressed in multi-value notation.

The argument snames is only needed when conjunctions are not indicated by any sign, and the set names have more than one letter each (see function translate() for more details).

The number of levels in noflevels is needed only when negating multivalue conditions, and it should complement the snames argument.

If input is an object of class "qca" (the result of the minimize() function), a factorization is performed for each of the minimized solutions.

The argument use.tilde is automatically activated if the input contains a tilde to negate conditions.

References

Ragin, C.C. (1987) The Comparative Method. Moving beyond qualitative and quantitative strategies, Berkeley: University of California Press

See Also

translate

Examples

Run this code
# NOT RUN {
# typical example with redundant conditions
factorize("AbcD + AbCd + AbCD + ABCd")

# results presented in alphabetical order
factorize("one*TWO*four + one*THREE + THREE*four")

# to preserve a certain order of the set names
factorize("one*TWO*four + one*THREE + THREE*four",
          snames = "ONE, TWO, THREE, FOUR")

factorize("~ONE*TWO*~FOUR + ~ONE*THREE + THREE*~FOUR",
          snames = "ONE, TWO, THREE, FOUR")

# using pos - products of sums
factorize("ac + aD + bc + bD", pos = TRUE)


# using an object of class "qca" produced with minimize()
data(CVF)
pCVF <- minimize(CVF, outcome = "PROTEST", incl.cut = 0.8,
                 include = "?", use.letters = TRUE)

factorize(pCVF)


# using an object of class "deMorgan" produced with negate()
factorize(negate(pCVF))


# }

Run the code above in your browser using DataLab