First step: let’s load in the data and required packages. This is the standard McMurray & Jongman dataset of fricative and vowel measures that we’ve been using this term.

library(tidyverse)
library(yarrr)

mcm <- read_csv("/Users/Thomas/Library/CloudStorage/OneDrive-YorkUniversity/LING 3300/Datasets/McMurrayJongmanFricativeAcoustics.csv")

Interactions: Two categorical variables

Today we’re going to talk about interactions. Previously, we compared the COG (that is, M1) of the fricatives in this dataset, finding that this differed by place of articulation. For instance, we found that overall, interdental fricatives (marked ‘th’ and ‘dh’) have lower COG than alveolar fricatives (‘s’ and ‘z’). But what if we’re also interested in whether there’s an interaction between voicing and place of articulation? That is: Is the effect of place of articulation the same across voicing conditions, and the effect of voicing the same across place of articulation conditions, or is something more complex going on?

# Assigning 4 place of articulation levels
mcm$poa <- ifelse(mcm$Fricative %in% c("f", "v"), "labiodental", ifelse(mcm$Fricative %in% c("th", "dh"), "interdental", ifelse(mcm$Fricative%in% c("s", "z"), "alveolar", "postalveolar")))

# Assigning voiced vs. voiceless in a column
mcm$voicing <- ifelse(mcm$Fricative == "dh" | mcm$Fricative == "v" | mcm$Fricative == "z" | mcm$Fricative == "zh", "voiced", "voiceless")

# Looking at a boxplot of the overall data by Fricative
ggplot(mcm) + 
  geom_boxplot(aes(x = poa, y = M1, color = voicing))
## Warning: Removed 7 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

Looking at the data this way, it seems like within alveolar and postalveolar places of articulation, there may be no significant difference in COG between the voiced and voiceless fricatives, while at the interdental and labiodental places, the fricatives exhibit COG differences between voiced and voiceless that may be significant.

For simplicity’s sake, let’s consider just the alveolar and interdental fricatives. You can run models with interactions involving as many levels and factors as you need, but for now we’ll start simple for ease of interpretability.

# Filter so we just have the alveolars and interdentals for now
mcm2 <- mcm %>%
  filter(poa == "alveolar" | poa == "interdental")

# Looking at a boxplot of the data again
ggplot(mcm2) + 
  geom_boxplot(aes(x = poa, y = M1, color = voicing))
## Warning: Removed 3 rows containing non-finite outside the scale range
## (`stat_boxplot()`).

# Can also look at it as a pirate plot
pirateplot(M1 ~ voicing * poa, mcm2, inf.method = 'ci')

Let’s now find the by-Talker, by-place of articulation, by-voicing meanCOGs.

# Getting speaker COG means for each place of articulation and voicing
COG_means <- mcm2 %>% 
  group_by(Talker, poa, voicing) %>% 
  summarise(meanCOG = mean(M1, na.rm = T))

# Looking at a boxplot of the speaker mean data by poa + voicing
ggplot(COG_means) + 
  geom_boxplot(aes(x = poa, y = meanCOG, color = voicing))

# Looking at a pirate plot of the speaker mean data by poa + voicing
pirateplot(meanCOG ~ voicing * poa, COG_means, inf.method = 'ci')

Again, note here the interaction of voicing and place of articulation. It is not the case that voicing has the same effect on COG for both of these places of articulation: the patterns are clearly different, in that there is no effect of voicing in alveolar fricatives ‘s’ and ‘sh’, but there is an effect of voicing in interdental fricatives, such that the voiced ‘dh’ has what looks like a significantly lower COG than the voiceless ‘th’. You can also flip around the order you’ve put voicing and poa if you want to see the interaction from another perspective: When we just look at these four fricatives, there is no apparent effect of place of articulation within the voiceless fricatives, while within the voiced fricatives, ‘dh’ seems to have a significantly lower COG than ‘z’.

# Looking at a pirate plot of the speaker mean data by poa + voicing
pirateplot(meanCOG ~ poa * voicing, COG_means, inf.method = 'ci')

Interactions between two categorical variables using treatment coding

Alright, now let’s get to making and interpreting the model.

