cluster: Diagnostic tool for clustered data

Description Usage Arguments Author(s) References See Also Examples

View source: R/cluster.R

Description

Function returns pooled, within, and between consistencies for the relationship between two sets, for an object of class "qca", and for a Boolean expression.

Usage

1
cluster(data=NULL, results, outcome, unit_id, cluster_id, sol = 1, necessity = FALSE)

Arguments

data

A data frame in the long format containing both a colum with the unit names and a column with the cluster names. Column names should be in capital letters.

results

An object of class "qca". For performing cluster diagnostics of the sufficient solution for the negated outcome one must only use the minimize() result from the sufficiency analysis of the negated outcome. The argument results can also be a vector, a character string, or a boolean expression of the form e.g. "A*~B + ~B*C".

outcome

A character string with the name of the outcome in capital letters. When performing cluster diagnostics of the sufficient solution for the negated outcome one must only use the minimize() result from the sufficiency analysis of the negated outcome in the argument results. When performing cluster diagnostics for boolean expressions or vectors the negated outcome can be used by inserting a tilde in the outcome name in the argument outcome. The outcome can also be a vector.

unit_id

A character string with the name of the vector containing the units (e.g. countries).

cluster_id

A character string with the name of the vector containing the clustering units (e.g. years).

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.

necessity

Logical. Perform the diagnostic for the relationship of necessity?

Author(s)

Ioana-Elena Oana

References

Garcia-Castro, Roberto, and Miguel A. Arino. 2016. "A General Approach to Panel Data Set-Theoretic Research."" Journal of Advances in Management Sciences & Information Systems 2: 6376.

See Also

minimize

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
# Import your clustered data in the long format. 
# For example:

data(SCHLF)

# Get the intermediate solution:

sol_yi <- minimize(SCHLF, 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 pooled, within, and between consistencies for the second intermediate solution:

cluster(SCHLF, sol_yi, "EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR", sol = 2)
              
# or:

cluster(SCHLF, sol_yi, "EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR", sol = "c1p1i2")

# Get pooled, within, and between consistencies for EMP as necessary for EXPORT:

cluster(SCHLF, results="EMP", outcome="EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR", necessity=TRUE)
# or:

cluster(results=SCHLF$EMP, outcome=SCHLF$EXPORT, unit_id = SCHLF$COUNTRY, 
              cluster_id = SCHLF$YEAR, necessity=TRUE)
              
# Get pooled, within, and between consistencies for ~EMP as necessary for EXPORT:

cluster(SCHLF, results="~EMP", outcome="EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR", necessity=TRUE)
# or:

cluster(results=1-SCHLF$EMP, outcome=SCHLF$EXPORT, unit_id = SCHLF$COUNTRY, 
              cluster_id = SCHLF$YEAR, necessity=TRUE)                  
              
# Get pooled, within, and between consistencies for EMP*~MA*STOCK as sufficient for EXPORT:

cluster(SCHLF, "EMP*~MA*STOCK", "EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR") 
              
# Get pooled, within, and between consistencies for EMP*MA + ~STOCK as sufficient for ~EXPORT:

cluster(SCHLF, "EMP*MA + ~STOCK", "~EXPORT", unit_id = "COUNTRY", 
              cluster_id = "YEAR")              

nenaoana/SetMethods documentation built on Aug. 3, 2018, 1:17 a.m.