#### Lexical Diversity Metrics

Lexical diversity measures vocabulary richness by quantifying the relationship between unique words (types) and total words (tokens).

#### Available Metrics

##### TTR (Type-Token Ratio)

- Formula: Types / Tokens
- Range: 0 to 1
- Note: Sensitive to text length

##### CTTR (Corrected TTR)

- Formula: Types / sqrt(2 × Tokens)
- Note: Partially corrects for text length

##### MSTTR (Mean Segmental TTR)

- Method: Divides text into segments (default 100 words) and averages TTR
- Range: 0 to 1

##### MATTR (Moving Average TTR)

- Method: Calculates TTR for a moving window and averages
- Range: 0 to 1
- Note: More stable across text lengths

##### MTLD (Measure of Textual Lexical Diversity)

- Method: Calculates mean length of word strings maintaining TTR above threshold
- Note: Text-length independent

##### Maas

- Formula: (log(Tokens) - log(Types)) / log(Tokens)²
- Note: Lower values = higher diversity (inverse scale)

##### Yule's K

- Method: Based on word frequency distribution
- Note: Lower values = higher diversity (inverse scale)

##### Simpson's D

- Method: Probability two randomly selected words are the same
- Range: 0 to 1
- Note: Lower values = higher diversity (inverse scale)

#### Usage Notes

- MTLD and MATTR are more stable across different text lengths
- TTR is sensitive to text length - compare only similar-length texts
- Maas, Yule's K, and Simpson's D use inverse scales (lower = more diverse)

Learn More:

- quanteda textstat_lexdiv Documentation