Let’s first do this with treatment coding. We’ll make sure that the levels we want as our baseline/control are listed first in the order of levels, and we’ll check that they’re contrast coded correctly. Let’s take ‘alveolar’ as the baseline for poa, and ‘voiceless’ as the baseline for voicing. That means that all of our effects will be interpreted as the pairwise difference from voiceless alveolars – that is, ‘s’.

The only new thing you’ll have to do in terms of writing the linear model is to use the * symbol between the factors whose interaction you want to test.

# Putting alveolar as the first poa factor to make it the baseline in treatment coding
COG_means$poa <- factor(COG_means$poa, levels = c("alveolar", "interdental"))

# Putting voiceless as the first voicing factor to make it the baseline in treatment coding
COG_means$voicing <- factor(COG_means$voicing, levels = c("voiceless", "voiced"))

# No need to tell R to do treatment coding, it will do it by default. We can double check, though:
contrasts(COG_means$poa)
##             interdental
## alveolar              0
## interdental           1
contrasts(COG_means$voicing)
##           voiced
## voiceless      0
## voiced         1
# Making model
fit.dummy <- lm(meanCOG ~ voicing * poa, COG_means)
summary(fit.dummy)
## 
## Call:
## lm(formula = meanCOG ~ voicing * poa, data = COG_means)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3728.8  -470.4    39.5   593.1  2202.5 
## 
## Coefficients:
##                              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                   6860.75     227.54  30.152   <2e-16 ***
## voicingvoiced                  -88.45     321.79  -0.275    0.784    
## poainterdental                 191.97     321.79   0.597    0.553    
## voicingvoiced:poainterdental -2070.72     455.07  -4.550    2e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1018 on 76 degrees of freedom
## Multiple R-squared:  0.4364, Adjusted R-squared:  0.4141 
## F-statistic: 19.61 on 3 and 76 DF,  p-value: 1.628e-09

In order to interpret these numbers, let’s remind ourselves of the pirateplot we made above. You’ll notice that conveniently, the code inside pirateplot() can be exactly the same as what we put inside lm()!

# Looking at a pirate plot of the speaker mean data by poa + voicing
pirateplot(formula = meanCOG ~ voicing * poa, data = COG_means, inf.method = 'ci')

Looking at the intercept estimate, we see that the mean of COG means for ‘s’, our voiceless alveolar baseline, is 6861 Hz (check on the pirate plot to confirm!). We can ignore the rest of that row (the error, t-value, and p-value) because we don’t really care about whether 6860 is signficantly different from 0.

The next line down says “voicingvoiced”. That means that this line will compare ‘s’ to its voiced alveolar counterpart, ‘z’. We see that the mean of ‘z’ is 88 Hz lower than 6861 (check on the pirate plot to see the mean of ‘z’ at 6773), but that this is not a significant difference (p = 0.784).

The next line down says “poainterdental”. That means that this line will compare ‘s’ to its voiceless interdental counterpart, ‘th’. We see that the mean of ‘th’ is 192 Hz higher than 6861 (check on the pirate plot to see the mean of ‘z’ at 7053), but that this is not a significant difference (p = 0.553).

The next line down says “poainterdental:poainterdental”. That’s our interaction term! It means that this line will compare ‘s’ to its voiced interdental counterpart, ‘dh’. In order to do the math here, we need to add up the intercept PLUS the main effect of voicing PLUS the main effect of poa PLUS the interaction effect. Thus the mean of ‘dh’ is 6861 - 88 + 192 - 2071 (check on the pirate plot to see the mean of ‘dh’ at 4894), and this is significantly different from our baseline condition of voiceless alveolar ‘s’ (p < 0.001).

If you wanted to see whether the other pairwise differences are significant (like between ‘th’ and ‘dh’, or between ‘th’ and ‘z’), you’d have to re-level the contrasts in one or both of the variables to have a different baseline. There’s also a package called “emmeans” which can list out the pairwise differences all at once and simultaneously do p-value correction for multiple comparisons. We might not get to that in this module, though.

Interactions between two categorical variables using sum coding

