truthTable: Create a Truth Table

Description Usage Arguments Details Value Contributors Author(s) References Examples

Description

This function creates truth tables from configurational data.

Usage

1
2
3
4
5
6
truthTable(data, outcome = "", neg.out = FALSE, exo.facs = c(""), 
           n.cut = 1, incl.cut1 = 1, incl.cut0 = 1, complete = FALSE, 
           show.cases = FALSE, sort.by = c(""), decreasing = TRUE, 
           inf.test = c(""), use.letters = FALSE, ...)

is.tt(x)

Arguments

data

A set of configurational data (of class 'matrix' or 'data.frame').

outcome

The name of the outcome.

neg.out

Logical, use the negation of outcome.

exo.facs

A character vector with the names of the exogenous factors.

n.cut

The minimum number of cases with set membership score above 0.5 for an output function value of "0", "1" or "C"; an integer between 1 and the maximum number of cases for all non-remainder minterms.

incl.cut1

The minimum sufficiency inclusion score for an output function value of "1".

incl.cut0

The maximum sufficiency inclusion score for an output function value of "0".

complete

Logical, print the complete truth table.

show.cases

Logical, print case names (do not use this option with many cases and/or long case names).

sort.by

Sort the truth table by inclusion scores and/or number of cases.

decreasing

Sort in decreasing or increasing order of value(s) passed to sort.by.

inf.test

A vector of length two specifying the inference-statistical test to be performed (currently only "binom") and the critical significance level.

use.letters

Logical, use single letters (in alphabetical order) for labels of exogenous factors instead of original labels.

...

Other arguments.

x

An object of class 'tt'.

Details

The argument data can be a suitable data set of class 'matrix' or 'data.frame'. Suitable data sets have the following structure: values of 0 and 1 for bivalent crisp-set factors, values between 0 and 1 for bivalent fuzzy-set factors, and values beginning with 0 at increments of 1 for multivalent crisp-set factors. The placeholder "-1" indicates "don't cares" in auxiliary factors that specify temporal order between other substantive factors in tQCA. These values lead to the exclusion of the auxiliary factor from the computation of parameters of fit.

The argument outcome specifies the outcome to be analyzed, either in curly-bracket notation (e.g., O{value}) if the outcome is from a multivalent (or a bivalent) factor, or in upper-case notation if the outcome is from a bivalent factor (e.g., O as a short-cut for O{1}). Outcomes from multivalent crisp-set factors always require curly-bracket notation. Outcomes must be single levels of factors not simultaneously passed to exo.facs.

The logical argument neg.out controls whether outcome is to be analyzed or its negation. If outcome is a level from a multivalent factor, neg.out = TRUE causes the disjunction of all non-specified levels to become the outcome to be analyzed.

The argument exo.facs specifies the exogenous factors. If omitted, all factors in data are used except that of the outcome. Please note that computation times tend to increase with the number of exogenous factors, and that the computation of a solution may not be possible at all depending on end-user machine constraints.

Minterms that contain fewer than n.cut cases with membership scores above 0.5 are coded as remainders (OUT = "?"). If the number of such cases is at least n.cut, minterms with an inclusion score of at least incl.cut1 are coded positive (OUT = "1"), minterms with an inclusion score below incl.cut1 but with at least incl.cut0 are coded as a contradiction (OUT = "C"; minterms that should neither be considered sufficient nor insufficient for the outcome), and minterms with an inclusion score below incl.cut0 are coded negative (OUT = "0"). If incl.cut0 is not explicitly changed, it is set equal to incl.cut1.

The logical argument show.cases controls whether case names are displayed next to their corresponding minterm when printing the truth table (do not use this option with many cases and/or long case names).

The sort.by argument orders all minterms by their inclusion scores (incl) or the number of cases with membership above 0.5 they contain (n) or both, in either order.

If the exogenous factors are already named with single letters, the argument use.letters will have no effect when set to TRUE. Otherwise, upper-case letters will replace original factor names in alphabetical order.

The argument inf.test provides functionality for basing output function value codings on inference-statistical tests (experimental). Currently, only an exact binomial test ("bin m") is available, which requires the data to contain only bivalent or multivalent crisp -set factors. The argument requires a vector of length two, comprising the test and a critical significance level. If the empirical inclusion score of a minterm is not significantly lower than incl.cut1, it will be coded positive (OUT = "1"). If it iss significantly lower than incl.cut1 yet still significantly higher than incl.cut0, it will be coded as a contradiction (OUT = "C"). If it is not significantly higher than incl.cut0, it will be coded negative (OUT = "0").

