0

I am using the QCA and SetMethods packages for R to conduct a QCA. I have created a truth table with my data, using the function truthTable including the argument complete = TRUE to print the logical remainders. The data has 11 conditions, the tt should then have 2048 rows, but when I call the truth table object, only the 22 rows with observed cases are printed.

Here is the code used to construct the truthTable. The file qca_selec can be uploaded from here.

# Data set 'qca_selec':
qca_selec <- readRDS("qca_selec.RDS")

# Vector of condition names:
cond <- c("COALSIZE" "FINAMOOD" "COALEXPE" "COALCOOR" "PUBLSUPP" "NFBUSUPP" "WEAKOPPO" "ISSUSALI" "ISSUCOMP" "ISSUNOVE" "ISSUPOLI")

# Truth table:
tt <- truthTable(data = qca_selec, outcome = "~SUCCESS", conditions = cond,
                            incl.cut = 0.75, pri.cut = 0.51, n.cut = 2, sort.by = "incl", 
                            show.cases = TRUE, complete = TRUE)
tt

I used the same code for other truth tables with up to 7 conditions and it worked fine, showed me all the rows, including remainders. Is there anything particular to add when using the function with more than 7 conditions? I could not find anything in the QCA package documentation.

I should also note that when using functions from the SetMethods package (the esa and LR.intersectfunctions, to be precise), on solutions based on this particular truth table, I also experienced issues. Basically, the LR.intersectfunction is unable to identify the specified models (there is model ambiguity); and the esa function seems not to change the values of the contrad_rows and nec_cond(well, I can't actually check the changes in the tt since it does not print the LRs, but the resulting ESA solutions are exactly the same as the SA solutions, so I guess that it does not change anything).

Has anyone be confronted to a similar issue before?

I'm using

  • R version 4.1.2 (2021-11-01); Platform: x86_64-apple-darwin17.0 (64-bit); Running under: macOS Big Sur 11.5
  • SetMethods_3.0 and QCA_3.14
  • I also have the tidyverse packages loaded, could that create any conflict with a long tt?

I would be immensely grateful for any help from the community!

SebasComm
  • 35
  • 4
  • You didn't include `qca_selec`, so I can't reproduce the error. I took a look at the `truthTable` function, between what it uses and `dplyr`, there are several potential sources of the problems you have. However, I didn't find any issues with the functions `lag` or `filter`-- where `dplyr` conflicts with the base package `stat`. (I didn't look through everything, though.) If you call `tidyverse` **first**, then your other libraries, you shouldn't have a problem. Alternatively, make your question reproducible: [making R reproducible questions](https://stackoverflow.com/q/5963269). – Kat Feb 04 '22 at 02:09
  • Thanks for your reply! I added a link to the data set `qca_selec`. I actually already call `tidyverse` first and only then `QCA` and `SetMethods` because I had already noticed conflicts between functions... – SebasComm Feb 04 '22 at 10:16
  • Remove `conditions = cond` If you look in the environment pane, you won't find the object `cond`. That line of code doesn't work without commas. You don't have to fix that though. `truthTable()` infers the conditions based on the data structure. – Kat Feb 04 '22 at 14:39
  • Thanks, @Kat. I removed the `conditions = cond` argument but the truth table still prints without the logical remainders. Does it work on your side? – SebasComm Feb 04 '22 at 16:46

0 Answers0