Learn R Programming

SetMethods (version 2.1)

pimplot: 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 eqmcc 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, results, outcome, neg.out = FALSE, incl.tt = NULL , ttrows = c() , 
        necessity = FALSE, intermed = FALSE, sol = 1, case_labels = TRUE, 
        lab_color = rgb(0,0,0,0.5), lab_jitter = FALSE)

Arguments

data

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 pimplots of the sufficient solution for the negated outcome one must only use the eqmcc() result from the sufficiency analysis of the negated outcome together with neg.out set to TRUE.

outcome

A character string with the name of the outcome in capital letters. When performing pimplots of the sufficient solution for the negated outcome one must only use the eqmcc() result from the sufficiency analysis of the negated outcome in the argument results together with neg.out set to TRUE. Changing the name in the argument outcome or using a tilde is not necessary.

neg.out

Logical. Should the negated outcome be used?

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 eqmcc 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.

intermed

Logical. Use the intermediate solution?

sol

A numeric vector where the first number indicates the number of the solution in case of model ambiguity according to the order in the "qca" object.

case_labels

Logical. Print case labels?

lab_color

Color of the labels.

lab_jitter

Logical. Add jitter to label positions?

Value

XY plots.

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

eqmcc pimdata

Examples

Run this code
# NOT RUN {
# Import your data. For example:

data(Schneider)

# Get the parsimonious solution:


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

# Get the intermediate solution:

sol_yi <- eqmcc(Schneider, outcome = "EXPORT",
                conditions = c("EMP","BARGAIN","UNI","OCCUP","STOCK", "MA"),
                incl.cut1 = .9, 
                include = "?", 					   
                details = TRUE, show.cases = TRUE, dir.exp = c(0,0,0,0,0,0))

# Plot the prime implicants of the parsimonious solution:

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

# Plot the prime implicants of the first intermediate solution:

pimplot(data = Schneider, results = sol_yi, outcome = "EXPORT", intermed=TRUE, sol = 1)

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

pimplot(data=Schneider, results = sol_yi, incl.tt=0.9, outcome = "EXPORT", intermed=TRUE, sol = 1)

# Plot truth table rows "60" and "61":

pimplot(data=Schneider, results = sol_yi, ttrows =c("60","61"), 
        outcome = "EXPORT", intermed=TRUE, sol = 1)

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

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

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

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

# }

Run the code above in your browser using DataLab