I’ve mentioned before that when we run interactions, it’s often preferable to sum code. This will look at the data from a different perspective: rather than doing pairwise comparisons of each of the fricatives (‘s’ vs. ‘z’; ‘s’ vs. ‘th’, ‘s’ vs. ‘dh’, etc.), sum coding will allow us to answer the questions: “Does voicing generally have an effect on these fricatives?” + “Does poa generally have an effect on these fricatives?” + “Does the effect of one of these variables change depending on the value of the other variable”?”

Remember that in sum coding, the “held-out” condition is sort of like our baseline – that’s the one we’re going to be setting to -1. This held-out condition will be listed last in the order of levels. So if we want once again to have a baseline of voiceless and a baseline of alveolar, we’ll need to list each of those last within our factor() function. We’ll then apply contr.sum(2) to each of the variables, because they each have two levels. We’ll then fit the same exact model as before, looking for the interaction between voicing and poa.

# Putting alveolar as the last poa factor since that's going to be our held-out condition in sum coding
COG_means$poa <- factor(COG_means$poa, levels = c("interdental", "alveolar"))

# Putting voiceless as the last voicing factor since that's going to be our held-out condition in sum coding
COG_means$voicing <- factor(COG_means$voicing, levels = c("voiced", "voiceless"))

# Need to tell R to do sum coding for both of these, with 2 levels in each
contrasts(COG_means$poa) <- contr.sum(2)
contrasts(COG_means$voicing) <- contr.sum(2)

# Check the contrasts to make sure
contrasts(COG_means$poa)
##             [,1]
## interdental    1
## alveolar      -1
contrasts(COG_means$voicing)
##           [,1]
## voiced       1
## voiceless   -1
# Making model
fit.sum <- lm(meanCOG ~ voicing * poa, COG_means)
summary(fit.sum)
## 
## Call:
## lm(formula = meanCOG ~ voicing * poa, data = COG_means)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3728.8  -470.4    39.5   593.1  2202.5 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     6394.8      113.8  56.209  < 2e-16 ***
## voicing1        -561.9      113.8  -4.939 4.54e-06 ***
## poa1            -421.7      113.8  -3.707 0.000397 ***
## voicing1:poa1   -517.7      113.8  -4.550 2.00e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1018 on 76 degrees of freedom
## Multiple R-squared:  0.4364, Adjusted R-squared:  0.4141 
## F-statistic: 19.61 on 3 and 76 DF,  p-value: 1.628e-09

Now let’s figure out what those numbers mean.

The intercept here is 6395, which is the mean of the means of the voicing conditions and the poa conditions. In this case, because our data is nicely balanced and we have the same number of observations in each of our subsets, the mean of the voiced and voiceless means will be the same as the mean of the alveolar and interdental means: both of these are 6395, as illustrated below:

# We'll make a dataset that's just the voiceless means and another that's just the voiced means
just_voiceless <- COG_means %>%
  filter(voicing == "voiceless")
just_voiced <- COG_means %>%
  filter(voicing == "voiced")

# We'll make a dataset that's just the alveolar means and another that's just the interdental means
just_alveolar <- COG_means %>%
  filter(poa == "alveolar")
just_interdental <- COG_means %>%
  filter(poa == "interdental")

# What are the means of each of these subsets?
mean(just_voiceless$meanCOG) # 6957
## [1] 6956.734
mean(just_voiced$meanCOG) # 5833
## [1] 5832.922
mean(just_alveolar$meanCOG) # 6817
## [1] 6816.525
mean(just_interdental$meanCOG) # 5973
## [1] 5973.13
# What's the mean of the voiceless and voiced means?
(mean(just_voiceless$meanCOG) + mean(just_voiced$meanCOG)) / 2 # 6395
## [1] 6394.828
# What's the mean of the alveolar and voiceless means?
(mean(just_alveolar$meanCOG) + mean(just_interdental$meanCOG)) / 2 # 6395
## [1] 6394.828

