pimplot: Prime implicants, truth table rows, and necessity plots.

View source: R/pimplot.R

pimplotR Documentation

Prime implicants, truth table rows, and necessity plots.

Description

A function that displays XY plots for each sufficient term and the solution formula plotted against the outcome from an object of class "qca" (obtained by using the minimize function in package QCA). The function can also plot truth table rows against the outcome. Additionally, the function can plot results obtained from necessity analyses using an object of class "sS" (obtained by using the superSubset function in package QCA).

Usage

pimplot(data = NULL,
           results,
           outcome,
           incl.tt=NULL,
           ttrows= c(),
           necessity=FALSE,
           sol=1,
           all_labels=FALSE,
           markers = TRUE,
           labcol="black", 
           jitter = FALSE,
           font = "sans",
           fontface = "italic", 
           fontsize = 3,
           crisp = FALSE,
           consH = FALSE,
           ...)

Arguments

data

For analyses of sufficiency, providing a dataframe is not necessary. For analyses of necessity on objects of class "sS, you need to provide a dataframe with the name of the outcome and of the conditions in capital letters.

results

An object of class "qca" when necessity is FALSE. An object of class "sS" when necessity is TRUE. For performing pimplot of the sufficient solution for the negated outcome one must use the minimize() result from the sufficiency analysis of the negated outcome.

outcome

A character string with the name of the outcome in capital letters. When performing pimplot of the sufficient solution for the negated outcome one must only use the minimize() result from the sufficiency analysis of the negated outcome in the argument results. Changing the name in the argument outcome or using a tilde is not necessary, but recommended.

incl.tt

A numerical vector of length 1 specifying the row consistency threshold above which it should plot truth table rows. By default it is NULL and the function will produce plots using "qca" or "sS" objects. If a numerical value is specifyied, then it automatically only plots truth table rows above that consistency value. N.B. This argument cannot be used simultaneously with the ttrows argument.

ttrows

A vector of character strings specifying the names of the truth table rows to be printed. By default this vector is empty and the function will produce plots using "qca" or "sS" objects. If a value is specifyied, then it automatically only plots those particular truth table rows. N.B. This argument cannot be used simultaneously with the incl.tt argument.

necessity

logical. It indicates if the output should be for the results of sufficiency or necessity analyses. By default, FALSE, the function works with an object of class "qca" obtained from the minimize function in package QCA. When it set to TRUE the function returns plots for an object of class "sS" obtained from the superSubset function in package QCA.

sol

A vector where the first number indicates the number of the conservative or parsimonious solution according to the order in the "qca" object. For more complicated structures of model ambiguity, the intermediate solution can also be specified by using a character string of the form "c1p3i2" where c = conservative solution, p = parsimonious solution and i = intermediate solution.

all_labels

Logical. Print ALL case labels?

markers

Logical. Print deviant consistency cases with different markers?

labcol

Color of the labels.

jitter

Logical. Should labels not overlab?

font

Font of the labels. Accepts "sans", "serif", and "mono" fonts.

fontface

Fontface of the labels. Accepts "plain", "bold", "italic", "bold.italic".

fontsize

Fontsize of the labels.

crisp

Logical. Should the function return a two-by-two table for crisp sets?

consH

Logical. Should Haesebrouck's consistency be printed?

...

Other non essential arguments.

Value

XY plots.

Author(s)

Ioana-Elena Oana

References

Haesebrouck, T. (2015) Pitfalls in QCA's consistency measure. Journal of Comparative Politics 2:65-80.

Schneider, C. Q., Rohlfing, I. 2013. Combining QCA and Process Tracing in Set-Theoretic Multi-Method Research. Sociological Methods Research 42(4): 559-597

See Also

minimize pimdata

Examples

# Import your data. For example:

data(SCHF)

# Get the parsimonious solution:


sol_yp <- minimize(SCHF, outcome = "EXPORT",
                conditions = c("EMP","BARGAIN","UNI","OCCUP","STOCK", "MA"),
                incl.cut = .9, 
                include = "?", 					   
                details = TRUE, show.cases = TRUE)

# Plot the prime implicants of the parsimonious solution:

pimplot(data = SCHF, results = sol_yp, outcome = "EXPORT")

# Plot a two-by-two table:

pimplot(data = SCHF, results = sol_yp, outcome = "EXPORT", crisp = TRUE)

# Plot all truth table rows with a consistency higher than 0.95:

pimplot(data=SCHF, results = sol_yp, incl.tt=0.97, outcome = "EXPORT", sol = 1)

# Plot truth table row "60":

pimplot(data=SCHF, results = sol_yp, ttrows =c("60"), 
        outcome = "EXPORT", sol = 1)

# For plotting results of necessity analyses using superSubset,
# the first stept is to obtain an "sS" object:

SUPSUB <- superSubset(SCHF, outcome="EXPORT", 
                      conditions = c("EMP","BARGAIN","UNI","OCCUP","STOCK", "MA"), 
                      relation = "necessity", incl.cut = 0.996)
SUPSUB

# This can be imputed as result and necessity should be set to \code{TRUE}:

pimplot(data = SCHF, results = SUPSUB, outcome = "EXPORT", necessity = TRUE)


SetMethods documentation built on March 31, 2023, 5:41 p.m.