An R package for conducting Multi-Dimensional Analysis (MDA), a statistical procedure developed by Douglas Biber for analyzing linguistic variation across genres, registers, and text types.
Multi-Dimensional Analysis (MDA) is a specialized application of factor analysis that identifies co-occurring patterns in linguistic features. It is based on the principle that some linguistic variables co-occur (e.g., nouns and adjectives) while others inversely co-occur (e.g., nouns and pronouns).
MDA typically involves:
The linguistic features used in this package are based on Biber’s original research, documented in the corpora and pseudobibeR packages.
mda_loadings()
performs factor analysis and calculates dimension scoresInstall the development version from GitHub:
# Install from GitHub
::install_github("browndw/mda.biber")
devtools
# Load the package
library(mda.biber)
library(mda.biber)
library(dplyr)
# Load and prepare the built-in MICUSP dataset
data(micusp_biber)
# Extract discipline codes and convert to factor
<- micusp_biber %>%
d mutate(doc_id = stringr::str_extract(doc_id, "^[A-Z]+")) %>%
mutate(doc_id = as.factor(doc_id)) %>%
select(where(~ any(. != 0))) # Remove zero-only columns
# Determine optimal number of factors
screeplot_mda(d)
# Perform MDA with 2 factors
<- mda_loadings(d, n_factors = 2)
mda_result
# View dimension scores
head(mda_result)
# Access group means and factor loadings
attributes(mda_result)$group_means
attributes(mda_result)$loadings
The package provides several visualization functions:
# Show category means along a dimension
stickplot_mda(mda_result, n_factor = 1)
# Combine stick plot with factor loadings heatmap
heatmap_mda(mda_result, n_factor = 1)
# Show dimension scores with contributing variables
boxplot_mda(mda_result, n_factor = 1)
The package includes micusp_biber
, a dataset
containing:
Function | Purpose |
---|---|
mda_loadings() |
Core MDA analysis with factor analysis and dimension scoring |
screeplot_mda() |
Generate scree plots to determine optimal number of factors |
stickplot_mda() |
Create stick plots showing category means along dimensions |
heatmap_mda() |
Combine stick plots with factor loading heatmaps |
boxplot_mda() |
Display dimension scores with contributing variable vectors |
If you use this package in your research, please cite:
Brown, D. (2024). mda.biber: Functions for Multi-Dimensional Analysis.
R package version 1.0.1. https://github.com/browndw/mda.biber
This package is licensed under the MIT License.