LMEM analyses of the “cognate_homonym_data.xls” dataset

Loading data

library(readxl)
coghomdata <- read_xls("cognate_homonym_data.xls")

Setting NAs

coghomdata$dom_sub <- ifelse(coghomdata$dom_sub == "none", NA, coghomdata$dom_sub)
coghomdata$target_RT <- ifelse(coghomdata$target_RT == 0, NA, coghomdata$target_RT)
coghomdata$related_known <- ifelse(is.na(coghomdata$related_known), 2, coghomdata$related_known)

Q-Q plot for reaction times distribution

qqnorm(coghomdata$target_RT, pch = 1, frame = FALSE)
qqline(coghomdata$target_RT, col = "steelblue", lwd = 2)

Calculating RT means

means <- aggregate(data = coghomdata, target_RT ~ participant, FUN = mean)

Calculating SDs

sds <- aggregate(data = coghomdata, target_RT ~ participant, FUN = sd)

Naming means and SD columns

colnames(means)[2] = "subject_mean"
colnames(sds)[2] = "subject_sd"

Merging means and SDs in one dataframe

m1 = merge(means, sds, by = "participant")

Merging means-SDs dataframe and homdata

m2 = merge(coghomdata, m1, by = "participant")

Remove objects which won’t be used from environment

rm(means, sds, m1, coghomdata)

Rename data set

coghomdata <- m2

Remove unused object

rm(m2)

Use mean RT for each participant to remove lower than 2.5 SD and higher than 2.5 SD

coghomdata$RT_clean <- ifelse(coghomdata$target_RT > (coghomdata$subject_mean + 2.5*coghomdata$subject_sd) | coghomdata$target_RT < (coghomdata$subject_mean - 2.5*coghomdata$subject_sd), NA, coghomdata$target_RT)

Model 1: general analyses on accuracy

mod1_acc = glmer(data = related1, target_ACC ~  amb2 +  cog_status + amb2 * cog_status + (1 | participant) + (1 | target), family = "binomial")
summary(mod1_acc)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: 
## target_ACC ~ amb2 + cog_status + amb2 * cog_status + (1 | participant) +  
##     (1 | target)
##    Data: related1
## 
##      AIC      BIC   logLik deviance df.resid 
##   2834.3   2872.2  -1411.1   2822.3     4077 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -6.4058  0.0898  0.2014  0.3508  2.5133 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 2.5060   1.5830  
##  participant (Intercept) 0.3405   0.5836  
## Number of obs: 4083, groups:  target, 189; participant, 84
## 
## Fixed effects:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                 2.5442     0.1704  14.935  < 2e-16 ***
## amb2homonym                -1.0343     0.1526  -6.779 1.21e-11 ***
## cog_statuscog               0.5618     0.1471   3.819 0.000134 ***
## amb2homonym:cog_statuscog  -0.3553     0.1466  -2.424 0.015350 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) amb2hm cg_stt
## amb2homonym -0.424              
## cog_statscg  0.134 -0.120       
## amb2hmnym:_ -0.098  0.126 -0.473
anova(mod1_acc)
## Analysis of Variance Table
##                 npar Sum Sq Mean Sq F value
## amb2               1 41.463  41.463 41.4635
## cog_status         1  9.172   9.172  9.1721
## amb2:cog_status    1  5.853   5.853  5.8533
library(jtools)
## Warning: package 'jtools' was built under R version 4.0.3
summ(mod1_acc, confint=TRUE, digits=3)
Observations 4083
Dependent variable target_ACC
Type Mixed effects generalized linear model
Family binomial
Link logit
AIC 2834.285
BIC 2872.173
Pseudo-R² (fixed effects) 0.191
Pseudo-R² (total) 0.567
Fixed Effects
Est. 2.5% 97.5% z val. p
(Intercept) 2.544 2.210 2.878 14.935 0.000
amb2homonym -1.034 -1.333 -0.735 -6.779 0.000
cog_statuscog 0.562 0.273 0.850 3.819 0.000
amb2homonym:cog_statuscog -0.355 -0.643 -0.068 -2.424 0.015
Random Effects
Group Parameter Std. Dev.
target (Intercept) 1.583
participant (Intercept) 0.584
Grouping Variables
Group # groups ICC
target 189 0.408
participant 84 0.055

