RCA-package {RCA} | R Documentation |
Relational Class Analysis
Description
Relational Class Analysis (RCA) is a method for detecting heterogeneity in attitudinal data (as described in Goldberg A., 2011, Am. J. Soc, 116(5)).
The RCA
function produces an object of class RCA
. This object includes: (1) a vector of class membership —— $membership
; (2) a list of modules —— $modules
; and (3) the relationality matrix —— $R
.
Usage
RCA(matrix, max = NULL, min = NULL, num = 1000,
alpha = 0.05)
## S3 method for class 'RCA'
print(x, ...)
## S3 method for class 'RCA'
plot(x, module = NULL, colorblind = FALSE,
heatmap = TRUE, heat_labels = FALSE,
drop_neg_ties = TRUE, layout = layout.kamada.kawai,
edge_color = "gray", vertex_color = "white",
vertex_frame_color = "black", vertex_size = 20,
vertex_label_color = "black", vertex_label_cex = 0.8,
margin = 0, ...)
Arguments
matrix |
a matrix of size |
max |
either a single integer or a vector of length |
min |
either a single integer or a vector of length |
num |
the number of bootstrap samples to be used in testing for significant relationalities. The default is |
alpha |
a value between |
x |
an object of class |
module |
the module number to graph. |
colorblind |
change the graph color schemes to be colorblind friendly. Default is |
heatmap |
choose which type of graph to produce. Default is |
heat_labels |
add correlation labels to the heatmap. Default is |
drop_neg_ties |
drop negative graph edges. Default is |
layout |
choose a layout for plotting graphs. Default is |
edge_color |
color of the graph edges. Default is |
vertex_color |
color of the vertices. Default is |
vertex_frame_color |
color of the vertex frames. Default is |
vertex_size |
vertex frame size. Default is |
vertex_label_color |
color of the vertex labels. Default is |
vertex_label_cex |
size of the vertex labels. Default is |
margin |
adjust the margins of the graph. Default is |
... |
additional arguments |
Details
RCA computes the relationality between all pairs of observations and partitions the sample into subgroups of schematically overlapping respondents such that those who subscribe to the same logic are clustered together. It accomplishes this by performing the following sequence:
1.) RCA computes a measure of relationality for each pair of observations in the data set, resulting in a complete, undirected, and weighted graph.
2.) Graph edges whose weights are statistically insignificant are removed. Remaining edges are transformed by their absolute value.
3.) RCA partitions the graph into subgroups of schematically similar observations using a graph-partitioning algorithm.
Author(s)
Amir Goldberg, Sarah K. Stein
Maintainer: Amir Goldberg <amirgo@stanford.edu>
References
Goldberg, Amir. "Mapping shared understandings using relational class analysis: the case of the cultural omnivore reexamined." American Journal of Sociology 116.5 (2011): 1397-1436.
Examples
# Test matrix
set.seed <- 2
matrix <- round(matrix(runif(100, min = 0, max = 6),
ncol = 5))
rca <- RCA(matrix)
rca <- RCA(matrix, max = rep(6, 5), min = rep(0, 5))
rca <- RCA(matrix, max = 6, min = 0)
rca <- RCA(matrix, num = 10000, alpha = 0.1)
summary(rca)
print(rca)
rca$membership
rca$modules[[1]]$matrix
rca$R
# Heatmap
plot(rca, module = 1)
plot(rca, module = 1, colorblind = TRUE,
heat_labels = TRUE)
# IGraph
plot(rca, module = 1, heatmap = FALSE)
plot(rca, module = 1, heatmap = FALSE,
layout = layout.circle, edge_color = "red",
vertex_color = "gray", vertex_frame_color = "red",
vertex_size = 30, vertex_label_color= "red",
vertex_label_cex = 1, margin = 0.2)