Diversity of partitions

Ingo Rohlfing

2021-10-26

library(QCAcluster)
library(knitr) # nicer html tables

For illustration, we use data from Schwarz 2016. The data structure is an unbalanced panel with eight countries, ten years and 74 observations in total. partition_div() requires as input only parameters for the calculation of the pooled solution plus identifiers for the units (units) and periods (time).

# load data (see data description for details)
data(Schwarz2016)
Schwarz_div <- partition_div(Schwarz2016, 
                             units = "country", time = "year", 
                             cond = c("poltrans", "ecotrans", "reform", "conflict", "attention"), 
                             out = "enlarge", 1, 0.8)
kable(Schwarz_div)
type partition diversity diversity_1 diversity_0 diversity_per diversity_per_1 diversity_per_0
pooled - 11 5 6 1.0000000 0.4545455 0.5454545
between 04 3 0 3 0.2727273 0.0000000 0.2727273
between 05 3 0 3 0.2727273 0.0000000 0.2727273
between 06 3 0 3 0.2727273 0.0000000 0.2727273
between 07 5 1 4 0.4545455 0.0909091 0.3636364
between 08 4 0 4 0.3636364 0.0000000 0.3636364
between 09 2 2 0 0.1818182 0.1818182 0.0000000
between 10 4 3 1 0.3636364 0.2727273 0.0909091
between 11 5 4 1 0.4545455 0.3636364 0.0909091
between 12 5 4 1 0.4545455 0.3636364 0.0909091
between 13 1 1 0 0.0909091 0.0909091 0.0000000
within AL 4 1 3 0.3636364 0.0909091 0.2727273
within BA 3 0 3 0.2727273 0.0000000 0.2727273
within HR 2 2 0 0.1818182 0.1818182 0.0000000
within KS 2 0 2 0.1818182 0.0000000 0.1818182
within ME 3 3 0 0.2727273 0.2727273 0.0000000
within MK 5 5 0 0.4545455 0.4545455 0.0000000
within RS 4 0 4 0.3636364 0.0000000 0.3636364
within TR 4 4 0 0.3636364 0.3636364 0.0000000

The dataframe shows how the cases are distributed across truth table rows. The information is presented in absolute numbers and relative terms and for all truth table rows and the subset of consistent and inconsistent rows.

The table shows that while the pooled data covers 11 truth table rows, the maximum number of rows that a partition covers is 5, which equals about 45% of all rows. The minimum number of diversity is represented by the partition for the year 2013 because it covers only one row.

The output of the function can also be used to see whether all cases of a partition fall into consistent or inconsistent rows. Whenever the value for diversity_1 or diversity_0 is 0, there is no variation in the type of row for the partition. In this example, this concerns 13 partitions.

Other packages used in this vignette

Yihui Xie (2021): knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.33.

Yihui Xie (2015): Dynamic Documents with R and knitr. 2nd edition. Chapman and Hall/CRC. ISBN 978-1498716963

Yihui Xie (2014): knitr: A Comprehensive Tool for Reproducible Research in R. In Victoria Stodden, Friedrich Leisch and Roger D. Peng, editors, Implementing Reproducible Computational Research. Chapman and Hall/CRC. ISBN 978-1466561595