DV descriptive statistics for each IV

homACCmean <- aggregate(related1$target_ACC, list(related1$amb2), FUN=mean, na.rm=TRUE)
homACCsd <- aggregate(related1$target_ACC, list(related1$amb2), FUN=sd, na.rm=TRUE)
homACC <- cbind(homACCmean, homACCsd, by = "amb2")
rm(homACCmean)
rm(homACCsd)
names(homACC)[2] <- "Mean"
names(homACC)[4] <- "SD"
homACC[6] <- NULL
homACC[5] <- NULL
homACC[3] <- NULL

cogACCmean <- aggregate(related1$target_ACC, list(related1$cog_status), FUN=mean, na.rm=TRUE)
cogACCsd <- aggregate(related1$target_ACC, list(related1$cog_status), FUN=sd, na.rm=TRUE)
cogACC <- cbind(cogACCmean, cogACCsd, by = "cog_status")
rm(cogACCmean)
rm(cogACCsd)
names(cogACC)[2] <- "Mean"
names(cogACC)[4] <- "SD"
cogACC[6] <- NULL
cogACC[5] <- NULL
cogACC[3] <- NULL

homcogACCmean <- aggregate(target_ACC~cog_status+amb2, related1, mean, na.rm=TRUE)
names(homcogACCmean)[3] <- "Mean"
homcogACCsd <- aggregate(target_ACC~cog_status+amb2, related1, sd, na.rm=TRUE)
names(homcogACCsd)[3] <- "SD"
homcogACC <- cbind(homcogACCmean, homcogACCsd, by = "cog_status")
homcogACC[7] <- NULL
homcogACC[5] <- NULL
homcogACC[4] <- NULL

homACC
##      Group.1      Mean        SD
## 1 nonhomonym 0.8995536 0.3006782
## 2    homonym 0.7900480 0.4073630
cogACC
##   Group.1      Mean        SD
## 1  noncog 0.7946988 0.4040189
## 2     cog 0.8829681 0.3215383
homcogACC
##   cog_status       amb2      Mean        SD
## 1     noncog nonhomonym 0.8281250 0.3774825
## 2        cog nonhomonym 0.9709821 0.1679503
## 3     noncog    homonym 0.7692960 0.4214621
## 4        cog    homonym 0.8120504 0.3908477

Subset of only cog to disentangle interaction

related1cog = subset(related1, cog_status == "cog")
related1cog = droplevels(related1cog)

Model 1: general analyses on accuracy with cognate words only

mod1_acc_cog = glmer(data = related1cog, target_ACC ~  amb2 + (1 | participant) + (1 | target), family = "binomial")
summary(mod1_acc_cog)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: target_ACC ~ amb2 + (1 | participant) + (1 | target)
##    Data: related1cog
## 
##      AIC      BIC   logLik deviance df.resid 
##   1166.8   1189.2   -579.4   1158.8     2004 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -8.0068  0.0876  0.1826  0.2954  1.4219 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 2.0954   1.448   
##  participant (Intercept) 0.3295   0.574   
## Number of obs: 2008, groups:  target, 95; participant, 84
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   4.3961     0.3946  11.140  < 2e-16 ***
## amb2homonym  -2.7338     0.4327  -6.318 2.66e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## amb2homonym -0.854
anova(mod1_acc_cog)
## Analysis of Variance Table
##      npar Sum Sq Mean Sq F value
## amb2    1 41.512  41.512  41.512
summ(mod1_acc_cog, confint=TRUE, digits=3)
Observations 2008
Dependent variable target_ACC
Type Mixed effects generalized linear model
Family binomial
Link logit
AIC 1166.792
BIC 1189.211
Pseudo-R² (fixed effects) 0.244
Pseudo-R² (total) 0.565
Fixed Effects
Est. 2.5% 97.5% z val. p
(Intercept) 4.396 3.623 5.169 11.140 0.000
amb2homonym -2.734 -3.582 -1.886 -6.318 0.000
Random Effects
Group Parameter Std. Dev.
target (Intercept) 1.448
participant (Intercept) 0.574
Grouping Variables
Group # groups ICC
target 95 0.367
participant 84 0.058

