No intermediate solution (MRE included)

40 views
Skip to first unread message

Wuraola

unread,
Sep 19, 2021, 1:02:06 PM9/19/21
to QCA with R
Dear All,
Trust you are all doing great! I have an issue with my intermediate solution and I think its  related to my sufficiency analysis. My sufficiency analysis shows that all my causal conditions are simultaneous subset relations. I read in the QCA R book that decision should be made whether its the presence or absence of a causal condition that should be declared as sufficient in a situation like this and the declared sufficient conditions are to be used in the truth table. My question is how do I declare this in my truth table? I didn't find any information on how to do this in the instruction book. I tried to use the the function findRows and argument type = 3 in the intermediate solution but I didn't get any solution because all my causal conditions are subset relations so they were all removed. This means its better for me to declare in the truth table whether the presence or absence of a causal condition is sufficient before getting to the intermediate solution.

Below is my MRE (I hope I got it right this time around..):

```
library(admisc)
#> Warning: package 'admisc' was built under R version 4.0.5
library(QCA)
#> Warning: package 'QCA' was built under R version 4.0.5
#>
#> To cite package QCA in publications, please use:
#>   Dusa, Adrian (2019) QCA with R. A Comprehensive Resource.
#>   Springer International Publishing.
#>
#> To run the graphical user interface, use: runGUI()
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:admisc':
#>
#>     compute, recode
#> The following objects are masked from 'package:stats':
#>
#>     filter, lag
#> The following objects are masked from 'package:base':
#>
#>     intersect, setdiff, setequal, union
Fuzzy1 <- data.frame(
  FF1Fuzzy = c(0.833333333333333, 0.166666666666667, 0.833333333333333, 0.333333333333333, 0.833333333333333, 1),
  FF2Fuzzy = c(1, 1, 0.333333333333333, 0.333333333333333, 1, 1),
  FF3Fuzzy = c(0.833333333333333, 0.666666666666667, 0.666666666666667, 0.666666666666667, 1, 0.666666666666667),
  EffectFuzzy = c(0.333333333333333, 1, 0.833333333333333, 0.166666666666667, 0.833333333333333, 0.833333333333333)
)
Fuzzy1
#>    FF1Fuzzy  FF2Fuzzy  FF3Fuzzy EffectFuzzy
#> 1 0.8333333 1.0000000 0.8333333   0.3333333
#> 2 0.1666667 1.0000000 0.6666667   1.0000000
#> 3 0.8333333 0.3333333 0.6666667   0.8333333
#> 4 0.3333333 0.3333333 0.6666667   0.1666667
#> 5 0.8333333 1.0000000 1.0000000   0.8333333
#> 6 1.0000000 1.0000000 0.6666667   0.8333333
Fuzzy2 <- apply(Fuzzy1, 2 , as.numeric)
Fuzzy3 <- data.frame(Fuzzy2)

sufficiency <- superSubset(Fuzzy3, outcome = "EffectFuzzy", neg.out = FALSE,
                           conditions = c("FF1Fuzzy", "FF2Fuzzy", "FF3Fuzzy"),
                           relation = "sufficiency",
                           incl.cut = 0.10, cov.cut = 0)
sufficiency
#>
#>               inclS   PRI   covS  
#> ---------------------------------
#> 1  ~FF1Fuzzy  0.750  0.625  0.375
#> 2  FF1Fuzzy   0.792  0.722  0.792
#> 3  ~FF2Fuzzy  0.625  0.500  0.208
#> 4  FF2Fuzzy   0.750  0.682  0.875
#> 5  ~FF3Fuzzy  0.889  0.800  0.333
#> 6  FF3Fuzzy   0.741  0.667  0.833
#> ---------------------------------

#Truth table configurations where the cases have membership scores above 0.5
ttrows <- apply(Fuzzy3[,1:3], 2, function(x) as.numeric(x > 0.5))
rownames(ttrows) <- rownames(Fuzzy3)
ttrows
#>   FF1Fuzzy FF2Fuzzy FF3Fuzzy
#> 1        1        1        1
#> 2        0        1        1
#> 3        1        0        1
#> 4        0        0        1
#> 5        1        1        1
#> 6        1        1        1
#Truth table is presented below
FinalTruthTable <- truthTable(Fuzzy3, outcome = "EffectFuzzy", incl.cut = c(0.8, 0.6), show.cases = TRUE, dcc = TRUE, use.letters = TRUE)
FinalTruthTable
#>
#>     A: FF1Fuzzy
#>     B: FF2Fuzzy
#>     C: FF3Fuzzy
#>   OUT: output value
#>     n: number of cases in configuration
#>  incl: sufficiency inclusion score
#>   PRI: proportional reduction in inconsistency
#>   DCC: deviant cases consistency
#>
#>     A  B  C    OUT    n  incl  PRI   DCC
#> 2   0  0  1     0     1  0.400 0.000  4
#> 4   0  1  1     1     1  0.889 0.800    
#> 6   1  0  1     1     1  0.833 0.750    
#> 8   1  1  1     C     3  0.789 0.692  1

#Complex solutions
library(QCA)
FsqcaComplexSolution <- minimize(FinalTruthTable, details = TRUE)
FsqcaComplexSolution
#>
#> M1: A*~B*C + ~A*B*C -> EffectFuzzy
#>
#>            inclS   PRI   covS   covU   cases
#> --------------------------------------------
#> 1  A*~B*C  0.833  0.750  0.208  0.125  3
#> 2  ~A*B*C  0.889  0.800  0.333  0.250  2
#> --------------------------------------------
#>        M1  0.917  0.875  0.458

#Parsimonious solutions
FsqcaParsimoniousSolution <- minimize(FinalTruthTable, include = "?", details = TRUE, use.letters = TRUE)
FsqcaParsimoniousSolution
#>
#> M1: A*~B + ~A*B -> EffectFuzzy
#>
#>          inclS   PRI   covS   covU   cases
#> ------------------------------------------
#> 1  A*~B  0.833  0.750  0.208  0.125  3
#> 2  ~A*B  0.900  0.833  0.375  0.292  2
#> ------------------------------------------
#>      M1  0.923  0.889  0.500


#Intermediate solution
#Remove simultaneous subset relations (SSR)
SSR <- findRows(obj = FinalTruthTable, type = 3)

FsqcaIntermediateSolution <- minimize(FinalTruthTable, exclude = SSR, use.letters = TRUE)
FsqcaIntermediateSolution
#>
#> M1: A*~B*C + ~A*B*C -> EffectFuzzy
```

