Description Usage Arguments Value Author(s) References See Also Examples

QCAfit is a function calculating parameters of fit useful in QCA and fsQCA that are consistency, coverage, PRI, Haesebrouck's consistency, RoN and PRODUCT. It works with both single and multiple conditions.

1 2 |

`x` |
A vector containing the values of a condition, a matrix with more than one conditions, or an object of class "qca" when necessity is |

`y` |
A vector containing the values of the output or a character string when y is of class "qca". |

`cond.lab` |
When inserting a dataframe or a matrix with more than one condition and column names, the function automatically prints the names of the conditions tested. When inputing a vector, hence a single condition (i.e. a single column in a dataframe, the name of the condition tested should be inserted in this option .) |

`necessity` |
logical. It indicates if the output should be for sufficient or necessary condition(s). By default, |

`neg.out` |
logical. It indicates if the parameters of fit should be computed for the positive or the negative outcome. By default, |

`product` |
logical. It indicates whether the parameter of fit PRODUCT should be shown. This stands for the product between the consistency sufficiency parameter and the PRI parameter. |

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

`ttrows` |
A vector specifying the names of the truth table rows for which the function reports parameters of fit. For using this option y must be a "qca" object. |

It returns a matrix containing the parameters of fit for each condition.

Mario Quaranta and Ioana-Elena Oana

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

Ragin, C. C. 2006. Set Relations in Social Research: Evaluating Their Consistency and Coverage. Political Analysis 14(3): 291-310.

Schneider, C. Q., Wagemann, C. (2012) Set-Theoretic Methods for the Social Sciences, Cambridge University Press: Cambridge.

Schneider, C. Q., Wagemann, C., Quaranta, M. (2012) How To... Use Software for Set-Theoretic Analysis. Online Appendix to "Set-Theoretic Methods for the Social Sciences". Available at www.cambridge.org/schneider-wagemann

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ```
# Generate fake data
set.seed(1234)
a <- runif(100, 0, 1)
b <- runif(100, 0, 1)
c <- runif(100, 0, 1)
y <- runif(100, 0, 1)
# Only one condition, for necessity
QCAfit(a, y, cond.lab = "A")
# With three conditions and their negation, for necessity
QCAfit(cbind(a, b, c), y)
# Only one condition, for sufficiency
QCAfit(a, y, cond.lab = "A", necessity = FALSE)
# With three conditions, their negation and negated output, for necessity
QCAfit(cbind(a, b, c), y, neg.out = TRUE)
# Load the Schneider data:
data(SCHF)
# Get parameters of fit for condition EMP as necessary for outcome EXPORT:
QCAfit(SCHF$EMP, SCHF$EXPORT, cond.lab = "EMP")
# Get parameters of fit for condition ~EMP as necessary for outcome ~EXPORT:
QCAfit(1-SCHF$EMP, SCHF$EXPORT, neg.out=TRUE, cond.lab = "~EMP")
# Get parameters of fit for all conditions and their negation as necessary for outcome EXPORT:
QCAfit(SCHF[,1:6], SCHF$EXPORT)
# Obtain the intermediate solution for outcome "EXPORT":
sol_yi <- minimize(SCHF, outcome = "EXPORT",
conditions = c("EMP","BARGAIN","UNI","OCCUP","STOCK", "MA"),
incl.cut = .9,
include = "?",
details = TRUE, show.cases = TRUE, dir.exp = c(0,0,0,0,0,0))
# Get parameters of fit for the second model of the intermediate solution:
QCAfit(x = sol_yi, y = "EXPORT", sol=2)
# Get parameters of fit for truth table rows 2,8, and 10:
QCAfit(x = sol_yi, y = "EXPORT", ttrows=c("2","8","10"))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.