Subset of only noncog to disentangle interaction

related1noncog = subset(related1, cog_status == "noncog")
related1noncog = droplevels(related1noncog)

Model 1: general analyses on accuracy with noncognate words only

mod1_acc_noncog = glmer(data = related1noncog, target_ACC ~  amb2 + (1 | participant) + (1 | target), family = "binomial")
summary(mod1_acc_noncog)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: target_ACC ~ amb2 + (1 | participant) + (1 | target)
##    Data: related1noncog
## 
##      AIC      BIC   logLik deviance df.resid 
##   1694.3   1716.8   -843.1   1686.3     2071 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.1400  0.1255  0.2269  0.4138  2.6486 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 2.6641   1.6322  
##  participant (Intercept) 0.2565   0.5064  
## Number of obs: 2075, groups:  target, 95; participant, 84
## 
## Fixed effects:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   2.6524     0.3385   7.836 4.64e-15 ***
## amb2homonym  -1.2871     0.4004  -3.214  0.00131 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## amb2homonym -0.814
anova(mod1_acc_noncog)
## Analysis of Variance Table
##      npar Sum Sq Mean Sq F value
## amb2    1 10.329  10.329  10.329
summ(mod1_acc_noncog, confint=TRUE, digits=3)
Observations 2075
Dependent variable target_ACC
Type Mixed effects generalized linear model
Family binomial
Link logit
AIC 1694.281
BIC 1716.832
Pseudo-R² (fixed effects) 0.061
Pseudo-R² (total) 0.503
Fixed Effects
Est. 2.5% 97.5% z val. p
(Intercept) 2.652 1.989 3.316 7.836 0.000
amb2homonym -1.287 -2.072 -0.502 -3.214 0.001
Random Effects
Group Parameter Std. Dev.
target (Intercept) 1.632
participant (Intercept) 0.506
Grouping Variables
Group # groups ICC
target 95 0.429
participant 84 0.041

Subset with only correct responses for RT analyses

related1correct = subset(related1, target_ACC == "1")
related1correct = droplevels(related1correct)

Centering variables for mod1_rt

contrasts(related1correct$relatedness)
##         related sub
## dom           0   0
## related       1   0
## sub           0   1
contrasts(related1correct$relatedness)[2,] <- -1
contrasts(related1correct$relatedness)[1,] <- c(2,0)
contrasts(related1correct$relatedness)[3,] <- c(0,2)
colnames(contrasts(related1correct$relatedness)) = c("dom", "sub")
contrasts(related1correct$relatedness)
##         dom sub
## dom       2   0
## related  -1  -1
## sub       0   2
related1correct$amb2 <- relevel(related1correct$amb2, "nonhomonym")

contrasts(related1correct$amb2)
##            homonym
## nonhomonym       0
## homonym          1
contrasts(related1correct$amb2)[1, ] <- -1
contrasts(related1correct$amb2)
##            homonym
## nonhomonym      -1
## homonym          1
related1correct$cog_status <- relevel(related1correct$cog_status, "noncog")

contrasts(related1correct$cog_status)
##        cog
## noncog   0
## cog      1
contrasts(related1correct$cog_status)[1] <- -1
contrasts(related1correct$cog_status)
##        cog
## noncog  -1
## cog      1
contrasts(related1correct$dom_sub)
##            sub_shared
## dom_shared          0
## sub_shared          1
contrasts(related1correct$dom_sub)[1] <- -1
contrasts(related1correct$dom_sub)
##            sub_shared
## dom_shared         -1
## sub_shared          1

Model 1: general analyses on RT