Wuraola

unread,
Sep 19, 2021, 1:14:30 PM9/19/21
to QCA with R
My QCA version is 3.12
My R version is R-4.0.3
I use Windows 10, version 10.0.19041

Br,
Wuraola.

Wuraola

unread,
Sep 19, 2021, 1:19:06 PM9/19/21
to QCA with R
I have also attached the R script to this message...Thanks!

On Sunday, September 19, 2021 at 8:02:06 PM UTC+3 Wuraola wrote:
MRE_FSQCAdataFOURTHBatchMainExperiment_rr1.R

Adrian Dușa

unread,
Sep 20, 2021, 5:13:24 AM9/20/21
to Wuraola, QCA with R
Dear Wuraola,

According to your script, the object SSR is empty which means you don't actually have any simultaneous subset relation at all.
This further means you don't actually exclude anything at all, and your final command (on line 43) results in the parsimonious solution since you did not specify anything about <including> the remainders.

A second observation to your script is related to the argument "exclude".
There is a change documented in the ChangeLog file (https://cran.r-project.org/web/packages/QCA/ChangeLog) in version 3.7 when this argument was moved from function minimize() to function truthTable().

So if you really want to exclude something, you need to exclude right in the truth table phase not in the minimization phase, because "exclusion" actually means setting the output value to zero (outcome not happening) for any such configuration. That is in fact an operation that belongs to the truth table construction, not to the minimization phase. The end result is the same, since the minimization will use the modified truth table anyways, but it is way more clear to use it where it really is used: in the truth table.

A third observation is related to the inclusion cut-offs: you have used the pair 0.8 (for the presence) and 0.6 (for the absence), which results in one contradictory configuration with an inclusion score in-between (0.789).

Is there a particular reason for this pair, in fact for using the second value 0.6? It seems quite high to make sure a configuration is "absent".

I hope this helps,
Adrian

--
You received this message because you are subscribed to the Google Groups "QCA with R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qcawithr+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qcawithr/76170cb1-693a-436d-a77a-1b98b1a37b4dn%40googlegroups.com.


--
Adrian Dusa
University of Bucharest
Romanian Social Data Archive
Soseaua Panduri nr. 90-92
050663 Bucharest sector 5
Romania

Wuraola

unread,
Sep 21, 2021, 7:18:15 PM9/21/21
to QCA with R
Dear Professor Adrian,

Thanks a lot for your response. Your response is helpful. There is no particular reason for using 0.6 as incl cut off for situations where configuration is absent. I I tried lower incl cut but I got the same result but I have decided to not specify where configuration is absent but just where it is present.

Yes, its true that the object SSR is empty..thanks for calling my attention to that.

One issue that I am now having but not replicated in the script I sent is that in my truthtable, I only have positive (1) and negative (0) output but no remainders. This means no configurations with zero observation so I don't have any output with questio mark. I wonder if this is normal? Kindly let me know if you need a seperate MRE for this or my explanation is enough. I am not able to get parsimonious solution because of this so I had to stop at complex solution.

Best Regards,
Wuraola.

Adrian Dușa

unread,
Sep 22, 2021, 3:22:45 AM9/22/21
to Wuraola, QCA with R
Hello Wuraola,

If you are referring to the examples in the script, in fact there are remainders but just now shown.
By default, the truth table only displays the observed configurations and if you want to see the remainders (as well) you need to activate the argument "complete".

See the difference in action, through simply adding <complete = TRUE> at the end of the truth table command:

> truthTable(Fuzzy3, outcome = "EffectFuzzy", incl.cut = 0.8, show.cases = TRUE, dcc = TRUE, use.letters = TRUE)

    A: FF1Fuzzy
    B: FF2Fuzzy
    C: FF3Fuzzy
  OUT: output value
    n: number of cases in configuration
 incl: sufficiency inclusion score
  PRI: proportional reduction in inconsistency
  DCC: deviant cases consistency

    A  B  C    OUT    n  incl  PRI   DCC
2   0  0  1     0     1  0.400 0.000  4 
4   0  1  1     1     1  0.889 0.800    
6   1  0  1     1     1  0.833 0.750    
8   1  1  1     0     3  0.789 0.692  1 

> truthTable(Fuzzy3, outcome = "EffectFuzzy", incl.cut = 0.8, show.cases = TRUE, dcc = TRUE, use.letters = TRUE, complete = TRUE)

    A: FF1Fuzzy
    B: FF2Fuzzy
    C: FF3Fuzzy
  OUT: output value
    n: number of cases in configuration
 incl: sufficiency inclusion score
  PRI: proportional reduction in inconsistency
  DCC: deviant cases consistency

    A  B  C    OUT    n  incl  PRI   DCC
1   0  0  0     ?     0    -     -      
2   0  0  1     0     1  0.400 0.000  4 
3   0  1  0     ?     0    -     -      
4   0  1  1     1     1  0.889 0.800    
5   1  0  0     ?     0    -     -      
6   1  0  1     1     1  0.833 0.750    
7   1  1  0     ?     0    -     -      
8   1  1  1     0     3  0.789 0.692  1 

Hope this helps,
Adrian

On Wed, 22 Sept 2021 at 02:18, Wuraola <sayhito...@gmail.com> wrote:
Dear Professor Adrian,

Thanks a lot for your response. Your response is helpful. There is no particular reason for using 0.6 as incl cut off for situations where configuration is absent. I I tried lower incl cut but I got the same result but I have decided to not specify where configuration is absent but just where it is present.

Yes, its true that the object SSR is empty..thanks for calling my attention to that.

One issue that I am now having but not replicated in the script I sent is that in my truthtable, I only have positive (1) and negative (0) output but no remainders. This means no configurations with zero observation so I don't have any output with questio mark. I wonder if this is normal? Kindly let me know if you need a seperate MRE for this or my explanation is enough. I am not able to get parsimonious solution because of this so I had to stop at complex solution.

Best Regards,
Wuraola.
 

Wuraola

unread,
Sep 30, 2021, 9:02:37 PM9/30/21
to QCA with R
Dear Professor,

Thank you for your response and I am sorry for my late response. I have been trying to replicate the problem so that I can send another MRE but using few rows and columns in MRE doesn't create the same problem that I am facing. I used complete argument and still no remainders in the truth table which made it impossible to get a parsimonious solution. I first encountered this problem when I used 22 causal conditions but when I reduced my causal conditions to 6, I did not have this problem.

Br,
Wuraola.

Adrian Dușa

unread,
Oct 1, 2021, 1:30:47 AM10/1/21
to Wuraola, QCA with R
Right, I now see what the problem is.
As you might imagine, for 22 causal conditions the number of truth table rows is so great that it would be absolutely impossible to have all configurations observed with no remainders.

In fact, the truth table would be so large that it would not even be possible to print it on the screen.

For this reason, the argument "complete" can be activated for up to 7 conditions only (this should be documented somewhere).

This affects printing on the screen, which is understandable, but has no effect whatsoever to obtaining a parsimonious solution, and/or an intermediate one.

It would still be close to impossible, even with 6 conditions, to obtain a fully saturated truth table, unless using thousands of cases and that woukd not be QCA anymore.

Best,
Adrian

--
You received this message because you are subscribed to the Google Groups "QCA with R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qcawithr+u...@googlegroups.com.

Wuraola

unread,
Oct 1, 2021, 6:07:13 AM10/1/21
to QCA with R

Thank you so much! I wonder if there is a limit to the number of rows that can be used. The reason is because after reading your response (since you said the issue shouldn't affect parsimonious and intermediate solution), I tried to make another MRE (with 15 rows and 10 causal conditions) to show the issue I am having with parsimonious and intermediate solution (even after making truth table, I tried to find CSAs and the code just did not run. It got hanged like I experienced with parsimonous solution), but the MRE worked perfectly, so still not replicating the issue I am having with my main dataset. I now wonder if its due to the fact that I have 150 observations in my main dataset because the only thing different from the MRE I made and my original dataset is the number of rows.

Br,
Wuraola.

Wuraola

unread,
Oct 1, 2021, 6:14:54 AM10/1/21
to QCA with R
Dear Professor,

I have attached the new MRE (the R script) to this message. The issue here does not replicate the issue with my main dataset which I explained in my immediate previous email but even here, after using exclude argument to get rid of CSAs, they are still in the truthtable. I do experience this once in a while. Is there anything I am doing wrong?

Thank you so much for your kind help!
Fuzzy1MRE.R

Adrian Dușa

unread,
Oct 1, 2021, 8:31:48 AM10/1/21
to Wuraola, QCA with R
Wuraola,

There are so many things in your script that I don't even know where to start...

First of all, QCA is all about in-depth knowledge of your cases. Having 150 cases you don't know anything about is not QCA, it resembles a quantitative dataset you want to apply QCA upon. No wonder it doesn't work...

A second hint that this might be a quantitative dataset is the fact that all your raw data is measured on Likert type response scales from 1 to 7. This is usually the type of responses collected from individuals, something not at all well suited for QCA.
(I now wonder if it was a good idea to even provide the possibility to calibrate such categorical data into fuzzy sets in the first place...)

Third and linked to the second, QCA is about macro-units and not micro-units. It is about large groups, communities, countries, nations and certainly not about individual respondents. QCA was simply not built for this kind of purpose... so if you experience troubles with your analysis maybe you should be wondering if you are using the right data for QCA (not why QCA doesn't work using your data).

Looking at your script: I also wonder how you come up with forbidden and crude recodification using as.numeric(x > 0.5). This is essentially transforming fuzzy sets into binary crisp sets, losing valuable information (if you had the right raw data and using the right calibration). This kind of recodification is warned <against> by none other than Charles Ragin, if you read his paper "From fuzzy sets to crisp truth tables'' (it's on the COMPASSS Working Paper series, by the way).

Something like this is just not done in QCA, although I suspect you did that to prevent the R warning that QCA should not have values equal to 0.5 in the calibrated data. In such situations involving 0.5, the correct approach is to properly analyse the situation (having full in-depth knowledge about that specific case) and assume as a researcher whether to allocate 0.49 or 0.51 to that data cell. This is your responsibility and yours alone, and it is against any good practise advice to let the computer decide.

You do make a valid point that constructing a truth table excluding some CSAs might provoke yet another CSAs in the updated truth table. This might very well be and needs to be investigated, but I suspect this is the unsurprising effect of using improper data. Individual responses are so random that there really is almost no difference between such a dataset and a randomly generated data.I've not encountered a similar situation with proper (macro-level and well measured) data for QCA.

I won't go further to investigate your parsimonious and intermediate solutions, because an output using problematic input cannot be anything other than problematic, anyways...

Best wishes,
Adrian

Wuraola

unread,
Oct 2, 2021, 12:37:59 PM10/2/21
to QCA with R
Dear Professor,

I am sorry for taking your time unneccessarily. I also don't think you should investigate further if the data is not suitable for QCA. Thank you so much for your time.

Br,
Wuraola.
Reply all
Reply to author
Forward
0 new messages