The eye-tracking data were interpolated before analysis using a Praat (Boersma & Weenink, 2019) script. When at least 1 but at most 9 consecutive samples (75 ms) in a row lacked eye-gaze information, the position of the eye in these missing samples was filled in by linear interpolation. The value of 75 ms as a maximum for a gap to be interpolated reflects a recommendation in the official Tobii manual (Tobii Pro AB, 2014). This value is chosen because it corresponds to the duration of a blink. 6.7% of the data was interpolated in this way.
After interpolation, we constructed two 1000-ms time windows. As it takes approximately 200 ms to plan an eye movement in reaction to a spoken word (Viviani, 1990), time window 1 started 200 ms after the onset of the first word. Time window 2 started 200 ms after the onset of the second word. Data points from the fixation parts of the learning trials and when the pictures were shown but the words had not yet started were removed from the data.
Two Areas of Interest (AOI’s) were defined, corresponding to the two pictures that were shown on the left side and the right side of the screen during the familiarization trials. For every sample it was computed whether the participant looked at the left picture or the right picture. Trials in which more than 50% of the samples were missing (no eye-gaze data) or irrelevant (looks at the screen but not at one of the two pictures) were removed from the data (433 trials). Then, we removed all remaining missing data (31,835 samples), leaving 210,925 samples for analysis. Unfortunately, the DLD group had more missing data than the TD group (84,423 DLD; 27,891 TD), which caused an imbalance in the remaining data: 139,612 samples for the TD group and 71,313 samples for the DLD group. On average, each participant contributed data from 19.6 trials.
We used the packages lme4 (Bates et al., 2015) and eyetrackingR (Dink & Fergusson, 2015) from the free software R (R Core Team, 2020) for data analysis. For each sample of the eye-tracking data, it was computed whether the participant looked at the target picture or the distractor picture, which depended on the word that was played at that moment. Using the eyetrackingR package, the samples were binned into 50-ms time bins. For each time bin, the proportion of looks towards the target picture was computed by dividing the number of looks towards the target by the total number of looks towards the pictures. The dependent variable was then transformed using an adjusted logit transformation. In this transformed variable, a value of 0 means that a participant is looking equally often at both pictures while a positive value means s/he looks more towards the target picture. In our statistical analysis, we computed whether the proportion of looks towards the target picture depended on Group (TD/DLD), Condition (high-CD/low-CD) and Trial (1-28), keeping into account the factors Time within a trial, Age and Congruency (congruent vs. incongruent trials). To this end, we set up two linear mixed-effects models.
We conducted two separate linear mixed-effects models for the two time windows (Word1 and Word2) to test whether the proportion of looks towards the target picture was different for children with and without DLD and whether there was an influence of Condition and Trial, taking into account the variables Time, Age and Congruency. The dependent variable was the adjusted logit transformation of the proportion of looks towards the target picture of every 50-ms time bin. Between-participant variables were Group and Condition, within-participant variables were Trial, Time, Age and Congruency. Before conducting a linear mixed-effects model, all binary variables were coded with sum-to-zero orthogonal contrasts (Group, Condition, Congruency) and all numeric variables were centred and scaled (Trial, Time, Age).
The model included all predictors and the interactions between them (except for Age), as well as random intercepts for Participant and Item. Also included were by-item random slopes (and the interactions between them) for Group and Condition as well as by-subject random slopes (and the interactions between them) for Time, Trial and Congruency. This resulted in the following model: Logit ~ Group * Condition * Time * Trial * Congruency + Age + (Group * Condition | Item) + (Time * Trial * Congruency | Participant). We are interested in the main effect of Group, Condition and Trial, as well as the interactions between Group and Condition and Group and Trial. A significant effect of Trial in the expected direction would show that children look more towards the target image as the experiment unfolds, what we interpret as an on-line learning effect. An interaction between Group and Trial would show that this on-line learning effect is different for the two groups. We are also interested whether the intercepts of the models are significant, which would indicate that children in general look more towards the target image than the distractor image.
CSL_clean <- read.delim("Data/CSL_ET_clean.txt")
CSL_clean <- make_eyetrackingr_data(CSL_clean,
participant_column = "Subject",
trial_column = "TrialId",
item_column = "Item",
time_column = "sIndex",
trackloss_column = "Missing",
aoi_columns = c('AOI_C','AOI_I'),
treat_non_aoi_looks_as_missing = T
)
## Converting Participants to proper type.
## Converting Trial to proper type.
## Converting Item to proper type.
Here we make a data frame that does take time within trials into account. The data is summarized in 50 ms time bins, and for each time bin the proportion of looks towards the correct AOI is computed. We use the dependent variable LogitAdjusted for analysis.
response_time <- make_time_sequence_data(CSL_clean,
time_bin_size = 50,
predictor_columns = c("Group", "Condition","SoundStatus","PosOrderMatch","Item", "TrialId", "Age_months"),
aois = "AOI_C",
summarize_by = "Subject" )
response_time$PosOrderMatch <- as.factor(response_time$PosOrderMatch)
response_time$PosOrderMatch <- revalue(response_time$PosOrderMatch, c("yes"="Congruent trial"))
response_time$PosOrderMatch <- revalue(response_time$PosOrderMatch, c("no"="Incongruent trial"))
response_time$Group <- as.factor(response_time$Group)
response_time$Condition <- as.factor(response_time$Condition)
response_time$PosOrderMatch <- as.factor(response_time$PosOrderMatch)
response_time$SoundStatus <- as.factor(response_time$SoundStatus)
response_time$TrialId <- as.numeric(response_time$TrialId)
contrast <- cbind(c(-0.5, +0.5)) # DLD, TD
colnames (contrast) <- c("-DLD+TD")
contrasts (response_time$Group) <- contrast
contrasts(response_time$Group)
## -DLD+TD
## DLD -0.5
## TD 0.5
contrast <- cbind(c(+0.5, -0.5)) # Condition HighCD, condition LowCD
colnames (contrast) <- c("-LowCD+HighCD")
contrasts (response_time$Condition) <- contrast
contrasts(response_time$Condition)
## -LowCD+HighCD
## HighCD 0.5
## LowCD -0.5
contrast <- cbind(c(-0.5, +0.5)) # Congruent yes, no
colnames (contrast) <- c("-Incongruent+Congruent")
contrasts (response_time$PosOrderMatch) <- contrast
contrasts(response_time$PosOrderMatch)
## -Incongruent+Congruent
## Incongruent trial -0.5
## Congruent trial 0.5
response_time$Age_months <- scale(response_time["Age_months"],center=T,scale=T)
response_time_W1 <- subset(response_time, SoundStatus == "Word1")
response_time_W2 <- subset(response_time, SoundStatus == "Word2")
response_time_W1_c <- response_time_W1
response_time_W2_c <- response_time_W2
response_time_W1$Time <- scale(response_time_W1["Time"],center=T,scale=T)
response_time_W2$Time <- scale(response_time_W2["Time"],center=T,scale=T)
response_time_W1$TrialId <- scale(response_time_W1["TrialId"],center=T,scale=T)
response_time_W2$TrialId <- scale(response_time_W2["TrialId"],center=T,scale=T)
We conduct two seperate models for word 1 (time window 1) and word 2 (time window 2).
Between-participant variables:
Within-participant variables:
model_W1 <- lmer(LogitAdjusted ~ Group*Condition*Time*TrialId*PosOrderMatch+Age_months+
(Group*Condition | Item) + (Time*TrialId*PosOrderMatch | Subject),
response_time_W1,
control=lmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e6)))
tab_model(model_W1, show.se = T, show.stat = T, show.df = T,df.method = "satterthwaite", digits.p = 3)
LogitAdjusted | ||||||
---|---|---|---|---|---|---|
Predictors | Estimates | std. Error | CI | Statistic | p | df |
(Intercept) | 0.13 | 0.10 | -0.06 – 0.32 | 1.35 | 0.183 | 61.18 |
Group-DLD+TD | 0.01 | 0.18 | -0.35 – 0.36 | 0.04 | 0.970 | 64.09 |
Condition-LowCD+HighCD | 0.15 | 0.18 | -0.21 – 0.51 | 0.85 | 0.397 | 64.56 |
Time | 0.11 | 0.05 | 0.01 – 0.20 | 2.30 | 0.027 | 37.91 |
TrialId | 0.01 | 0.07 | -0.12 – 0.14 | 0.11 | 0.911 | 46.29 |
PosOrderMatch-Incongruent+Congruent | 0.40 | 0.16 | 0.08 – 0.72 | 2.49 | 0.015 | 64.51 |
Age months | 0.01 | 0.06 | -0.10 – 0.12 | 0.18 | 0.860 | 43.49 |
Group-DLD+TD * Condition-LowCD+HighCD |
-0.15 | 0.35 | -0.85 – 0.55 | -0.43 | 0.669 | 64.76 |
Group-DLD+TD * Time | 0.02 | 0.09 | -0.17 – 0.21 | 0.17 | 0.862 | 37.91 |
Condition-LowCD+HighCD * Time |
-0.05 | 0.09 | -0.24 – 0.14 | -0.49 | 0.625 | 37.92 |
Group-DLD+TD * TrialId | -0.10 | 0.13 | -0.36 – 0.16 | -0.76 | 0.452 | 46.31 |
Condition-LowCD+HighCD * TrialId |
0.08 | 0.13 | -0.18 – 0.35 | 0.65 | 0.518 | 46.30 |
Time * TrialId | 0.01 | 0.05 | -0.09 – 0.11 | 0.21 | 0.835 | 41.25 |
Group-DLD+TD * PosOrderMatch-Incongruent+Congruent |
0.13 | 0.31 | -0.48 – 0.75 | 0.43 | 0.670 | 61.57 |
Condition-LowCD+HighCD * PosOrderMatch-Incongruent+Congruent |
-0.08 | 0.32 | -0.72 – 0.56 | -0.24 | 0.808 | 63.86 |
Time * PosOrderMatch-Incongruent+Congruent |
-0.03 | 0.12 | -0.28 – 0.21 | -0.28 | 0.783 | 48.67 |
TrialId * PosOrderMatch-Incongruent+Congruent |
-0.01 | 0.12 | -0.25 – 0.24 | -0.05 | 0.958 | 44.89 |
(Group-DLD+TD Condition-LowCD+HighCD) Time |
-0.13 | 0.19 | -0.51 – 0.25 | -0.69 | 0.494 | 37.92 |
(Group-DLD+TD Condition-LowCD+HighCD) TrialId |
-0.32 | 0.26 | -0.85 – 0.20 | -1.24 | 0.220 | 46.29 |
(Group-DLD+TD * Time) * TrialId |
0.05 | 0.10 | -0.15 – 0.24 | 0.50 | 0.622 | 41.26 |
(Condition-LowCD+HighCD Time) TrialId |
0.00 | 0.10 | -0.19 – 0.20 | 0.02 | 0.981 | 41.26 |
Group-DLD+TD Condition-LowCD+HighCD PosOrderMatch-Incongruent+Congruent |
1.07 | 0.61 | -0.15 – 2.30 | 1.75 | 0.085 | 60.90 |
Group-DLD+TD * Time * PosOrderMatch-Incongruent+Congruent |
-0.08 | 0.25 | -0.58 – 0.41 | -0.34 | 0.735 | 48.67 |
Condition-LowCD+HighCD Time PosOrderMatch-Incongruent+Congruent |
-0.00 | 0.25 | -0.50 – 0.49 | -0.01 | 0.993 | 48.67 |
Group-DLD+TD * TrialId * PosOrderMatch-Incongruent+Congruent |
-0.58 | 0.24 | -1.06 – -0.09 | -2.39 | 0.021 | 44.89 |
Condition-LowCD+HighCD TrialId PosOrderMatch-Incongruent+Congruent |
-0.59 | 0.24 | -1.08 – -0.11 | -2.45 | 0.018 | 44.87 |
Time * TrialId * PosOrderMatch-Incongruent+Congruent |
-0.29 | 0.09 | -0.48 – -0.10 | -3.14 | 0.003 | 36.40 |
(Group-DLD+TD Condition-LowCD+HighCD Time) * TrialId |
-0.01 | 0.19 | -0.40 – 0.38 | -0.06 | 0.952 | 41.26 |
Group-DLD+TD Condition-LowCD+HighCD Time * PosOrderMatch-Incongruent+Congruent |
0.01 | 0.49 | -0.97 – 1.00 | 0.03 | 0.979 | 48.67 |
Group-DLD+TD Condition-LowCD+HighCD TrialId * PosOrderMatch-Incongruent+Congruent |
0.54 | 0.48 | -0.43 – 1.51 | 1.12 | 0.268 | 44.89 |
Group-DLD+TD * Time TrialId PosOrderMatch-Incongruent+Congruent |
0.09 | 0.18 | -0.28 – 0.46 | 0.49 | 0.629 | 36.40 |
Condition-LowCD+HighCD Time TrialId * PosOrderMatch-Incongruent+Congruent |
0.05 | 0.18 | -0.32 – 0.43 | 0.28 | 0.782 | 36.40 |
Group-DLD+TD Condition-LowCD+HighCD Time * TrialId * PosOrderMatch-Incongruent+Congruent |
-0.32 | 0.37 | -1.07 – 0.43 | -0.85 | 0.398 | 36.40 |
Random Effects | ||||||
σ2 | 4.43 | |||||
τ00 Item | 0.17 | |||||
τ00 Subject | 0.21 | |||||
τ11 Item.Group-DLD+TD | 0.36 | |||||
τ11 Item.Condition-LowCD+HighCD | 0.37 | |||||
τ11 Item.Group-DLD+TD:Condition-LowCD+HighCD | 1.36 | |||||
τ11 Subject.Time | 0.09 | |||||
τ11 Subject.TrialId | 0.19 | |||||
τ11 Subject.PosOrderMatch-Incongruent+Congruent | 0.87 | |||||
τ11 Subject.Time:TrialId | 0.10 | |||||
τ11 Subject.Time:PosOrderMatch-Incongruent+Congruent | 0.69 | |||||
τ11 Subject.TrialId:PosOrderMatch-Incongruent+Congruent | 0.63 | |||||
τ11 Subject.Time:TrialId:PosOrderMatch-Incongruent+Congruent | 0.35 | |||||
ρ01 Item.Group-DLD+TD | -0.30 | |||||
ρ01 Item.Condition-LowCD+HighCD | 0.16 | |||||
ρ01 Item.Group-DLD+TD:Condition-LowCD+HighCD | 0.71 | |||||
ρ01 Subject.Time | 0.01 | |||||
ρ01 Subject.TrialId | 0.41 | |||||
ρ01 Subject.PosOrderMatch-Incongruent+Congruent | 0.30 | |||||
ρ01 Subject.Time:TrialId | -0.05 | |||||
ρ01 Subject.Time:PosOrderMatch-Incongruent+Congruent | 0.10 | |||||
ρ01 Subject.TrialId:PosOrderMatch-Incongruent+Congruent | 0.21 | |||||
ρ01 Subject.Time:TrialId:PosOrderMatch-Incongruent+Congruent | 0.08 | |||||
ICC | 0.27 | |||||
N Item | 74 | |||||
N Subject | 52 | |||||
Observations | 18465 | |||||
Marginal R2 / Conditional R2 | 0.022 / 0.284 |
isSingular(model_W1)
## [1] FALSE
model_W2 <- lmer(LogitAdjusted ~ Group*Condition*Time*TrialId*PosOrderMatch+Age_months +
(Group*Condition | Item) + (Time*TrialId*PosOrderMatch | Subject),
response_time_W2,
control=lmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e6)))
isSingular(model_W2)
## [1] FALSE
tab_model(model_W2, show.se = T, show.stat = T, show.df = T,df.method = "satterthwaite", digits.p = 3)
LogitAdjusted | ||||||
---|---|---|---|---|---|---|
Predictors | Estimates | std. Error | CI | Statistic | p | df |
(Intercept) | 0.55 | 0.12 | 0.32 – 0.78 | 4.73 | <0.001 | 67.06 |
Group-DLD+TD | 0.39 | 0.22 | -0.06 – 0.83 | 1.74 | 0.086 | 63.80 |
Condition-LowCD+HighCD | 0.11 | 0.24 | -0.37 – 0.59 | 0.47 | 0.643 | 74.69 |
Time | -0.01 | 0.04 | -0.10 – 0.08 | -0.18 | 0.855 | 46.52 |
TrialId | -0.01 | 0.08 | -0.17 – 0.14 | -0.18 | 0.861 | 39.54 |
PosOrderMatch-Incongruent+Congruent | 0.49 | 0.22 | 0.05 – 0.92 | 2.22 | 0.030 | 58.31 |
Age months | -0.17 | 0.07 | -0.32 – -0.02 | -2.29 | 0.027 | 40.12 |
Group-DLD+TD * Condition-LowCD+HighCD |
0.01 | 0.45 | -0.90 – 0.92 | 0.02 | 0.983 | 66.35 |
Group-DLD+TD * Time | -0.04 | 0.09 | -0.21 – 0.14 | -0.40 | 0.689 | 46.53 |
Condition-LowCD+HighCD * Time |
0.06 | 0.09 | -0.12 – 0.24 | 0.68 | 0.498 | 46.53 |
Group-DLD+TD * TrialId | 0.25 | 0.15 | -0.06 – 0.55 | 1.64 | 0.110 | 39.53 |
Condition-LowCD+HighCD * TrialId |
0.02 | 0.15 | -0.29 – 0.32 | 0.13 | 0.899 | 39.53 |
Time * TrialId | -0.02 | 0.04 | -0.11 – 0.07 | -0.40 | 0.695 | 41.55 |
Group-DLD+TD * PosOrderMatch-Incongruent+Congruent |
0.21 | 0.41 | -0.61 – 1.03 | 0.51 | 0.611 | 49.04 |
Condition-LowCD+HighCD * PosOrderMatch-Incongruent+Congruent |
-0.13 | 0.44 | -1.01 – 0.74 | -0.30 | 0.764 | 58.58 |
Time * PosOrderMatch-Incongruent+Congruent |
-0.07 | 0.08 | -0.24 – 0.10 | -0.81 | 0.421 | 46.40 |
TrialId * PosOrderMatch-Incongruent+Congruent |
-0.51 | 0.15 | -0.82 – -0.20 | -3.33 | 0.002 | 41.73 |
(Group-DLD+TD Condition-LowCD+HighCD) Time |
-0.07 | 0.18 | -0.42 – 0.29 | -0.39 | 0.700 | 46.53 |
(Group-DLD+TD Condition-LowCD+HighCD) TrialId |
-0.34 | 0.30 | -0.95 – 0.27 | -1.13 | 0.264 | 39.54 |
(Group-DLD+TD * Time) * TrialId |
-0.01 | 0.09 | -0.19 – 0.17 | -0.15 | 0.879 | 41.55 |
(Condition-LowCD+HighCD Time) TrialId |
-0.01 | 0.09 | -0.19 – 0.17 | -0.14 | 0.890 | 41.55 |
Group-DLD+TD Condition-LowCD+HighCD PosOrderMatch-Incongruent+Congruent |
-0.97 | 0.82 | -2.62 – 0.68 | -1.18 | 0.243 | 49.22 |
Group-DLD+TD * Time * PosOrderMatch-Incongruent+Congruent |
-0.21 | 0.17 | -0.55 – 0.13 | -1.23 | 0.226 | 46.40 |
Condition-LowCD+HighCD Time PosOrderMatch-Incongruent+Congruent |
0.12 | 0.17 | -0.22 – 0.47 | 0.74 | 0.465 | 46.40 |
Group-DLD+TD * TrialId * PosOrderMatch-Incongruent+Congruent |
-0.03 | 0.31 | -0.65 – 0.59 | -0.10 | 0.921 | 41.74 |
Condition-LowCD+HighCD TrialId PosOrderMatch-Incongruent+Congruent |
0.40 | 0.31 | -0.22 – 1.02 | 1.32 | 0.195 | 41.73 |
Time * TrialId * PosOrderMatch-Incongruent+Congruent |
0.01 | 0.08 | -0.14 – 0.17 | 0.16 | 0.870 | 45.55 |
(Group-DLD+TD Condition-LowCD+HighCD Time) * TrialId |
0.13 | 0.18 | -0.23 – 0.49 | 0.73 | 0.471 | 41.55 |
Group-DLD+TD Condition-LowCD+HighCD Time * PosOrderMatch-Incongruent+Congruent |
0.35 | 0.34 | -0.33 – 1.03 | 1.03 | 0.309 | 46.40 |
Group-DLD+TD Condition-LowCD+HighCD TrialId * PosOrderMatch-Incongruent+Congruent |
-0.80 | 0.61 | -2.04 – 0.44 | -1.30 | 0.201 | 41.73 |
Group-DLD+TD * Time TrialId PosOrderMatch-Incongruent+Congruent |
-0.03 | 0.15 | -0.34 – 0.28 | -0.21 | 0.837 | 45.55 |
Condition-LowCD+HighCD Time TrialId * PosOrderMatch-Incongruent+Congruent |
-0.24 | 0.15 | -0.55 – 0.07 | -1.56 | 0.126 | 45.55 |
Group-DLD+TD Condition-LowCD+HighCD Time * TrialId * PosOrderMatch-Incongruent+Congruent |
0.47 | 0.31 | -0.15 – 1.09 | 1.52 | 0.137 | 45.55 |
Random Effects | ||||||
σ2 | 3.67 | |||||
τ00 Item | 0.13 | |||||
τ00 Subject | 0.42 | |||||
τ11 Item.Group-DLD+TD | 0.34 | |||||
τ11 Item.Condition-LowCD+HighCD | 0.79 | |||||
τ11 Item.Group-DLD+TD:Condition-LowCD+HighCD | 1.77 | |||||
τ11 Subject.Time | 0.08 | |||||
τ11 Subject.TrialId | 0.27 | |||||
τ11 Subject.PosOrderMatch-Incongruent+Congruent | 1.90 | |||||
τ11 Subject.Time:TrialId | 0.08 | |||||
τ11 Subject.Time:PosOrderMatch-Incongruent+Congruent | 0.30 | |||||
τ11 Subject.TrialId:PosOrderMatch-Incongruent+Congruent | 1.09 | |||||
τ11 Subject.Time:TrialId:PosOrderMatch-Incongruent+Congruent | 0.23 | |||||
ρ01 Item.Group-DLD+TD | -0.10 | |||||
ρ01 Item.Condition-LowCD+HighCD | 0.19 | |||||
ρ01 Item.Group-DLD+TD:Condition-LowCD+HighCD | 0.07 | |||||
ρ01 Subject.Time | -0.20 | |||||
ρ01 Subject.TrialId | 0.42 | |||||
ρ01 Subject.PosOrderMatch-Incongruent+Congruent | -0.07 | |||||
ρ01 Subject.Time:TrialId | 0.06 | |||||
ρ01 Subject.Time:PosOrderMatch-Incongruent+Congruent | -0.23 | |||||
ρ01 Subject.TrialId:PosOrderMatch-Incongruent+Congruent | 0.11 | |||||
ρ01 Subject.Time:TrialId:PosOrderMatch-Incongruent+Congruent | 0.02 | |||||
ICC | 0.38 | |||||
N Item | 74 | |||||
N Subject | 52 | |||||
Observations | 18108 | |||||
Marginal R2 / Conditional R2 | 0.039 / 0.402 |
# We want to create graphs with the predictions from the lmer and the actual data. We plot the lmer predictions by hand
fixef <- lme4::fixef (model_W1)
options (width = 150)
cbind (names (fixef),
lmerTest::contest (model_W1,
diag (length (fixef)),
joint = FALSE, # each predictor its own c.i. and p-value
ddf = "Satterthwaite")) # = the default degrees-of-freedom estimation method
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
time.effect = fixef [["Time"]]
interaction = fixef [["Group-DLD+TD:Time"]]
range(response_time_W1$Time)
## [1] -1.657362 1.643241
left.word1.TD = intercept + +0.5 * group.effect + -1.657362 * time.effect + +0.5 * -1.657362 * interaction
right.word1.TD = intercept + +0.5 * group.effect + +1.643241 * time.effect + +0.5 * +1.643241 * interaction
cat ("TD:", left.word1.TD, right.word1.TD, "\n")
## TD: -0.06086004 0.3242474
left.word1.DLD = intercept + -0.5 * group.effect + -1.657362 * time.effect + -0.5 * -1.657362 * interaction
right.word1.DLD = intercept + -0.5 * group.effect + +1.643241 * time.effect + -0.5 * +1.643241 * interaction
cat ("DLD:", left.word1.DLD, right.word1.DLD, "\n")
## DLD: -0.04027294 0.2905446
range(response_time_W1_c$Time)
## [1] 200 1150
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
Time = c(200, 1150, 200, 1150),
LogitAdjusted = c(left.word1.TD, right.word1.TD, left.word1.DLD, right.word1.DLD)
)
plot <- response_time_W1_c%>%
dplyr::group_by(Group, Time) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = Time, y = LogitAdjusted, color=Group))+
geom_line(linetype = "dotted", size=0.5, alpha = 0.7)+
geom_line(data = fit, size=1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
ylim(-0.1, 0.8)+
geom_hline(yintercept = 0, color="black", size=0.5, linetype="dashed")+
ggtitle("Word 1")+
xlab("Time (ms)")+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")+
guides(colour = guide_legend(override.aes = list(shape = NA)))
ggsave("Graphs/W1_Group_Time.png", dpi=600, width = 12, height = 12, units = "cm")
scale_fill_manual(values=c(“black”, “#E69F00”))+
p
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
trial.effect = fixef [["TrialId"]]
interaction = fixef [["Group-DLD+TD:TrialId"]]
range(response_time_W1$TrialId)
## [1] -1.496993 1.789689
left.word1.TD = intercept + +0.5 * group.effect + -1.496993 * trial.effect + +0.5 * -1.496993 * interaction
right.word1.TD = intercept + +0.5 * group.effect + +1.789689 * trial.effect + +0.5 * +1.789689 * interaction
cat ("TD:", left.word1.TD, right.word1.TD, "\n")
## TD: 0.1956072 0.05709227
left.word1.DLD = intercept + -0.5 * group.effect + -1.496993 * trial.effect + -0.5 * -1.496993 * interaction
right.word1.DLD = intercept + -0.5 * group.effect + +1.789689 * trial.effect + -0.5 * +1.789689 * interaction
cat ("DLD:", left.word1.DLD, right.word1.DLD, "\n")
## DLD: 0.04078875 0.2275284
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
TrialId = c(1, 28, 1, 28),
LogitAdjusted = c(left.word1.TD, right.word1.TD, left.word1.DLD, right.word1.DLD)
)
plot <- response_time_W1_c %>%
dplyr::group_by(Group, TrialId) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = TrialId, y = LogitAdjusted, color=Group, group = Group))+
geom_line(linetype = "dotted", size=0.5, alpha = 0.7)+
geom_line(data = fit, size=1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
geom_hline(yintercept = 0, color="black", size=0.5, linetype="dashed")+
ggtitle("Word 1")+
xlab("Trial in experiment")+
scale_x_continuous(breaks=seq(0,28,5))+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")
ggsave("Graphs/W1_Group_Trial.png", dpi=600, width = 12, height = 12, units = "cm")
p
fixef <- lme4::fixef (model_W1)
options (width = 150)
cbind (names (fixef),
lmerTest::contest (model_W1,
diag (length (fixef)),
joint = FALSE, # each predictor its own c.i. and p-value
ddf = "Satterthwaite")) # = the default degrees-of-freedom estimation method
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
condition.effect = fixef [["Condition-LowCD+HighCD"]]
interaction = fixef [["Group-DLD+TD:Condition-LowCD+HighCD"]]
left.word1.TD = intercept + +0.5 * group.effect + -0.5 * condition.effect + +0.5 * -0.5 * interaction
right.word1.TD = intercept + +0.5 * group.effect + +0.5 * condition.effect + +0.5 * +0.5 * interaction
cat ("TD:", left.word1.TD, right.word1.TD, "\n")
## TD: 0.09337155 0.1716634
left.word1.DLD = intercept + -0.5 * group.effect + -0.5 * condition.effect + -0.5 * -0.5 * interaction
right.word1.DLD = intercept + -0.5 * group.effect + +0.5 * condition.effect + -0.5 * +0.5 * interaction
cat ("DLD:", left.word1.DLD, right.word1.DLD, "\n")
## DLD: 0.01120226 0.2404847
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
Condition = c("LowCD", "HighCD", "LowCD", "HighCD"),
LogitAdjusted = c(left.word1.TD, right.word1.TD, left.word1.DLD, right.word1.DLD)
)
plot <- response_time_W1_c %>%
dplyr::group_by(Group, Condition) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = factor(Condition, levels = c ("LowCD", "HighCD")), y = LogitAdjusted, color=Group, group = Group))+
geom_line(linetype = "dotted", size=0.5, alpha = 0.7)+
geom_line(data = fit, aes(x = Condition, y = LogitAdjusted, color = Group), size=1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
geom_hline(yintercept = 0, color="black", size=0.5, linetype="dashed")+
ylim(-0.1, 0.4)+
ggtitle("Word 1")+
xlab("Condition")+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")
ggsave("Graphs/W1_Group_Condition.png", dpi=600, width = 12, height = 12, units = "cm")
p
fixef <- lme4::fixef (model_W2)
options (width = 150)
cbind (names (fixef),
lmerTest::contest (model_W2,
diag (length (fixef)),
joint = FALSE, # each predictor its own c.i. and p-value
ddf = "Satterthwaite")) # = the default degrees-of-freedom estimation method
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
time.effect = fixef [["Time"]]
interaction = fixef [["Group-DLD+TD:Time"]]
range(response_time_W2$Time)
## [1] -1.648675 1.668730
left.word2.TD = intercept + +0.5 * group.effect + -1.648675 * time.effect + +0.5 * -1.648675 * interaction
right.word2.TD = intercept + +0.5 * group.effect + +1.668730 * time.effect + +0.5 * +1.668730 * interaction
cat ("TD:", left.word2.TD, right.word2.TD, "\n")
## TD: 0.7861452 0.7004829
left.word2.DLD = intercept + -0.5 * group.effect + -1.648675 * time.effect + -0.5 * -1.648675 * interaction
right.word2.DLD = intercept + -0.5 * group.effect + +1.668730 * time.effect + -0.5 * +1.668730 * interaction
cat ("DLD:", left.word2.DLD, right.word2.DLD, "\n")
## DLD: 0.339262 0.3712876
range(response_time_W2_c$Time)
## [1] 2200 3150
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
Time = c(2200, 3150, 2200, 3150),
LogitAdjusted = c(left.word2.TD, right.word2.TD, left.word2.DLD, right.word2.DLD)
)
plot <- response_time_W2_c %>%
dplyr::group_by(Group, Time) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = Time, y = LogitAdjusted, color=Group))+
geom_line(linetype = "dotted", size = 0.5, alpha = 0.7)+
geom_line(data = fit, size = 1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
geom_hline(yintercept = 0, color="black", size=0.5, linetype="dashed")+
ggtitle("Word 2")+
xlab("Time (ms)")+
ylim(-0.1,0.8)+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")
ggsave("Graphs/W2_Group_Time.png", dpi=600, width = 12, height = 12, units = "cm")
p
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
trial.effect = fixef [["TrialId"]]
interaction = fixef [["Group-DLD+TD:TrialId"]]
range(response_time_W2$TrialId)
## [1] -1.514054 1.778925
left.word2.TD = intercept + +0.5 * group.effect + -1.514054 * trial.effect + +0.5 * -1.514054 * interaction
right.word2.TD = intercept + +0.5 * group.effect + +1.778925 * trial.effect + +0.5 * +1.778925 * interaction
cat ("TD:", left.word2.TD, right.word2.TD, "\n")
## TD: 0.5764109 0.9399786
left.word2.DLD = intercept + -0.5 * group.effect + -1.514054 * trial.effect + -0.5 * -1.514054 * interaction
right.word2.DLD = intercept + -0.5 * group.effect + +1.778925 * trial.effect + -0.5 * +1.778925 * interaction
cat ("DLD:", left.word2.DLD, right.word2.DLD, "\n")
## DLD: 0.5627598 0.1112815
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
TrialId = c(1, 28, 1, 28),
LogitAdjusted = c(left.word2.TD, right.word2.TD, left.word2.DLD, right.word2.DLD)
)
plot <- response_time_W2_c %>%
dplyr::group_by(Group, TrialId) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = TrialId, y = LogitAdjusted, color=Group, group = Group))+
geom_line(linetype = "dotted", size=0.5, alpha = 0.7)+
geom_line(data = fit, size=1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
geom_hline(yintercept = 0, color="black", size=0.5, linetype="dashed")+
ggtitle("Word 2")+
xlab("Trial in experiment")+
scale_x_continuous(breaks=seq(0,28,5))+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")
ggsave("Graphs/W2_Group_Trial.png", dpi=600, width = 12, height = 12, units = "cm")
p
fixef <- lme4::fixef (model_W2)
options (width = 150)
cbind (names (fixef),
lmerTest::contest (model_W2,
diag (length (fixef)),
joint = FALSE, # each predictor its own c.i. and p-value
ddf = "Satterthwaite")) # = the default degrees-of-freedom estimation method
intercept = fixef [["(Intercept)"]]
group.effect = fixef [["Group-DLD+TD"]]
condition.effect = fixef [["Condition-LowCD+HighCD"]]
interaction = fixef [["Group-DLD+TD:Condition-LowCD+HighCD"]]
left.word2.TD = intercept + +0.5 * group.effect + -0.5 * condition.effect + +0.5 * -0.5 * interaction
right.word2.TD = intercept + +0.5 * group.effect + +0.5 * condition.effect + +0.5 * +0.5 * interaction
cat ("TD:", left.word2.TD, right.word2.TD, "\n")
## TD: 0.6852614 0.8018845
left.word2.DLD = intercept + -0.5 * group.effect + -0.5 * condition.effect + -0.5 * -0.5 * interaction
right.word2.DLD = intercept + -0.5 * group.effect + +0.5 * condition.effect + -0.5 * +0.5 * interaction
cat ("DLD:", left.word2.DLD, right.word2.DLD, "\n")
## DLD: 0.3016111 0.4087449
fit <- data.frame (Group = c("TD", "TD", "DLD", "DLD"),
Condition = c("LowCD", "HighCD", "LowCD", "HighCD"),
LogitAdjusted = c(left.word2.TD, right.word2.TD, left.word2.DLD, right.word2.DLD)
)
plot <- response_time_W2_c %>%
dplyr::group_by(Group, Condition) %>%
dplyr::summarise(LogitAdjusted=mean(LogitAdjusted))
## `summarise()` has grouped output by 'Group'. You can override using the `.groups` argument.
p <- ggplot(plot, aes(x = factor(Condition, levels = c ("LowCD", "HighCD")), y = LogitAdjusted, color=Group, group = Group))+
geom_line(linetype = "dotted", size=0.5, alpha = 0.7)+
geom_line(data = fit, aes(x = Condition, y = LogitAdjusted, color = Group), size=1.2, alpha = 0.7)+
scale_color_manual(values=c("black", "#E69F00"))+
ylim(-0.1, 1)+
ggtitle("Word 2")+
xlab("Condition")+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
theme(legend.position = "top", legend.direction = "horizontal")
ggsave("Graphs/W2_Group_Condition.png", dpi=600, width = 12, height = 12, units = "cm")
p
p
p
p
p
p
p
p
p
p
p