# Number of Phones in a word: Numerical or Categorical Data?

I'm trying to model a subset of the MALD dataset (language related) using Gaussian Distribution.

One of the variables I'm working with is 'Number of Phones' (NumPhones in MALD) in a given word or pseudoword (Item in MALD) and I'm trying to explore two things with my model: 1) relation between reaction time (numerical continuous data) and lexical status (categorical; IsWord in MALD), which says whether a word is an actual word or a pseudoword and 2) is this effect is impacted by the number of phones in the target word/pseudoword.

For 2), I'm not sure if number of phones (ranging from 1-17) in a word is a categorical ordinal or numerical discrete data? I learnt that counts are numerical but in order to answer 2), I'd need to apply some treatment coding to this variable (number of phones), for which I require it to be categorical, do I not? Is there such a thing as contrast coding (treatment) for numerical variables?

The reason why I think it is categorical despite being countable is that the numbers in this variable represent the number of phones in a word, which could be seen as a category (?). As in, for whichever words/pseudowords the 'number of phones' is '10', we can say that those words are in the "category of 10-phone words"?

Yet, it seems straightforward to just take it as a numerical discrete data - but how does one do treatment coding for numerical variables? Won't there simply be too many (17) levels? And what would be the "reference level"? Intuitively, it should be 0-phones but there are no words with "0-phones" (in real life or in my data).

• You write multiple times that this is a number. Why do you think it makes sense to code it as a category? If you code it as numerical, then "10-phone words" will already be treated the same. Are you concerned about possible nonlinearities? If so, take a look at splines. Commented Dec 5, 2023 at 9:32
• I'm hesitant to take it as numerical discrete data because I'd need to apply contrast coding on it, which as I understand is typically only done for categorical data: vasishth.github.io/bayescogsci/book/ch-contr.html Besides, even if I take NumPhones as categorical, that will leave me with 17 levels (a lot). And I can't take 0 as a reference level because there are no "0-phone' words. Or do you think it's appropriate to take '1-phone' words as the 0 reference level and compare all other cases to this? This would be done to explore question (2) in my post... Commented Dec 5, 2023 at 9:37
• You have it the wrong way around: if your data are categorical, then you may want to use contrast coding (or other way to represent it). If your data is numerical, then you just feed it in as-is, or potentially spline transform it. Why do you think you need to contrast code? Commented Dec 5, 2023 at 9:38
• I thought contrast coding was necessary to find the effect of one variable (typically a categorical one) on another effect (the effect of lexical status on reaction times, in my case). Is this not true? How else does one study the effect of NumPhones on reaction times, affected by lexical status? (that is, NumPhones is a variable that hypothetically has an influence on how RTs are affected by lexical status). Commented Dec 5, 2023 at 9:44
• That question is really orthogonal to the coding of predictors. What you describe sounds like an interaction between lexical status and number of phones in a model for reaction times. Take a look at the interaction plots at the Wikipedia page. Plot RTs (y axis) against number of phones (x axis) separately by lexical status. You can plot observed means, or model fits. For the latter, you can just use number of phones as is (leading to linear plots), or consider splines. Commented Dec 5, 2023 at 9:52

Some basics wrt psycholinguistics may help CV participants here (the OP undoubtedly knows this). First, the field posits that linguistic perception is categorical, "the grouping of like items along a continuum (1)."

So, wrt your first question, for decades applied psycholinguisticians have been studying the perceptual boundaries between phones in the context of reaction time, e.g., here Subcategorical phonetic mismatches slow phonetic judgments (2) and here Categorical perception of English /r/ and /l/ by Japanese bilinguals (3).

Your second question sounds like a much more recent area of study made possible by databases such as MALD but why would there be any ordinal ranking to a count of the number of phones?

There are many ways to code categorical information, most of which are limited to a non-masssive number of possible levels. One approach which is not is impact coding which has been used to code categorical information as massive as zip codes (4).

What you describe sounds like an interaction between lexical status and number of phones (do you mean phonemes?) in a model for reaction times.

Take a look at the interaction plots at the Wikipedia page. Plot RTs (y axis) against number of phones (x axis) separately by lexical status. You can plot observed means, or model fits. For the latter, you can just use number of phones as is (leading to linear plots), or consider splines. Splines are a good choice if you suspect nonlinearities.

Alternatively, you could take a look at moderator-mediator analysis. You can again use spline transforms on the number of phones.

Contrast coding is not relevant for numerical predictors. If your data are categorical, then you may want to use contrast coding (or other way to represent it). If your data is numerical, then you just feed it in as-is, or potentially spline transform it.