Alright, so that’s the intercept. The next line says ‘voicing1’. Remember how we’ve set voiceless to -1 and voiced to 1 in this sum coding? It’s using ‘1’ to mean “voiced”. So if we take 6395 - 562, we get 5833. Look just above and you’ll see that this is the mean of the voiced subset of the data, which includes the alveolar and interdental voiced fricatives. The p-value is telling us that this mean of voiced fricatives is significantly different from the mean of means, meaning that voicing has a significant “main effect” on COG.

The next line says ‘poa1’. Remember how we’ve set alveolar to -1 and interdental to 1 in this sum coding? It’s using ‘1’ to mean “interdental”. So if we take 6395 - 422, we get 5973. Look just above and you’ll see that this is the mean of the interdental subset of the data, which includes the voiceless and voiced interdental fricatives. The p-value is telling us that this mean of interdental fricatives is significantly different from the mean of means, meaning that poa has a significant “main effect” on COG.

Now for something a bit more complicated: The next line says ‘voicing1:poa1’. Since ‘1’ in voicing is “voiced” and ‘1’ in poa is “interdental”, what this telling us is what the added effect of being both voiced and interdental is, on top of the main effects of being voiced and being interdental. Here’s what that means:

First, we account for the main effect of voicing: We start with 6395 and add -562 (also known as subtracting 562) to get 5833.

Then, we need to account for the main effect of poa: We take 5833 and add -422 (also known as subtracting 422), which gives us 5411.

Last, we’ll add in that interaction of -518: 5411 - 518 = 4893. If you look again above, we found that the mean of the voiced interdental was 4894! (The difference of 1 is because I rounded up/down to the nearest Hz in all those calculations, but if you tried the same thing with a larger number of decimals you’d see these results are equal.)

Emmeans

In case you’re interested in seeing how emmeans does pairwise comparisons all at once, here’s a bit of code. We don’t have time to get into this, but I encourage you to Google how estimated marginal means work! The numbers sometimes come out a bit different from what the treatment coding model might give you, but because of whatever mysterious math stuff it does. You can find further details online.

library(emmeans) # You might need to install this package if you don't already have it
emmeans(fit.dummy, specs = pairwise ~ voicing * poa)
## $emmeans
##  voicing   poa         emmean  SE df lower.CL upper.CL
##  voiceless alveolar      6861 228 76     6408     7314
##  voiced    alveolar      6772 228 76     6319     7225
##  voiceless interdental   7053 228 76     6600     7506
##  voiced    interdental   4894 228 76     4440     5347
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                                   estimate  SE df t.ratio p.value
##  voiceless alveolar - voiced alveolar           88.5 322 76   0.275  0.9927
##  voiceless alveolar - voiceless interdental   -192.0 322 76  -0.597  0.9328
##  voiceless alveolar - voiced interdental      1967.2 322 76   6.113 <0.0001
##  voiced alveolar - voiceless interdental      -280.4 322 76  -0.871  0.8196
##  voiced alveolar - voiced interdental         1878.8 322 76   5.839 <0.0001
##  voiceless interdental - voiced interdental   2159.2 322 76   6.710 <0.0001
## 
## P value adjustment: tukey method for comparing a family of 4 estimates
# Should give same results for the sum coded and treatment coded models, just in a different order and the opposite positive/negative valence because our factors were ordered differently in the two models
emmeans(fit.sum, specs = pairwise ~ voicing * poa) 
## $emmeans
##  voicing   poa         emmean  SE df lower.CL upper.CL
##  voiced    interdental   4894 228 76     4440     5347
##  voiceless interdental   7053 228 76     6600     7506
##  voiced    alveolar      6772 228 76     6319     7225
##  voiceless alveolar      6861 228 76     6408     7314
## 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                                   estimate  SE df t.ratio p.value
##  voiced interdental - voiceless interdental  -2159.2 322 76  -6.710 <0.0001
##  voiced interdental - voiced alveolar        -1878.8 322 76  -5.839 <0.0001
##  voiced interdental - voiceless alveolar     -1967.2 322 76  -6.113 <0.0001
##  voiceless interdental - voiced alveolar       280.4 322 76   0.871  0.8196
##  voiceless interdental - voiceless alveolar    192.0 322 76   0.597  0.9328
##  voiced alveolar - voiceless alveolar          -88.5 322 76  -0.275  0.9927
## 
## P value adjustment: tukey method for comparing a family of 4 estimates

