sorterMapping: Cluster Sorters in Concept Mapping Data

View source: R/sorterMapping.R

sorterMappingR Documentation

Cluster Sorters in Concept Mapping Data

Description

This function performs clustering of sorters in concept mapping data based on their sorting behavior. It uses hierarchical clustering and allows the automatic determination of the optimal number of clusters or a user-defined number.

Usage

sorterMapping(
  CMData,
  numberOfSorterClusters = "auto",
  verbose = TRUE,
  rangeNumberOfClusters = 2:15,
  graph = TRUE
)

Arguments

CMData

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

numberOfSorterClusters

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

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
numberOfSorterClusters = "auto". Default is 2:15.

graph

Logical. If TRUE, plots the dendrogram and silhouette method results. Default is TRUE.

Details

This function clusters sorters based on their sorting behavior using hierarchical clustering with Ward's method. If numberOfSorterClusters = "auto", the silhouette method is used to determine the optimal number of clusters within the range specified by rangeNumberOfClusters.

Each cluster's data is validated for its suitability for concept mapping, and cluster-specific data is returned as a list of data frames. Graphical output includes a dendrogram and silhouette plot if graph = TRUE.

Value

A list of data frames, each representing the concept mapping data for a cluster of sorters. If only one cluster is found, the original CMData is returned.

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)

# Subject the data to sorter cluster analysis with a predefined number of sorter clusters
myCMDataBySorters <- sorterMapping(myCMData, numberOfSorterClusters=2)


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