Value

An object of class 'tt', which is a list with the following six main components:

tt

The truth table.

indexes

The minterm line numbers.

noflevels

A vector with the number of levels of the exogenous factors.

initial.data

The initial data.

recoded.data

Recoded data (if crisp, same as initial.data (except for the endogenous factor in mvQCA); if fuzzy, dichotomized version of initial.data).

cases

The cases with membership above 0.5 in a minterm.

Contributors

Dusa, Adrian: development, programming
Thiem, Alrik: development, documentation, programming, testing

Author(s)

Alrik Thiem (Personal Website; ResearchGate Website)

References

Emmenegger, Patrick. 2011. “Job Security Regulations in Western Democracies: A Fuzzy Set Analysis.” European Journal of Political Research 50 (3):336-64. DOI: 10.1111/j.1475-6765.2010.01933.x.

Hartmann, Christof, and Joerg Kemmerzell. 2010. “Understanding Variations in Party Bans in Africa.” Democratization 17 (4):642-65. DOI: 10.1080/13510347.2010.491189.

Krook, Mona Lena. 2010. “Women's Representation in Parliament: A Qualitative Comparative Analysis.” Political Studies 58 (5):886-908. DOI: 10.1111/j.1467-9248.2010.00833.x.

Ragin, Charles C., and Sarah Ilene Strand. 2008. “Using Qualitative Comparative Analysis to Study Causal Order: Comment on Caren and Panofsky (2005).” Sociological Methods & Research 36 (4):431-41. DOI: 10.1177/0049124107313903.

Examples

 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# csQCA using Krook (2010)
#-------------------------
data(d.represent)
head(d.represent)

# print truth table; if all factors in the data except that of the outcome 
# should be included as exogenous factors, these need not be specified
truthTable(d.represent, outcome = "WNP")

# print complete truth table, show cases, and first sort by 
# inclusion scores, then by number of cases
truthTable(d.represent, outcome = "WNP", complete = TRUE, 
  show.cases = TRUE, sort.by = c("incl", "n"))

# code minterms with a single case as remainders (note: the use of 
# 'n.cut' should be well justified)
KRO.tt <- truthTable(d.represent, outcome = "WNP", n.cut = 2, 
  show.cases = TRUE)
KRO.tt

# cases that were assigned to remainders based on argument 'n.cut'
KRO.tt$excluded

# fsQCA using Emmenegger (2011)
#------------------------------
data(d.jobsecurity)
head(d.jobsecurity)

# code non-remainder minterms with inclusion scores between 0.4 and 0.8 
# as contradictions
truthTable(d.jobsecurity, outcome = "JSR", incl.cut1 = 0.8, incl.cut0 = 0.4)

# truth table based on the negated outcome
truthTable(d.jobsecurity, outcome = "JSR", neg.out = TRUE, incl.cut1 = 0.8, 
  incl.cut0 = 0.4, sort.by = c("incl"))

# mvQCA using Hartmann and Kemmerzell (2010)
#-------------------------------------------
data(d.partybans)
head(d.partybans)

# code minterms with inclusion scores below 1 but above 0.4 as contradictions 
HK.tt <- truthTable(d.partybans, outcome = "PB{1}", 
  exo.facs = c("C","F","T","V"), incl.cut0 = 0.4)
HK.tt

# list the number of levels of the four exogenous factors  
HK.tt$noflevels

# which minterms have more than 2 cases?
HK.tt$tt[which(HK.tt$tt$n > 2), ]

# code output function values in truth table based on 
# exact binomial test
truthTable(d.partybans, outcome = "PB", exo.facs = c("C","F","T"), 
  incl.cut1 = 0.9, incl.cut0 = 0.4, show.cases = TRUE, 
  inf.test = c("binom", 0.1))

# tQCA using Ragin and Strand (2008)
#-----------------------------------
data(d.graduate)
head(d.graduate)

# tQCA truth table with "don't care" values
truthTable(d.graduate, outcome = "REC")

AlrikThiem/QCApro documentation built on May 5, 2019, 4:55 a.m.