Interactions between one categorical variable and one continuous variable

Sometimes we’re interested in an interaction between a categorical predictor and a continuous predictor. For instance, Imagine that we’re interested in some of the vowel measurements in this dataset, like the vowel intensity and the vowel F0. We suspect there might be some relationship between gender and these measures - maybe men have an overall lower F0 than women, and/or maybe there’s some relationship between gender and loudness.

# Get a Gender column
mcm$Gender <- str_sub(mcm$Talker, 1, 1)

# Get by-talker, by-vowel means for vowel intensity and mean F0 along with the label of the gender for each talker
spkr_means <- mcm %>% 
  group_by(Talker, Gender, Vowel) %>% 
  summarise(mean_RMS = mean(rms_v, na.rm = TRUE),
            mean_F0 = mean(F0, na.rm = TRUE))

# Pirateplots of gender vs. RMS and gender vs. F0
pirateplot(mean_F0 ~ Gender, spkr_means, inf.method = 'ci')

pirateplot(mean_RMS ~ Gender, spkr_means, inf.method = 'ci')

All well and good - there seems to be a gender difference in F0 with men having lower pitch, and there might also be a gender difference here where women have slightly louder vowels than men.

What about the relationship of RMS to F0? Do men and women behave the same?

# Scatterplot of the by-talker means of vowel RMS predicting vowel F0
ggplot(spkr_means, aes(x = mean_RMS, y = mean_F0, colour = Gender)) + 
  geom_point() + 
  geom_smooth(method = "lm") +
  theme_bw()

Looks like the genders are different in this regard! For women, the louder their voice, the lower their pitch; for men, the louder their voice, the higher their pitch. Let’s now run the stats to check whether the interaction effect we can see on the plot is statistically significant.

We’ll first do this with Gender being treatment coded, and then with Gender sum coded. But in both cases we’ll want to centre our continuous predictor of mean_RMS so that the intercept is interpretable.

# Centre the continuous predictor so that the intercept is more interpretable
spkr_means$mean_RMS_centered <- spkr_means$mean_RMS - mean(spkr_means$mean_RMS, na.rm = TRUE)

Interactions between one categorical variable and one continuous variable using treatment coding

The default in R is treatment coding, so if we just run a linear regression it will automatically set the alphabetically earlier level (F) as 0, and the other (M) as 1.

# Let's look again at the scatterplot, this time with the centered predictor
ggplot(spkr_means, aes(x = mean_RMS_centered, y = mean_F0, colour = Gender)) + 
  geom_point() + 
  geom_smooth(method = "lm") +
  theme_bw()

model_treatment <- lm(mean_F0 ~ mean_RMS_centered * Gender, spkr_means)
summary(model_treatment)
## 
## Call:
## lm(formula = mean_F0 ~ mean_RMS_centered * Gender, data = spkr_means)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.294 -10.577  -1.400   7.275  44.694 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               197.2248     2.1211  92.982  < 2e-16 ***
## mean_RMS_centered          -3.0400     0.9682  -3.140  0.00214 ** 
## GenderM                   -79.1871     3.0043 -26.358  < 2e-16 ***
## mean_RMS_centered:GenderM   6.8793     1.4078   4.887 3.32e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.98 on 116 degrees of freedom
## Multiple R-squared:  0.8688, Adjusted R-squared:  0.8654 
## F-statistic: 256.1 on 3 and 116 DF,  p-value: < 2.2e-16

Here, we can see that the intercept of 197 is where the F line crosses 0. The F line has a slope of -3.0, which is significantly different from 0.The M line crosses 0 at 197-79 = 118; that -79 difference is significantly different from 0, meaning that the M mean is significantly different from the F mean. The M line has a slope of -3.0 + 6.9 = 3.9, which is significantly different from the F slope.

With this treatment coding, we can’t directly answer whether the M slope is significantly different from 0, just whether it’s significantly different from our reference level of F. If we wanted to know whether the M slope is significantly different from 0, we’d want to relevel so it’s our reference level of 0.

