Learn R Programming

QCA (version 0.6-5)

qmcc: Find a minimum solution in a boolean procedure, using the Quine-McCluskey algorithm

Description

This function is the core of the QCA (Qualitative Comparative Analysis) package. The QCA is the bridge between the qualitative and quantitative worlds, and its fundamental philosophy is based on Mill's methods of inductive inquiry. Given a dataset with cases on the rows (or better said, case studies) and various conditions on the columns, this function finds which condition (or combination of conditions) is necessary and/or sufficient to trigger the outcome. As of version 0.6-0, qmcc() is explicitely working with binary data only.

Usage

qmcc(mydata, outcome = "", conditions = c(""), incl.rem = FALSE,
     expl.1 = FALSE, expl.0 = FALSE, expl.ctr = FALSE, expl.mo = FALSE,
     incl.1 = FALSE, incl.0 = FALSE, incl.ctr = FALSE, incl.mo = FALSE,
     quiet = FALSE, details = TRUE, chart = FALSE, use.letters = TRUE,
     show.cases = FALSE, diffmat=TRUE)

Arguments

mydata
the dataset used for minimization (dataframe or matrix)
outcome
the name of the outcome variable from the dataset
conditions
a string vector containing the conditions' names from the dataset (if not specified, all variables but the outcome are included)
incl.rem
include the remainders in the minimization procedure
expl.1
explain the outcomes equal to 1
expl.0
explain the outcomes equal to 0
expl.ctr
explain the contradictions
expl.mo
explain the missing outcomes (not implemented yet)
incl.1
include the outcomes equal to 1 in the minimization procedure
incl.0
include the outcomes equal to 0 in the minimization procedure
incl.ctr
include the contradictions in the minimization procedure
incl.mo
include the missing outcome in the minimization procedure (not implemented yet)
quiet
prints the solution without any other information
details
prints some relevant details (set to FALSE if quiet is TRUE
chart
print the prime implicants chart
use.letters
should letters be used instead of column names
show.cases
show the lines corresponding to every minimized prime implicant
diffmat
generate the differences matrix

Value

  • an invisible list with five components: initial combinations, minimised PIs, the raw PI chart, the number of k PIs to solve the PI chart and the solution(s)

References

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

Dusa, Adrian (2010) A mathematical approach to the boolean minimization problem, Quality & Quantity vol.44, no.1, pp.99-113

See Also

truthTable, eqmcc

Examples

Run this code
data(Osa)

# find a solution using the Quine-McCluskey (qmcc) algorithm
# explaining only the presence of the outcome
qmcc(Osa, outcome="OUT", expl.1=TRUE)

# now including the remainers and the contradictions
qmcc(Osa, outcome="OUT", expl.1=TRUE, incl.rem=TRUE, incl.ctr=TRUE)

# the same as above, but we want to see the prime implicants chart
qmcc(Osa, outcome="OUT", expl.1=TRUE, incl.rem=TRUE, incl.ctr=TRUE, chart=TRUE)

# even more details
qmcc(Osa, outcome="OUT", expl.1=TRUE, incl.rem=TRUE, incl.ctr=TRUE, details=TRUE)

# printing the lines corresponding to each prime implicant
qmcc(Osa, outcome="OUT", expl.1=TRUE, incl.rem=TRUE, incl.ctr=TRUE, show.cases=TRUE)

# now explaining the absence of the outcome
qmcc(Osa, outcome="OUT", expl.0=TRUE, incl.rem=TRUE, incl.ctr=TRUE, show.cases=TRUE)

Run the code above in your browser using DataLab