conceptMapping: Perform Concept Mapping Analysis

View source: R/conceptMapping.R

conceptMappingR Documentation

Perform Concept Mapping Analysis

Description

This function conducts a concept mapping analysis on sorter data, producing a concept map based on one of three clustering methods: k-means, network analysis, or classical multidimensional scaling (CMDS).

Usage

conceptMapping(
  CMData,
  method = "network",
  numberOfClusters = "auto",
  verbose = TRUE,
  rangeNumberOfClusters = 2:15,
  graph = FALSE,
  numberOfKmeansRestarts = 100,
  backgroundColor = "black",
  main = NULL,
  ...
)

Arguments

CMData

A data frame containing concept mapping data. It must include the columns: "sorterID", "statement", and "stackID".

method

A string specifying the clustering method to use. Options are: "kmeans",
"network", or "cmds". Default is "network".

numberOfClusters

Either a character string ("auto") to determine the optimal number of clusters or an integer specifying the desired number of clusters. Default is "auto".

verbose

Logical, if TRUE, additional information about the processing steps is printed to the console.

rangeNumberOfClusters

A vector of integers specifying the range of clusters to evaluate when
numberOfClusters = "auto". Default is 2:15.

graph

Logical. If TRUE, visualizes clustering results, including heatmaps and cluster-specific plots. Default is FALSE.

numberOfKmeansRestarts

An integer specifying the number of restarts for k-means clustering. Only relevant if method = "kmeans". Default is 100.

backgroundColor

A string specifying the background color of network plots. Default is "black".

main

A string specifying the title for plots. Default is NULL.

...

Additional arguments, such as resolution, which may be passed to specific clustering methods.

Details

The function supports three methods for clustering:

  • "kmeans": Uses k-means clustering with an optional silhouette-based determination of cluster count.

  • "network": Generates a network plot using modularity-based clustering.

  • "cmds": Applies classical multidimensional scaling (CMDS) and clusters the results.

Heatmaps are created for all methods, while additional visualizations depend on the chosen method and graph parameter.

Value

An object of class conceptMap, containing:

allStatements

A data frame with statement numbers and text.

CMData

The original concept mapping data.

method

The clustering method used.

numberOfClusters

The number of clusters identified.

clusterResults

A vector indicating cluster assignments for each statement.

heatmapPlot

A heatmap visualizing co-occurrence patterns.

silhouettePlot

(If applicable) A silhouette plot for "kmeans" or "cmds".

networkPlot

(If applicable) A network plot for "network".

cmdsPlot

(If applicable) A CMDS plot for "cmds".

Examples

# Simulate data with custom parameters:
set.seed(1)
myCMData <- simulateCardData(nSorters=40, pCorrect=.90, attributeWeights=c(1,1,1,1))

# Subject the data to sorter cluster analysis
myCMDataBySorters <- sorterMapping(myCMData)

# Concept mapping on sorter cluster 3 using default "network" method
myCMAnalysis3 <- conceptMapping(myCMDataBySorters[[3]])

# Concept mapping using default network method using 3 clusters
myCMAnalysis3b <- conceptMapping(myCMDataBySorters[[3]], numberOfCluster = 3)

# Concept mapping using kmeans clustering and 3 clusters
myCMAnalysis3c <- conceptMapping(myCMDataBySorters[[3]], method = "kmeans",
  numberOfCluster = 3)





cmAnalysis documentation built on April 4, 2025, 4:27 a.m.