We could write up this result as: “For women, mean RMS was negatively associated with mean F0 (β = -3.04, p = .002). The interaction between mean RMS and gender was significant (β = 6.88, p < .001), indicating that the relationship differed by gender. The estimated slope for men was positive (β = 3.84), whereas the slope for women was negative (β = -3.04).”

Interactions between one categorical variable and one continuous variable using sum coding

Now let’s see what happens when we sum code Gender.

# Sum coding Gender, with F as the held-out level
spkr_means$Gender <- factor(spkr_means$Gender, levels = c("M", "F"))
contrasts(spkr_means$Gender) <- contr.sum(2)
contrasts(spkr_means$Gender)
##   [,1]
## M    1
## F   -1
# Run the regression again, sum coded
model_sum <- lm(mean_F0 ~ mean_RMS_centered * Gender, spkr_means)
summary(model_sum)
## 
## Call:
## lm(formula = mean_F0 ~ mean_RMS_centered * Gender, data = spkr_means)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -30.294 -10.577  -1.400   7.275  44.694 
## 
## Coefficients:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               157.6312     1.5022 104.935  < 2e-16 ***
## mean_RMS_centered           0.3996     0.7039   0.568    0.571    
## Gender1                   -39.5936     1.5022 -26.358  < 2e-16 ***
## mean_RMS_centered:Gender1   3.4396     0.7039   4.887 3.32e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 15.98 on 116 degrees of freedom
## Multiple R-squared:  0.8688, Adjusted R-squared:  0.8654 
## F-statistic: 256.1 on 3 and 116 DF,  p-value: < 2.2e-16

Now let’s interpret this output. Look back at our treatment coded model outputs. The y-intercept is the mean between the y-intercepts of M and F.

(197.2248 + (197.2248 -79.1871)) / 2
## [1] 157.6312

We get about 0.4 for the slope of mean_RMS_centered. Why? Look back at our treatment coded model outputs. Here we see that the slope for F is -3.04, and the slope for M is -3.04 + 6.88 = 3.84. What is the average of -3.04 and 3.84?

(-3.0400 + (-3.0400 + 6.8793)) / 2
## [1] 0.39965

That’s right, it’s our beta of about 0.4! So: taking gender and the interaction of gender and RMS into account, there is no significant overall effect of mean RMS on mean F0.

On the next line of the sum coded output, we see -39.6. Remember that 157 is the midpoint between the two Genders’ means of F0. We can thus see that to get from that 157 mean of means to the mean of M, we need to go down -39.6, and to get from 157 to the mean of F we have to go up 39.6. This difference in F0 of 39.6 between overall mean and the mean of M, our held-out level, is significant.

Now to interpret the interaction: What does the 3.44 mean? Again, let’s look back at our treatment coded results. See how there’s a difference of 6.88 in the slopes of F (-3.04) and M (3.84)? Just like how the beta for Gender gave us half the difference between the two means, this interaction beta is giving us half the difference between the two slopes.

6.88 / 2 
## [1] 3.44

Overall, we could summarize this result as: “There was no overall effect of mean RMS on mean F0 (β = 0.40, p = .571). However, the interaction between mean RMS and gender was significant (β = 3.44, p < .001), indicating that the relationship between RMS and F0 differed by gender. Specifically, mean F0 decreased with increasing RMS for females (β = -3.04) but increased with increasing RMS for males (β = 3.84).”

Conceptually, once you know the relationship reverses direction across genders, the question “Is there an overall RMS effect on F0?” becomes less interesting. The interaction is telling you that the effect of RMS depends on gender, so the main effect of RMS is an average of two qualitatively different relationships. That’s why the average of the two slopes (our mean_RMS_centered beta in the sum coded model) ends up near zero.


Practice with interactions

  1. We’ve seen before that for most fricatives, there’s a generally positive correlation between M1 (a.k.a. COG) and MaxPF. The strength of the positive slope differs by fricative; for some fricatives, this fails to reach our p = 0.05 significance level. Create a dataset with the by-speaker, by-fricative means for COG and MaxPF. Now consider just /f/ and /v/. Is the relationship between M1 and MaxPF the same or different for these two fricatives?