mod1_rt = lmer(data = related1correct, log(RT_clean) ~  amb2 +  cog_status + amb2 * cog_status + (1 | participant) + (1 | target))
summary(mod1_rt)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log(RT_clean) ~ amb2 + cog_status + amb2 * cog_status + (1 |  
##     participant) + (1 | target)
##    Data: related1correct
## 
## REML criterion at convergence: 1262.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7611 -0.6812 -0.1205  0.5461  3.8365 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 0.02111  0.1453  
##  participant (Intercept) 0.03189  0.1786  
##  Residual                0.07156  0.2675  
## Number of obs: 3393, groups:  target, 187; participant, 84
## 
## Fixed effects:
##                             Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)                 6.916334   0.023120 133.054598 299.147  < 2e-16 ***
## amb2homonym                 0.102977   0.012426 139.448233   8.287 8.67e-14 ***
## cog_statuscog              -0.009583   0.012103 150.761814  -0.792   0.4297    
## amb2homonym:cog_statuscog   0.024207   0.012067 152.001808   2.006   0.0466 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) amb2hm cg_stt
## amb2homonym -0.123              
## cog_statscg -0.003  0.021       
## amb2hmnym:_  0.012 -0.006 -0.302
anova(mod1_rt)
## Type III Analysis of Variance Table with Satterthwaite's method
##                 Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## amb2            4.9141  4.9141     1 139.45 68.6754 8.671e-14 ***
## cog_status      0.0449  0.0449     1 150.76  0.6269   0.42974    
## amb2:cog_status 0.2879  0.2879     1 152.00  4.0241   0.04663 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summ(mod1_rt, confint=TRUE, digits=3)
Observations 3393
Dependent variable log(RT_clean)
Type Mixed effects linear regression
AIC 1276.492
BIC 1319.398
Pseudo-R² (fixed effects) 0.085
Pseudo-R² (total) 0.474
Fixed Effects
Est. 2.5% 97.5% t val. d.f. p
(Intercept) 6.916 6.871 6.962 299.147 133.055 0.000
amb2homonym 0.103 0.079 0.127 8.287 139.448 0.000
cog_statuscog -0.010 -0.033 0.014 -0.792 150.762 0.430
amb2homonym:cog_statuscog 0.024 0.001 0.048 2.006 152.002 0.047
p values calculated using Satterthwaite d.f.
Random Effects
Group Parameter Std. Dev.
target (Intercept) 0.145
participant (Intercept) 0.179
Residual 0.267
Grouping Variables
Group # groups ICC
target 187 0.169
participant 84 0.256

DV descriptive statistics for each IV

homRTmean <- aggregate(related1correct$RT_clean, list(related1correct$amb2), FUN=mean, na.rm=TRUE)
homRTsd <- aggregate(related1correct$RT_clean, list(related1correct$amb2), FUN=sd, na.rm=TRUE)
homRT <- cbind(homRTmean, homRTsd, by = "related1$amb2")
rm(homRTmean)
rm(homRTsd)
names(homRT)[2] <- "Mean"
names(homRT)[4] <- "SD"
homRT[6] <- NULL
homRT[5] <- NULL
homRT[3] <- NULL

cogRTmean <- aggregate(related1correct$RT_clean, list(related1correct$cog_status), FUN=mean, na.rm=TRUE)
cogRTsd <- aggregate(related1correct$RT_clean, list(related1correct$cog_status), FUN=sd, na.rm=TRUE)
cogRT <- cbind(cogRTmean, cogRTsd, by = "cog_status")
rm(cogRTmean)
rm(cogRTsd)
names(cogRT)[2] <- "Mean"
names(cogRT)[4] <- "SD"
cogRT[6] <- NULL
cogRT[5] <- NULL
cogRT[3] <- NULL

homcogRTmean <- aggregate(RT_clean~cog_status+amb2, related1correct, mean, na.rm=TRUE)
names(homcogRTmean)[3] <- "Mean"
homcogRTsd <- aggregate(RT_clean~cog_status+amb2, related1correct, sd, na.rm=TRUE)
names(homcogRTsd)[3] <- "SD"
homcogRT <- cbind(homcogRTmean, homcogRTsd, by = "cog_status")
homcogRT[7] <- NULL
homcogRT[5] <- NULL
homcogRT[4] <- NULL

homRT
##      Group.1      Mean       SD
## 1 nonhomonym  943.2382 353.4836
## 2    homonym 1111.6965 434.2402
cogRT
##   Group.1     Mean       SD
## 1  noncog 1050.658 418.6612
## 2     cog 1014.742 394.8548
homcogRT
##   cog_status       amb2      Mean       SD
## 1     noncog nonhomonym  964.8997 375.6616
## 2        cog nonhomonym  924.7783 332.5291
## 3     noncog    homonym 1121.1370 438.7621
## 4        cog    homonym 1102.1818 429.6710

Subset of only cog to disentangle interaction

related1correctcog = subset(related1correct, cog_status == "cog")
related1correctcog = droplevels(related1correctcog)

Model 1: general analyses on RT with cognate words only

mod1_rt_cog = lmer(data = related1correctcog, log(RT_clean) ~  amb2 + (1 | participant) + (1 | target))
summary(mod1_rt_cog)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log(RT_clean) ~ amb2 + (1 | participant) + (1 | target)
##    Data: related1correctcog
## 
## REML criterion at convergence: 660.7
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.5040 -0.6887 -0.1115  0.5280  3.6584 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 0.01998  0.1413  
##  participant (Intercept) 0.03102  0.1761  
##  Residual                0.06953  0.2637  
## Number of obs: 1757, groups:  target, 93; participant, 84
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   6.78024    0.03279 113.71272 206.760  < 2e-16 ***
## amb2homonym   0.22674    0.03416  69.35118   6.638 5.87e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## amb2homonym -0.630
anova(mod1_rt_cog)
## Type III Analysis of Variance Table with Satterthwaite's method
##      Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## amb2  3.064   3.064     1 69.351  44.065 5.869e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summ(mod1_rt_cog, confint=TRUE, digits=3)
Observations 1757
Dependent variable log(RT_clean)
Type Mixed effects linear regression
AIC 670.702
BIC 698.059
Pseudo-R² (fixed effects) 0.096
Pseudo-R² (total) 0.479
Fixed Effects
Est. 2.5% 97.5% t val. d.f. p
(Intercept) 6.780 6.716 6.845 206.760 113.713 0.000
amb2homonym 0.227 0.160 0.294 6.638 69.351 0.000
p values calculated using Satterthwaite d.f.
Random Effects
Group Parameter Std. Dev.
target (Intercept) 0.141
participant (Intercept) 0.176
Residual 0.264
Grouping Variables
Group # groups ICC
target 93 0.166
participant 84 0.257

Subset of only noncog to disentangle interaction

related1correctnoncog = subset(related1correct, cog_status == "noncog")
related1correctnoncog = droplevels(related1correctnoncog)

Model 1: general analyses on RT with noncognate words only

mod1_rt_noncog = lmer(data = related1correctnoncog, log(RT_clean) ~  amb2 + (1 | participant) + (1 | target))
summary(mod1_rt_noncog)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log(RT_clean) ~ amb2 + (1 | participant) + (1 | target)
##    Data: related1correctnoncog
## 
## REML criterion at convergence: 700.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7237 -0.6400 -0.1171  0.5648  3.6215 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  target      (Intercept) 0.02057  0.1434  
##  participant (Intercept) 0.03292  0.1814  
##  Residual                0.07258  0.2694  
## Number of obs: 1636, groups:  target, 95; participant, 84
## 
## Fixed effects:
##              Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)   6.84607    0.03398 123.07267 201.469  < 2e-16 ***
## amb2homonym   0.17922    0.03488  74.30214   5.138 2.17e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr)
## amb2homonym -0.642
anova(mod1_rt_noncog)
## Type III Analysis of Variance Table with Satterthwaite's method
##      Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## amb2 1.9161  1.9161     1 74.302    26.4 2.165e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summ(mod1_rt_noncog, confint=TRUE, digits=3)
Observations 1636
Dependent variable log(RT_clean)
Type Mixed effects linear regression
AIC 710.302
BIC 737.302
Pseudo-R² (fixed effects) 0.059
Pseudo-R² (total) 0.458
Fixed Effects
Est. 2.5% 97.5% t val. d.f. p
(Intercept) 6.846 6.779 6.913 201.469 123.073 0.000
amb2homonym 0.179 0.111 0.248 5.138 74.302 0.000
p values calculated using Satterthwaite d.f.
Random Effects
Group Parameter Std. Dev.
target (Intercept) 0.143
participant (Intercept) 0.181
Residual 0.269
Grouping Variables
Group # groups ICC
target 95 0.163
participant 84 0.261

Subset with only homonyms for homonym analyses for mod2_acc

relatedhom = subset(related1, amb2 == "homonym")
relatedhom = droplevels(relatedhom)

Centering variables for mod2_acc

contrasts(relatedhom$relatedness)
##     sub
## dom   0
## sub   1
contrasts(relatedhom$relatedness)[1] <- -1
contrasts(relatedhom$relatedness)
##     sub
## dom  -1
## sub   1
contrasts(relatedhom$dom_sub)
##            sub_shared
## dom_shared          0
## sub_shared          1
contrasts(relatedhom$dom_sub)[1] <- -1
contrasts(relatedhom$dom_sub)
##            sub_shared
## dom_shared         -1
## sub_shared          1

Model 2: homonym analyses on accuracy

mod2_acc = glmer(data = relatedhom, target_ACC ~  relatedness +  dom_sub + relatedness * dom_sub + (1 | participant) + (1 | target), family = "binomial")
summary(mod2_acc)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: target_ACC ~ relatedness + dom_sub + relatedness * dom_sub +  
##     (1 | participant) + (1 | target)
##    Data: relatedhom
## 
##      AIC      BIC   logLik deviance df.resid 
##    899.3    929.4   -443.7    887.3     1106 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.1458  0.1578  0.2369  0.4012  1.4667 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  participant (Intercept) 0.3350   0.5788  
##  target      (Intercept) 0.9744   0.9871  
## Number of obs: 1112, groups:  participant, 84; target, 63
## 
## Fixed effects:
##                                  Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                       1.54250    0.18104   8.520  < 2e-16 ***
## relatednesssub                   -1.15962    0.17082  -6.789 1.13e-11 ***
## dom_subsub_shared                -0.02354    0.16304  -0.144    0.885    
## relatednesssub:dom_subsub_shared  0.21310    0.16391   1.300    0.194    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) rltdns dm_sb_
## relatdnsssb -0.059              
## dm_sbsb_shr -0.069 -0.047       
## rltdnsss:__ -0.012 -0.110  0.011
anova(mod2_acc)
## Analysis of Variance Table
##                     npar Sum Sq Mean Sq F value
## relatedness            1 50.360  50.360 50.3595
## dom_sub                1  0.019   0.019  0.0190
## relatedness:dom_sub    1  1.749   1.749  1.7485
summ(mod2_acc, confint=TRUE, digits=3)
Observations 1112
Dependent variable target_ACC
Type Mixed effects generalized linear model
Family binomial
Link logit
AIC 899.307
BIC 929.391
Pseudo-R² (fixed effects) 0.205
Pseudo-R² (total) 0.432
Fixed Effects
Est. 2.5% 97.5% z val. p
(Intercept) 1.542 1.188 1.897 8.520 0.000
relatednesssub -1.160 -1.494 -0.825 -6.789 0.000
dom_subsub_shared -0.024 -0.343 0.296 -0.144 0.885
relatednesssub:dom_subsub_shared 0.213 -0.108 0.534 1.300 0.194
Random Effects
Group Parameter Std. Dev.
participant (Intercept) 0.579
target (Intercept) 0.987
Grouping Variables
Group # groups ICC
participant 84 0.073
target 63 0.212

DV descriptive statistics for each IV

relACCmean <- aggregate(relatedhom$target_ACC, list(relatedhom$relatedness), FUN=mean, na.rm=TRUE)
relACCsd <- aggregate(relatedhom$target_ACC, list(relatedhom$relatedness), FUN=sd, na.rm=TRUE)
relACC <- cbind(relACCmean, relACCsd, by = "relatedness")
rm(relACCmean)
rm(relACCsd)
names(relACC)[2] <- "Mean"
names(relACC)[4] <- "SD"
relACC[6] <- NULL
relACC[5] <- NULL
relACC[3] <- NULL

domsubACCmean <- aggregate(relatedhom$target_ACC, list(relatedhom$dom_sub), FUN=mean, na.rm=TRUE)
domsubACCsd <- aggregate(relatedhom$target_ACC, list(relatedhom$dom_sub), FUN=sd, na.rm=TRUE)
domsubACC <- cbind(domsubACCmean, domsubACCsd, by = "dom_sub")
rm(domsubACCmean)
rm(domsubACCsd)
names(domsubACC)[2] <- "Mean"
names(domsubACC)[4] <- "SD"
domsubACC[6] <- NULL
domsubACC[5] <- NULL
domsubACC[3] <- NULL

reldomsubACCmean <- aggregate(target_ACC~dom_sub+relatedness, relatedhom, mean, na.rm=TRUE)
names(reldomsubACCmean)[3] <- "Mean"
reldomsubACCsd <- aggregate(target_ACC~dom_sub+relatedness, relatedhom, sd, na.rm=TRUE)
names(reldomsubACCsd)[3] <- "SD"
reldomsubACC <- cbind(reldomsubACCmean, reldomsubACCsd, by = "cog_status")
reldomsubACC[7] <- NULL
reldomsubACC[5] <- NULL
reldomsubACC[4] <- NULL

relACC
##   Group.1      Mean        SD
## 1     dom 0.8830645 0.3214514
## 2     sub 0.6176837 0.4862561
domsubACC
##      Group.1      Mean        SD
## 1 dom_shared 0.8366972 0.3699813
## 2 sub_shared 0.7883598 0.4088318
reldomsubACC
##      dom_sub relatedness      Mean        SD
## 1 dom_shared         dom 0.9181141 0.2745316
## 2 sub_shared         dom 0.8885794 0.3150914
## 3 dom_shared         sub 0.6056338 0.4904441
## 4 sub_shared         sub 0.6153846 0.4876780

Subset with only correct responses for analyses of homonyms only for mod2_rt

relatedhomcorrect = subset(related1correct, amb2 == "homonym")
relatedhomcorrect = droplevels(relatedhomcorrect)

Centering variables for mod2_rt

contrasts(relatedhomcorrect$relatedness)
##     sub
## dom   0
## sub   1
contrasts(relatedhomcorrect$relatedness)[1] <- -1
contrasts(relatedhomcorrect$relatedness)
##     sub
## dom  -1
## sub   1
contrasts(relatedhomcorrect$dom_sub)
##            sub_shared
## dom_shared          0
## sub_shared          1
contrasts(relatedhomcorrect$dom_sub)[1] <- -1
contrasts(relatedhomcorrect$dom_sub)
##            sub_shared
## dom_shared         -1
## sub_shared          1

Model 2: homonym analyses on RT

mod2_rt = lmer(data = relatedhomcorrect, log(RT_clean) ~  relatedness +  dom_sub + relatedness * dom_sub + (1 | participant) + (1 | target))
summary(mod2_rt)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: log(RT_clean) ~ relatedness + dom_sub + relatedness * dom_sub +  
##     (1 | participant) + (1 | target)
##    Data: relatedhomcorrect
## 
## REML criterion at convergence: 482.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.2625 -0.7104 -0.0512  0.5780  3.2219 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  participant (Intercept) 0.03041  0.1744  
##  target      (Intercept) 0.01565  0.1251  
##  Residual                0.07808  0.2794  
## Number of obs: 891, groups:  participant, 84; target, 61
## 
## Fixed effects:
##                                    Estimate Std. Error         df t value
## (Intercept)                        7.035128   0.028462 111.160154 247.176
## relatednesssub                     0.124735   0.021018  60.082038   5.935
## dom_subsub_shared                 -0.009751   0.020931  59.765954  -0.466
## relatednesssub:dom_subsub_shared  -0.023652   0.020941  59.219301  -1.129
##                                  Pr(>|t|)    
## (Intercept)                       < 2e-16 ***
## relatednesssub                   1.57e-07 ***
## dom_subsub_shared                   0.643    
## relatednesssub:dom_subsub_shared    0.263    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) rltdns dm_sb_
## relatdnsssb  0.226              
## dm_sbsb_shr -0.092 -0.140       
## rltdnsss:__ -0.106 -0.125  0.293
anova(mod2_rt)
## Type III Analysis of Variance Table with Satterthwaite's method
##                      Sum Sq Mean Sq NumDF  DenDF F value    Pr(>F)    
## relatedness         2.75026 2.75026     1 60.082 35.2216 1.572e-07 ***
## dom_sub             0.01695 0.01695     1 59.766  0.2170    0.6430    
## relatedness:dom_sub 0.09961 0.09961     1 59.219  1.2757    0.2633    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summ(mod2_rt, confint=TRUE, digits=3)
Observations 891
Dependent variable log(RT_clean)
Type Mixed effects linear regression
AIC 496.504
BIC 530.050
Pseudo-R² (fixed effects) 0.082
Pseudo-R² (total) 0.422
Fixed Effects
Est. 2.5% 97.5% t val. d.f. p
(Intercept) 7.035 6.979 7.091 247.176 111.160 0.000
relatednesssub 0.125 0.084 0.166 5.935 60.082 0.000
dom_subsub_shared -0.010 -0.051 0.031 -0.466 59.766 0.643
relatednesssub:dom_subsub_shared -0.024 -0.065 0.017 -1.129 59.219 0.263
p values calculated using Satterthwaite d.f.
Random Effects
Group Parameter Std. Dev.
participant (Intercept) 0.174
target (Intercept) 0.125
Residual 0.279
Grouping Variables
Group # groups ICC
participant 84 0.245
target 61 0.126

DV descriptive statistics for each IV

relRTmean <- aggregate(relatedhomcorrect$RT_clean, list(relatedhomcorrect$relatedness), FUN=mean, na.rm=TRUE)
relRTsd <- aggregate(relatedhomcorrect$RT_clean, list(relatedhomcorrect$relatedness), FUN=sd, na.rm=TRUE)
relRT <- cbind(relRTmean, relRTsd, by = "relatedness")
rm(relRTmean)
rm(relRTsd)
names(relRT)[2] <- "Mean"
names(relRT)[4] <- "SD"
relRT[6] <- NULL
relRT[5] <- NULL
relRT[3] <- NULL

domsubRTmean <- aggregate(relatedhomcorrect$RT_clean, list(relatedhomcorrect$dom_sub), FUN=mean, na.rm=TRUE)
domsubRTsd <- aggregate(relatedhomcorrect$RT_clean, list(relatedhomcorrect$dom_sub), FUN=sd, na.rm=TRUE)
domsubRT <- cbind(domsubRTmean, domsubRTsd, by = "dom_sub")
rm(domsubRTmean)
rm(domsubRTsd)
names(domsubRT)[2] <- "Mean"
names(domsubRT)[4] <- "SD"
domsubRT[6] <- NULL
domsubRT[5] <- NULL
domsubRT[3] <- NULL

reldomsubRTmean <- aggregate(RT_clean~dom_sub+relatedness, relatedhomcorrect, mean, na.rm=TRUE)
names(reldomsubRTmean)[3] <- "Mean"
reldomsubRTsd <- aggregate(RT_clean~dom_sub+relatedness, relatedhomcorrect, sd, na.rm=TRUE)
names(reldomsubRTsd)[3] <- "SD"
reldomsubRT <- cbind(reldomsubRTmean, reldomsubRTsd, by = "cog_status")
reldomsubRT[7] <- NULL
reldomsubRT[5] <- NULL
reldomsubRT[4] <- NULL

relRT
##   Group.1     Mean       SD
## 1     dom 1058.794 411.2799
## 2     sub 1252.734 461.9146
domsubRT
##      Group.1     Mean       SD
## 1 dom_shared 1084.018 437.9105
## 2 sub_shared 1120.717 420.7855
reldomsubRT
##      dom_sub relatedness     Mean       SD
## 1 dom_shared         dom 1028.243 390.8334
## 2 sub_shared         dom 1067.610 407.5879
## 3 dom_shared         sub 1330.639 541.0703
## 4 sub_shared         sub 1253.484 425.5160