01 data preperation

Author

Julius Fenn, Michael Gorki

Mit Cognitive-Affective Maps zu einem gemeinsamen gesellschaftlichen Verständnis von Nachhaltigkeit

Daten aufbereiten

Daten einlesen

Cognitive-Affective Maps (CAMs) liegen als Rohdaten vor und werden systematisch zusammengeführt:

########################################
# CAM-Dateien erstellen
########################################
### einzelne Dateien für Knoten, Verbindungen und Zusammenschlüsse erstellen
CAMfiles <- create_CAMfiles(datCAM = raw_CAM, reDeleted = TRUE)
Nodes and connectors, which were deleted by participants were removed. 
 # deleted nodes:  162 
 # deleted connectors:  32

Insgesamt liegen 62 CAMs vor und es wurden 587 einzigartige Konzepte gezeichnet, unter Berücksichtigung von Doppelungen sind es insgesamt 731 Konzepte. Weiter wurden 901 Verbindungen gezogen zwischen den Konzepten.

Daten interaktiv darstellen

Die Daten kann man auch als interaktive Tabelle darstellen:

DT::datatable(CAMfiles[[1]], options = list(pageLength = 5))

Es ist ersichtlich, dass zu jedem gezeichneten Konzept kein Kommentar gezeichnet wurde, dies wurde nur in insgesamt 30 Prozent der Fälle genutzt.

CAMs zeichnen

########################################
# CAMs zeichnen
########################################
CAMdrawn <- draw_CAM(dat_merged = CAMfiles[[3]],
                     dat_nodes = CAMfiles[[1]],ids_CAMs = "all",
                     plot_CAM = TRUE,
                     useCoordinates = TRUE,
                     relvertexsize = 3,
                     reledgesize = 1)
processing 62 CAMs... 

[1] "== participantCAM in drawnCAM"

Daten auswerten

Emotionaler Gehalt und Struktur von CAMs

########################################
# CAMs Netzwerkparameter
########################################
networksIndicators <- compute_indicatorsCAM(drawn_CAM = CAMdrawn,
                                        micro_degree =  c("Bedingungsloses Grundeinkommen"),
                                        micro_valence = c("Bedingungsloses Grundeinkommen"),
                                        micro_centr_clo = c("Bedingungsloses Grundeinkommen"),
                                        micro_transitivity = c("Bedingungsloses Grundeinkommen"),
                                        largestClique = FALSE)

DT::datatable(networksIndicators, options = list(pageLength = 5))                                     

Wie war die emotionale Bewertung der CAMs insgesamt?

# Use ggplot to create a histogram
p <- ggplot(networksIndicators, aes(x=mean_valence_macro)) +
   geom_histogram(aes(y=..density..),colour="black", fill="white", bins=20) +
  geom_density(alpha=.2, fill="#add8e6")  # Add a density curve

  # Apply minimal theme and increase font size
p <- p + theme_apa() + theme(text = element_text(size = 20)) + xlab(label = "mittlere emotionale Bewertung")

# Print the plot
print(p)  
Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
ℹ Please use `after_stat(density)` instead.

Wie viele Konzepte wurden im Mittel gezeichnet?

# Use ggplot to create a histogram
p <- ggplot(networksIndicators, aes(x=num_nodes_macro)) +
   geom_histogram(aes(y=..density..),colour="black", fill="white", bins=20) +
  geom_density(alpha=.2, fill="#add8e6")  # Add a density curve

  # Apply minimal theme and increase font size
p <- p + theme_apa() + theme(text = element_text(size = 20)) + xlab(label = "mittlere Anzahl gezeichneter Konzepte pro CAM")

# Print the plot
print(p)  

CAM aggregieren

########################################
# aggregierte CAM erstellen
########################################
CAMaggregated <- aggregate_CAMs(dat_merged = CAMfiles[[3]], dat_nodes = CAMfiles[[1]],
                                ids_CAMs = sel_ids)
[1] "aggregate_CAMs: using participant CAM ids"
processing 62 CAMs... 
[1] "== participantCAM in drawnCAM"
g = CAMaggregated[[2]]
g2 = simplify(CAMaggregated[[2]])

E(g2)$weight = sapply(E(g2), function(e) {
  length(all_shortest_paths(g, from=ends(g2, e)[1], to=ends(g2, e)[2])$res) } )
E(g2)$weight = E(g2)$weight / 2

V(g2)$color[V(g2)$value <= .5 & V(g2)$value >= -.5] <- "yellow"

V(g2)$shape <- NA
V(g2)$shape <- ifelse(test = V(g2)$color == "yellow", yes = "square", no = "circle")


plot(g2, edge.arrow.size = .5,
     layout=layout_nicely, vertex.frame.color="black", asp = .5, margin = -0.1,
     vertex.size = 5, vertex.label.cex = .9)                              

Wortliste erstellen

########################################
# Wortliste erstellen
########################################
CAMwordlist <- create_wordlist(
  dat_nodes = CAMfiles[[1]],
  dat_merged = CAMfiles[[3]],
  order = "frequency",
  splitByValence = FALSE,
  comments = FALSE,
  raterSubsetWords = NULL,
  rater = FALSE
)   
processing 62 CAMs... 
[1] "== participantCAM in drawnCAM"
DT::datatable(CAMwordlist, options = list(pageLength = 5))