1 Prep

Set Working Directory:

setwd("/Users/sanshirohogawa/Library/Mobile Documents/com~apple~CloudDocs/Stats Consulting/Abbie")

Load necessary packages:

library(readr)
library(dplyr)
library(psych)
library(lme4)
library(lmerTest)
library(ggplot2)
library(emmeans)
library(effects)
library(glmmTMB)
library(buildmer)
library(DHARMa)
library(HLMdiag)

Import datasets:

dat <- read_csv("dataset_complete.csv", show_col_types = FALSE)
dat$Participant <- as.factor(dat$Participant)
is.factor(dat$Participant)
## [1] TRUE
dat$Complexity <- as.factor(dat$Complexity)
is.factor(dat$Complexity)
## [1] TRUE
dat$Genre <- as.factor(dat$Genre)
is.factor(dat$Genre)
## [1] TRUE
colSums(is.na(dat))
##                Participant     MasteryGoal_motivation 
##                          0                          0 
##   AvoidanceGoal_motivation PerformanceGoal_motivation 
##                          0                          0 
##    SelfEfficacy_motivation       TaskValue_motivation 
##                          0                          0 
##     Attribution_motivation            Somatic_Anxiety 
##                          0                          0 
##          Avoidance_Anxiety          Cognitive_Anxiety 
##                          0                          0 
##           OSPANabsolute_WM              OSPANtotal_WM 
##                          0                          0 
##               OSPANmath_WM            RSPANpartial_WM 
##                          0                          0 
##              RSPANtotal_WM                     MotEng 
##                          0                          0 
##                  AchievEng                      StAnx 
##                          0                          0 
##                     CogAnx                      Genre 
##                          0                          0 
##                 Complexity                       Task 
##                          0                          0 
##              Subordination               Coordination 
##                          0                          0 
##             AccuracyGender             AccuracyNumber 
##                          0                          0 
##              AccuracyTense             AccuracyAspect 
##                          0                          0 
##             LexicalDensity           LexicalDiversity 
##                          0                          0 
##  FluencySyllablesperMinute               mentaleffort 
##                          0                          0 
##                 difficulty            contentplanning 
##                          0                          0 
##       linguisticchallenges              PTD_composite 
##                          0                          0
describe(dat) 
##                            vars   n   mean    sd median trimmed    mad   min
## Participant*                  1 632  79.50 45.65  79.50   79.50  58.56  1.00
## MasteryGoal_motivation        2 632  22.64  5.77  22.00   22.62   5.93  7.00
## AvoidanceGoal_motivation      3 632  40.27  8.40  41.00   40.33   8.90 17.00
## PerformanceGoal_motivation    4 632  23.74  6.65  24.00   23.73   5.93  3.00
## SelfEfficacy_motivation       5 632  39.70  6.43  39.50   39.47   5.93 24.00
## TaskValue_motivation          6 632  27.80  7.95  27.00   27.56   7.41  7.00
## Attribution_motivation        7 632  19.41  3.29  20.00   19.51   2.97 10.00
## Somatic_Anxiety               8 632  22.22  6.64  22.00   22.11   7.41 10.00
## Avoidance_Anxiety             9 632  17.18  3.99  17.00   17.11   4.45  7.00
## Cognitive_Anxiety            10 632  33.90  5.10  35.00   34.09   5.93 19.00
## OSPANabsolute_WM             11 632  38.30 15.58  39.00   38.79  14.08  0.00
## OSPANtotal_WM                12 632  52.32 15.04  55.00   54.16  11.86  1.00
## OSPANmath_WM*                13 632  15.51 10.44  16.00   15.55  14.83  1.00
## RSPANpartial_WM              14 632  15.92  6.29  15.50   15.75   5.19  1.00
## RSPANtotal_WM                15 632  29.03  8.92  29.00   28.86   7.41  7.00
## MotEng                       16 632  -0.01  1.00  -0.01   -0.02   0.83 -2.65
## AchievEng                    17 632   0.00  1.00  -0.05   -0.02   0.92 -2.98
## StAnx                        18 632   0.00  1.00  -0.06   -0.02   1.09 -2.06
## CogAnx                       19 632  -0.01  1.00   0.11    0.02   1.02 -3.36
## Genre*                       20 632   1.50  0.50   1.50    1.50   0.74  1.00
## Complexity*                  21 632   1.50  0.50   1.50    1.50   0.74  1.00
## Task*                        22 632   2.50  1.12   2.50    2.50   1.48  1.00
## Subordination                23 632   1.53  1.59   1.00    1.26   1.48  0.00
## Coordination                 24 632   2.37  2.04   2.00    2.12   1.48  0.00
## AccuracyGender               25 632   2.20  1.91   2.00    1.97   1.48  0.00
## AccuracyNumber               26 632   0.73  1.01   0.00    0.57   0.00  0.00
## AccuracyTense                27 632   1.56  1.52   1.00    1.37   1.48  0.00
## AccuracyAspect               28 632   0.62  1.59   0.00    0.19   0.00  0.00
## LexicalDensity*              29 632 120.97 68.36 126.00  121.43  87.47  1.00
## LexicalDiversity             30 632   0.75  2.06   0.64    0.64   0.15  0.06
## FluencySyllablesperMinute*   31 632 136.51 85.04 142.00  136.70 114.16  1.00
## mentaleffort                 32 632   6.07  1.63   6.00    6.14   1.48  1.00
## difficulty                   33 632   5.94  1.73   6.00    6.00   1.48  1.00
## contentplanning              34 632   5.32  1.96   5.00    5.32   2.22  1.00
## linguisticchallenges         35 632   6.48  1.72   7.00    6.56   1.48  1.00
## PTD_composite                36 632   5.95  1.47   6.00    5.99   1.48  1.50
##                               max  range  skew kurtosis   se
## Participant*               158.00 157.00  0.00    -1.21 1.82
## MasteryGoal_motivation      39.00  32.00  0.11     0.40 0.23
## AvoidanceGoal_motivation    59.00  42.00 -0.12    -0.45 0.33
## PerformanceGoal_motivation  40.00  37.00 -0.06     0.33 0.26
## SelfEfficacy_motivation     58.00  34.00  0.34     0.33 0.26
## TaskValue_motivation        50.00  43.00  0.23     0.18 0.32
## Attribution_motivation      30.00  20.00 -0.19     0.81 0.13
## Somatic_Anxiety             37.00  27.00  0.15    -0.82 0.26
## Avoidance_Anxiety           29.00  22.00  0.20     0.18 0.16
## Cognitive_Anxiety           44.00  25.00 -0.36    -0.60 0.20
## OSPANabsolute_WM            75.00  75.00 -0.28     0.04 0.62
## OSPANtotal_WM               78.00  77.00 -1.13     1.18 0.60
## OSPANmath_WM*               29.00  28.00 -0.16    -1.65 0.42
## RSPANpartial_WM             36.00  35.00  0.36     0.33 0.25
## RSPANtotal_WM               54.00  47.00  0.14     0.30 0.35
## MotEng                       3.06   5.71  0.20     0.65 0.04
## AchievEng                    2.73   5.70  0.06     0.50 0.04
## StAnx                        2.36   4.42  0.22    -0.52 0.04
## CogAnx                       2.23   5.59 -0.35    -0.05 0.04
## Genre*                       2.00   1.00  0.00    -2.00 0.02
## Complexity*                  2.00   1.00  0.00    -2.00 0.02
## Task*                        4.00   3.00  0.00    -1.37 0.04
## Subordination                7.00   7.00  1.26     1.12 0.06
## Coordination                10.00  10.00  1.02     0.74 0.08
## AccuracyGender              10.00  10.00  1.08     1.21 0.08
## AccuracyNumber               7.00   7.00  1.50     2.89 0.04
## AccuracyTense               10.00  10.00  1.34     3.56 0.06
## AccuracyAspect              12.00  12.00  3.30    12.93 0.06
## LexicalDensity*            246.00 245.00 -0.10    -1.21 2.72
## LexicalDiversity            37.23  37.17 17.51   306.83 0.08
## FluencySyllablesperMinute* 273.00 272.00 -0.04    -1.41 3.38
## mentaleffort                 9.00   8.00 -0.37    -0.10 0.06
## difficulty                   9.00   8.00 -0.31    -0.38 0.07
## contentplanning              9.00   8.00 -0.04    -0.76 0.08
## linguisticchallenges         9.00   8.00 -0.44    -0.33 0.07
## PTD_composite                9.00   7.50 -0.24    -0.21 0.06

CALF measures of interest:

  1. Syntactic Complexity
  1. Accuracy
  1. Lexical Complexity
  1. Fluency

2 Fit Models

2.1 RQ1a:

How does altering task complexity and genre — specifically argumentative and narrative — influence the quality of adolescent L2 writing?

2.1.1 RQ1a(i): Syntactic Complexity (Subordination)

How does altering task complexity and genre — specifically argumentative and narrative — influence the syntactic subordination?

First, check to see the distribution of “Subordination.”

unique(dat$Subordination)
## [1] 2 0 1 3 4 6 5 7
describe(dat$Subordination)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 632 1.53 1.59      1    1.26 1.48   0   7     7 1.26     1.12 0.06
hist(dat$Subordination)

Things to note:

  • Subordination includes 0.
  • It is a count variable.

Therefore, I will fit a poisson regression.

Run the model:

mod1sub <- glmmTMB(Subordination ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1sub)
##  Family: poisson  ( log )
## Formula:          Subordination ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    1883.0    1905.2    -936.5    1873.0       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.4748   0.6891  
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.44979    0.08297   5.421 5.93e-08 ***
## GenreNAR                  -0.27393    0.08600  -3.185 0.001447 ** 
## ComplexitySIMPLE          -0.09021    0.08180  -1.103 0.270108    
## GenreNAR:ComplexitySIMPLE -0.51453    0.13633  -3.774 0.000161 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Main effect of Genre significant
  • Interaction between Genre and Complexity significant

Visualization

allEffects(mod1sub)
##  model: Subordination ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX    SIMPLE
##   ARG 1.567988 1.4327306
##   NAR 1.192279 0.6512435
allEffects(mod1sub) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre: Subordination decreases for the Narrative task compared to the Argumentative task.
  • Interaction effect of Genre x Complexity: When Genre is NAR and Complexity is SIMPLE, the subordination count decreases compared to ARG and COMPLEX.

2.1.2 RQ1a(ii): Syntactic Complexity (Coordination)

How does altering task complexity and genre — specifically argumentative and narrative — influence the syntactic coordination?

First, check to see the distribution of “Coordination.”

unique(dat$Coordination)
##  [1]  1  3  2  6  8  4  7  5  0 10  9
describe(dat$Coordination)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 632 2.37 2.04      2    2.12 1.48   0  10    10 1.02     0.74 0.08
hist(dat$Coordination)

Things to note:

  • Coordination includes 0.
  • It is a count variable.

Therefore, I will fit a poisson regression.

Run the model:

mod1coor <- glmmTMB(Coordination ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1coor)
##  Family: poisson  ( log )
## Formula:          Coordination ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2311.4    2333.6   -1150.7    2301.4       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.4238   0.651   
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.57888    0.07732   7.487 7.07e-14 ***
## GenreNAR                   0.10216    0.07438   1.374    0.170    
## ComplexitySIMPLE           0.03989    0.07550   0.528    0.597    
## GenreNAR:ComplexitySIMPLE  0.04799    0.10358   0.463    0.643    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Nothing is significant.

Visualization

allEffects(mod1coor)
##  model: Coordination ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 1.784031 1.856640
##   NAR 1.975920 2.157434
allEffects(mod1coor) %>% plot(multiline=TRUE)

Interpretation:

  • NAR seems to lead to more Coordination than ARG, but the effect is not statistically significant.
  • When Genre is NAR and Complexity is SIMPLE, it seems like the Coordination increases, but it’s not statistically significant.

2.1.3 RQ1a(iii): Accuracy (Number)

How does altering task complexity and genre — specifically argumentative and narrative — influence the accuracy in number?

First, check to see the distribution of “AccuracyNumber.”

unique(dat$AccuracyNumber)
## [1] 0 1 2 5 3 7 4
table(dat$AccuracyNumber) # a large number of 0s >> zero-inflated poisson necessary?
## 
##   0   1   2   3   4   5   7 
## 361 127 113  20   9   1   1
describe(dat$AccuracyNumber)
##    vars   n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 632 0.73 1.01      0    0.57   0   0   7     7  1.5     2.89 0.04
hist(dat$AccuracyNumber)

Things to note:

  • AccuracyNumber includes 0.
  • It is a count variable.
mod1num1 <- glmmTMB(AccuracyNumber ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1num1)
##  Family: poisson  ( log )
## Formula:          AccuracyNumber ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    1381.1    1403.4    -685.6    1371.1       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9376   0.9683  
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.83913    0.13911  -6.032 1.62e-09 ***
## GenreNAR                   0.29725    0.12945   2.296   0.0217 *  
## ComplexitySIMPLE           0.06514    0.13647   0.477   0.6331    
## GenreNAR:ComplexitySIMPLE -0.34334    0.18762  -1.830   0.0673 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Better model with zero-inflated generalized linear mixed model
mod1num2 <- glmmTMB(AccuracyNumber ~ Genre * Complexity + (1|Participant), 
                    family = nbinom2, # negative binomial
                    ziformula = ~1,  # zero-inflated generalized linear mixed model
                    dat)
summary(mod1num2)
##  Family: nbinom2  ( log )
## Formula:          AccuracyNumber ~ Genre * Complexity + (1 | Participant)
## Zero inflation:                  ~1
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    1385.1    1416.3    -685.6    1371.1       625 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9376   0.9683  
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom2 family (): 2.54e+07 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.83913    0.13911  -6.032 1.62e-09 ***
## GenreNAR                   0.29725    0.12945   2.296   0.0217 *  
## ComplexitySIMPLE           0.06514    0.13647   0.477   0.6331    
## GenreNAR:ComplexitySIMPLE -0.34334    0.18762  -1.830   0.0673 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Zero-inflation model:
##             Estimate Std. Error z value Pr(>|z|)
## (Intercept)   -16.88     770.49  -0.022    0.983

Results:

  • Main effect of Genre significant

Visualization

allEffects(mod1num2)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyNumber ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.4320854 0.4611681
##   NAR 0.5816535 0.4403948
allEffects(mod1num2) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre: Changing Genre from ARG to NAR leads to higher accuracy in number.

2.1.4 RQ1a(iv): Accuracy (Gender)

How does altering task complexity and genre — specifically argumentative and narrative — influence the accuracy in gender?

First, check to see the distribution of “AccuracyGender.”

unique(dat$AccuracyGender)
##  [1]  1  0  3  2  5  4  7  6 10  8  9
table(dat$AccuracyGender)
## 
##   0   1   2   3   4   5   6   7   8   9  10 
## 127 134 143  97  52  42  14  12   5   5   1
describe(dat$AccuracyGender)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 632  2.2 1.91      2    1.97 1.48   0  10    10 1.08     1.21 0.08
hist(dat$AccuracyGender)

Things to note:

  • AccuracyGender includes 0.
  • It is a count variable.
mod1gen1 <- glmmTMB(AccuracyGender ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1gen1)
##  Family: poisson  ( log )
## Formula:          AccuracyGender ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2403.9    2426.1   -1196.9    2393.9       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.075    0.2739  
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                1.05924    0.05185  20.431  < 2e-16 ***
## GenreNAR                  -0.45198    0.07373  -6.130 8.79e-10 ***
## ComplexitySIMPLE          -0.19038    0.06835  -2.785  0.00535 ** 
## GenreNAR:ComplexitySIMPLE -0.09178    0.11135  -0.824  0.40981    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Better model with zero-inflated generalized linear mixed model
mod1gen2 <- glmmTMB(AccuracyGender ~ Genre * Complexity + (1|Participant), 
                    family = nbinom2, # negative binomial
                    ziformula = ~1, # zero-inflated generalized linear mixed model
                    dat)
summary(mod1gen2)
##  Family: nbinom2  ( log )
## Formula:          AccuracyGender ~ Genre * Complexity + (1 | Participant)
## Zero inflation:                  ~1
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2372.7    2403.8   -1179.3    2358.7       625 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.01082  0.104   
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom2 family (): 6.07 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                1.12296    0.06386  17.583  < 2e-16 ***
## GenreNAR                  -0.43587    0.09128  -4.775  1.8e-06 ***
## ComplexitySIMPLE          -0.19057    0.08471  -2.250   0.0245 *  
## GenreNAR:ComplexitySIMPLE -0.09992    0.13310  -0.751   0.4528    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Zero-inflation model:
##             Estimate Std. Error z value Pr(>|z|)    
## (Intercept)  -3.2531     0.7999  -4.067 4.77e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Main effect of Genre significant
  • Main effect of Complexity significant

Visualization

allEffects(mod1gen2)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyGender ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 3.073943 2.540588
##   NAR 1.987914 1.486768
allEffects(mod1gen2) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre: Changing Genre from ARG to NAR leads to fewer gender accuracy.
  • Main effect of Complexity: Changing Complexity from COMPLEX to SIMPLE leads to fewer gender accuracy.

2.1.5 RQ1a(v): Accuracy (Tense)

How does altering task complexity and genre — specifically argumentative and narrative — influence the accuracy in tense?

First, check to see the distribution of “AccuracyTense.”

unique(dat$AccuracyTense)
##  [1]  1  0  3  4  2  5  6 10  7  8  9
table(dat$AccuracyTense)
## 
##   0   1   2   3   4   5   6   7   8   9  10 
## 192 146 144  87  45   8   5   1   1   1   2
describe(dat$AccuracyTense)
##    vars   n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 632 1.56 1.52      1    1.37 1.48   0  10    10 1.34     3.56 0.06
hist(dat$AccuracyTense)

Things to note:

  • AccuracyTense includes 0.
  • It is a count variable.
mod1ten <- glmmTMB(AccuracyTense ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1ten)
##  Family: poisson  ( log )
## Formula:          AccuracyTense ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2031.8    2054.1   -1010.9    2021.8       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.1668   0.4084  
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.06722    0.08213   0.819    0.413    
## GenreNAR                   0.51516    0.09317   5.529 3.22e-08 ***
## ComplexitySIMPLE          -0.02756    0.10498  -0.262    0.793    
## GenreNAR:ComplexitySIMPLE  0.05951    0.13196   0.451    0.652    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Main effect of Genre is significant.

Visualization

allEffects(mod1ten)
##  model: AccuracyTense ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 1.069536 1.040467
##   NAR 1.790303 1.848428
allEffects(mod1ten) %>% plot(multiline=TRUE)

Interpretation:

  • Changing Genre from ARG to NAR leads to higher accuracy in tense.

2.1.6 RQ1a(vi): Accuracy (Aspect)

How does altering task complexity and genre — specifically argumentative and narrative — influence the accuracy in aspect?

First, check to see the distribution of “AccuracyAspect.”

unique(dat$AccuracyAspect)
##  [1]  0  1  3  4  2  5  6  8 10 12  9  7 11
table(dat$AccuracyAspect)
## 
##   0   1   2   3   4   5   6   7   8   9  10  11  12 
## 514  23  24  33  11  12   5   5   1   1   1   1   1
describe(dat$AccuracyAspect)
##    vars   n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 632 0.62 1.59      0    0.19   0   0  12    12  3.3    12.93 0.06
hist(dat$AccuracyAspect)

Things to note:

  • AccuracyTense includes 0.
  • It is a count variable.
mod1asp1 <- glmmTMB(AccuracyAspect ~ Genre * Complexity + (1|Participant), family = poisson, dat)
summary(mod1asp1)
##  Family: poisson  ( log )
## Formula:          AccuracyAspect ~ Genre * Complexity + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##     965.0     987.3    -477.5     955.0       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.5652   0.7518  
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                -1.7300     0.1818  -9.516  < 2e-16 ***
## GenreNAR                    2.2326     0.1730  12.906  < 2e-16 ***
## ComplexitySIMPLE           -2.9178     0.7260  -4.019 5.84e-05 ***
## GenreNAR:ComplexitySIMPLE  -1.3163     0.8544  -1.541    0.123    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Better model with zero-inflated generalized linear mixed model
mod1asp2 <- glmmTMB(AccuracyAspect ~ Genre * Complexity + (1|Participant), 
                    family = nbinom1, # negative binomial (nbinom1; nbinom2 did not resolve issues)
                    ziformula = ~1, # zero-inflated generalized linear mixed model
                    dat)
summary(mod1asp2)
##  Family: nbinom1  ( log )
## Formula:          AccuracyAspect ~ Genre * Complexity + (1 | Participant)
## Zero inflation:                  ~1
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##     802.4     833.6    -394.2     788.4       625 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance  Std.Dev. 
##  Participant (Intercept) 2.227e-09 4.719e-05
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom1 family (): 1.62 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                -2.6362     0.4560  -5.781 7.41e-09 ***
## GenreNAR                    3.6747     0.4595   7.997 1.27e-15 ***
## ComplexitySIMPLE           -1.0193     0.8385  -1.216  0.22412    
## GenreNAR:ComplexitySIMPLE  -2.7585     0.9560  -2.886  0.00391 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Zero-inflation model:
##             Estimate Std. Error z value Pr(>|z|)   
## (Intercept)  -1.5430     0.4692  -3.289  0.00101 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Main effect of Genre is significant.
  • Interaction between Genre and Complexity is significant

Visualization

allEffects(mod1asp2)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyAspect ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX     SIMPLE
##   ARG 0.0716303 0.02584830
##   NAR 2.8249326 0.06461372
allEffects(mod1asp2) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre: Changing ARG to NAR seems to lead to higher accuracy in aspect.
  • Interaction between Genre and Complexity: When Genre is NAR and Complexity is SIMPLE, the accuracy in aspect is lower.

2.1.7 RQ1a(vii): Lexical Complexity (Lexical Density)

How does altering task complexity and genre — specifically argumentative and narrative — influence the lexical density?

First, check to see the distribution of “LexicalDensity.”

unique(dat$LexicalDensity) # Participant 141 has "%" in the cell ... I will remove for this analysis. 
##   [1] "0.28129999999999999" "0.42859999999999998" "0.31709999999999999"
##   [4] "0.47499999999999998" "0.3448"              "0.25690000000000002"
##   [7] "0.28789999999999999" "0.39219999999999999" "0.5585"             
##  [10] "0.52629999999999999" "0.58460000000000001" "0.64"               
##  [13] "0.71430000000000005" "0.66669999999999996" "0.7"                
##  [16] "0.6"                 "0.6522"              "0.73109999999999997"
##  [19] "0.67290000000000005" "0.84550000000000003" "0.43590000000000001"
##  [22] "0.55000000000000004" "0.47370000000000001" "0.60709999999999997"
##  [25] "0.63639999999999997" "0.60609999999999997" "0.6552"             
##  [28] "0.55559999999999998" "0.73909999999999998" "0.50819999999999999"
##  [31] "0.52"                "0.51470000000000005" "0.5"                
##  [34] "0.64710000000000001" "0.375"               "0.4375"             
##  [37] "0.46150000000000002" "0.59"                "0.62"               
##  [40] "0.61"                "0.28570000000000001" "0.38300000000000001"
##  [43] "0.32140000000000002" "0.44190000000000002" "0.57279999999999998"
##  [46] "0.59460000000000002" "0.54730000000000001" "0.51910000000000001"
##  [49] "0.53849999999999998" "0.60699999999999998" "0.34620000000000001"
##  [52] "0.56979999999999997" "0.48780000000000001" "0.55320000000000003"
##  [55] "0.35899999999999999" "0.36170000000000002" "0.51280000000000003"
##  [58] "0.33329999999999999" "0.25"                "0.35"               
##  [61] "0.35289999999999999" "0.56100000000000005" "0.59260000000000002"
##  [64] "0.45350000000000001" "0.47470000000000001" "0.44969999999999999"
##  [67] "0.46289999999999998" "0.57140000000000002" "0.59379999999999999"
##  [70] "0.4783"              "0.44440000000000002" "0.44740000000000002"
##  [73] "0.64859999999999995" "0.59240000000000004" "0.61539999999999995"
##  [76] "0.56189999999999996" "0.54210000000000003" "0.55210000000000004"
##  [79] "0.27160000000000001" "0.22770000000000001" "0.27850000000000003"
##  [82] "0.40739999999999998" "0.50849999999999995" "0.47170000000000001"
##  [85] "0.56520000000000004" "0.54239999999999999" "0.6512"             
##  [88] "0.61899999999999999" "0.3226"              "0.42"               
##  [91] "0.4"                 "0.71150000000000002" "0.69"               
##  [94] "0.51129999999999998" "0.65310000000000001" "0.63200000000000001"
##  [97] "0.71299999999999997" "0.51849999999999996" "0.4178"             
## [100] "0.70669999999999999" "0.48699999999999999" "0.50449999999999995"
## [103] "0.45"                "0.37209999999999999" "0.26669999999999999"
## [106] "0.42499999999999999" "0.37309999999999999" "0.42549999999999999"
## [109] "0.37780000000000002" "0.58620000000000005" "0.625"              
## [112] "0.22439999999999999" "0.5161"              "0.3846"             
## [115] "0.44"                "0.54549999999999998" "0.41670000000000001"
## [118] "0.51719999999999999" "0.36840000000000001" "0.36"               
## [121] "0.5333"              "0.45829999999999999" "0.63"               
## [124] "0.65"                "0.73960000000000004" "0.60199999999999998"
## [127] "0.70069999999999999" "0.65380000000000005" "0.69230000000000003"
## [130] "0.71699999999999997" "0.77780000000000005" "0.75"               
## [133] "0.42109999999999997" "0.45710000000000001" "0.62860000000000005"
## [136] "0.62919999999999998" "0.56000000000000005" "0.49"               
## [139] "0.57999999999999996" "0.63829999999999998" "0.67"               
## [142] "0.66"                "0.67649999999999999" "0.61699999999999999"
## [145] "0.60529999999999995" "0.60980000000000001" "0.56920000000000004"
## [148] "0.70450000000000002" "0.61729999999999996" "0.48649999999999999"
## [151] "0.48"                "0.3019"              "0.25929999999999997"
## [154] "0.44119999999999998" "0.32790000000000002" "0.53129999999999999"
## [157] "0.5625"              "0.34210000000000002" "0.55879999999999996"
## [160] "0.34338000000000002" "0.3548"              "0.29549999999999998"
## [163] "0.3095"              "0.6573"              "0.72919999999999996"
## [166] "0.69389999999999996" "0.2581"              "0.2571"             
## [169] "0.3478"              "0.61109999999999998" "0.72"               
## [172] "0.3256"              "0.52939999999999998" "0.3947"             
## [175] "0.38240000000000002" "0.36670000000000003" "0.34379999999999999"
## [178] "0.35420000000000001" "0.41860000000000003" "0.83299999999999996"
## [181] "0.63009999999999999" "0.71050000000000002" "0.4667"             
## [184] "0.52380000000000004" "0.47220000000000001" "0.32079999999999997"
## [187] "0.78569999999999995" "0.5111"              "0.44829999999999998"
## [190] "0.58819999999999995" "0.40029999999999999" "0.61160000000000003"
## [193] "0.72729999999999995" "0.6875"              "0.6714"             
## [196] "0.68689999999999996" "0.59040000000000004" "0.27589999999999998"
## [199] "0.39290000000000003" "0.30769999999999997" "0.63270000000000004"
## [202] "0.67569999999999997" "0.69769999999999999" "0.63890000000000002"
## [205] "0.63160000000000005" "0.69569999999999999" "0.68420000000000003"
## [208] "0.56759999999999999" "0.64439999999999997" "0.59299999999999997"
## [211] "0.49280000000000002" "0.45610000000000001" "0.59570000000000001"
## [214] "0.4516"              "0.42420000000000002" "0.78949999999999998"
## [217] "0.67349999999999999" "0.72340000000000004" "0.43330000000000002"
## [220] "0.2545"              "0.37930000000000003" "0.46510000000000001"
## [223] "0.68630000000000002" "0.68"                "0.70730000000000004"
## [226] "0.81479999999999997" "0.69830000000000003" "0.83160000000000001"
## [229] "0.39579999999999999" "0.3962"              "0.62070000000000003"
## [232] "0.27779999999999999" "56`%"                "0.37140000000000001"
## [235] "0.67859999999999998" "0.65849999999999997" "0.6774"             
## [238] "0.62370000000000003" "0.66269999999999996" "0.66069999999999995"
## [241] "0.72640000000000005" "0.43240000000000001" "0.2424"             
## [244] "0.64839999999999998" "0.56999999999999995" "0.30499999999999999"
dat_density <- dat %>% 
  filter(Participant != "141")

dat_density$LexicalDensity <- as.numeric(dat_density$LexicalDensity) # The values are stored as characters, change to numeric
describe(dat$AccuracyAspect)
##    vars   n mean   sd median trimmed mad min max range skew kurtosis   se
## X1    1 632 0.62 1.59      0    0.19   0   0  12    12  3.3    12.93 0.06
hist(dat_density$LexicalDensity)

Fit model:

mod1density <- lmer(LexicalDensity ~ Genre * Complexity + (1|Participant), dat_density)
summary(mod1density)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: LexicalDensity ~ Genre * Complexity + (1 | Participant)
##    Data: dat_density
## 
## REML criterion at convergence: -1099.9
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.0866 -0.5644  0.0439  0.4954  3.4928 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.013923 0.11799 
##  Residual                0.005275 0.07263 
## Number of obs: 628, groups:  Participant, 157
## 
## Fixed effects:
##                             Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)                 0.524925   0.011058 242.055324  47.471   <2e-16 ***
## GenreNAR                    0.012968   0.008197 468.000004   1.582   0.1143    
## ComplexitySIMPLE           -0.017729   0.008197 468.000004  -2.163   0.0311 *  
## GenreNAR:ComplexitySIMPLE  -0.012870   0.011592 468.000004  -1.110   0.2675    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.371              
## CmplxSIMPLE -0.371  0.500       
## GNAR:CSIMPL  0.262 -0.707 -0.707

Note:

  • Some caution for interpretation necessary because the assumptions are not met.

Results:

  • Main effect of Complexity is significant.

Visualization

allEffects(mod1density)
##  model: LexicalDensity ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.5249255 0.5071968
##   NAR 0.5378936 0.5072954
allEffects(mod1density) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Complexity: Changing Complexity from SIMPLE to COMPLEX increases lexical density.

2.1.8 RQ1a(viii): Lexical Complexity (Lexical Diversity)

How does altering task complexity and genre — specifically argumentative and narrative — influence the lexical diversity?

First, check to see the distribution of “LexicalDiversity.”

describe(dat$LexicalDiversity)
##    vars   n mean   sd median trimmed  mad  min   max range  skew kurtosis   se
## X1    1 632 0.75 2.06   0.64    0.64 0.15 0.06 37.23 37.17 17.51   306.83 0.08
hist(dat$LexicalDiversity)

unique(dat$LexicalDiversity) # Participants 157 and 158 have extreme values ... remove for this analysis. 
##   [1]  0.5938  0.8095  0.5610  0.9000  0.4500  0.4900  0.4242  0.6078  0.3900
##  [10]  0.4700  0.6494  0.6797  0.6923  0.7400  0.8571  0.9167  0.4957  0.6134
##  [19]  0.5701  0.6182  0.4872  0.4103  0.5263  0.6429  0.6970  0.7333  0.7879
##  [28]  0.6500  0.6207  0.6296  0.7391  0.4426  0.4800  0.4559  0.4231  0.8235
##  [37]  0.2810  0.6875  0.9231  0.6900  0.6800  0.7100  0.7000  0.4400  0.6809
##  [46]  0.5000  0.8140  0.4660  0.5405  0.4737  0.7692  0.7140  0.5556  0.4615
##  [55]  0.6977  0.6585  0.6170  0.6316  0.3617  0.5897  0.6667  0.8500  0.7059
##  [64]  0.8049  0.8000  0.7407  0.8519  0.6047  0.5886  0.6190  0.5943  0.5873
##  [73]  0.6406  0.8261  0.8333  0.6053  0.6061  0.6486  0.6417  0.5091  0.4381
##  [82]  0.6636  0.6250  0.5172  0.3761  0.2469  0.2079  0.2532  0.3529  0.5741
##  [91]  0.6102  0.6226  0.6304  0.7627  0.6111  0.7619  0.8700  0.4839  0.7083
## [100]  0.5882  0.5100  0.7500  0.7600  0.4962  0.6224  0.5600  0.6731  0.6364
## [109]  0.7877  0.8533  0.7739  0.7928  0.6000  0.8182  0.8667  0.4250  0.3731
## [118]  0.4681  0.5102  0.6897  0.6222  0.7097  0.7308  0.4000  0.7300  0.6333
## [127]  0.8367  0.6087  0.7200  0.5500  0.5816  0.5839  0.7576  0.8462  0.7143
## [136]  0.6857  0.6538  0.5714  0.7547  0.8889  0.8750  0.6579  0.6571  0.8330
## [145]  0.7857  0.6067  0.5900  0.5278  0.8056  0.6892  0.7674  0.7667  0.7053
## [154]  0.7241  0.9091  0.7660  0.8185  0.5231  0.6591  0.4595  0.5309  0.5946
## [163]  0.9032  0.8400  0.9048  0.5660  0.4815  0.5385  0.5410  0.4490  0.7813
## [172]  0.7900  0.7105  0.6471  0.6563  0.5806  0.7045  0.6842  0.7381  0.4196
## [181]  0.7917  0.6774  0.6944  0.8900  0.6512  0.8250  0.7353  0.4688  0.6042
## [190]  0.8372  0.6905  0.6400  0.4658  0.5300  0.5640  0.5116  0.4468  0.8600
## [199]  0.9400  0.4038  0.7222  0.5094  0.4889  0.0986  0.5526  0.6164  0.6600
## [208]  0.6984  0.3429  0.3243  0.7647  0.5571  0.5812  0.7349  0.7544  0.7632
## [217]  0.6786  0.7234  0.7551  0.7368  0.6860  0.6377  0.7281  0.6383  0.4082
## [226]  0.5390  0.5143  0.7250  0.6458  0.5814  0.7561  0.7531  0.7895  0.5849
## [235]  0.8460  0.3700  0.6349  0.6118  0.7714  0.6154  0.7273  0.7317  0.7419
## [244]  0.5161  0.5904  0.5446  0.5283  0.5192  0.4697  0.0604  0.4018 37.2300
dat_diversity <- dat %>% 
  filter(Participant != "157") %>% 
  filter(Participant != "158")

hist(dat_diversity$LexicalDiversity)

describe(dat_diversity$LexicalDiversity) # It looks better
##    vars   n mean   sd median trimmed  mad  min  max range  skew kurtosis   se
## X1    1 624 0.63 0.14   0.64    0.64 0.15 0.06 0.94  0.88 -0.31     0.12 0.01

Fit model:

mod1diversity <- lmer(LexicalDiversity ~ Genre * Complexity + (1|Participant), dat_diversity)
summary(mod1diversity)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: LexicalDiversity ~ Genre * Complexity + (1 | Participant)
##    Data: dat_diversity
## 
## REML criterion at convergence: -872.2
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.2675 -0.4809  0.0282  0.4831  3.3926 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.011743 0.10837 
##  Residual                0.008734 0.09346 
## Number of obs: 624, groups:  Participant, 156
## 
## Fixed effects:
##                            Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)                 0.62803    0.01146 312.08985  54.816  < 2e-16 ***
## GenreNAR                    0.03443    0.01058 465.00000   3.254  0.00122 ** 
## ComplexitySIMPLE           -0.01341    0.01058 465.00000  -1.267  0.20567    
## GenreNAR:ComplexitySIMPLE  -0.01646    0.01497 465.00000  -1.100  0.27198    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.462              
## CmplxSIMPLE -0.462  0.500       
## GNAR:CSIMPL  0.327 -0.707 -0.707

Note:

Some caution for interpretation necessary because the assumptions are not met.

Results:

  • Main effect of Genre is significant.

Visualization

allEffects(mod1diversity)
##  model: LexicalDiversity ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.6280340 0.6146231
##   NAR 0.6624673 0.6325974
allEffects(mod1diversity) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre: Changing Genre from ARG to NAR increases lexical diversity.

2.1.9 RQ1a(ix): Fluency (Syllables per minute)

How does altering task complexity and genre — specifically argumentative and narrative — influence the fluency?

unique(dat$FluencySyllablesperMinute) # Participant 72 has "7.3." ... remove for this analysis. 
##   [1] "4.45"               "9.14"               "7.75"              
##   [4] "9"                  "10.33"              "15"                
##   [7] "10"                 "14"                 "12"                
##  [10] "16"                 "11"                 "17"                
##  [13] "7.17"               "13.2"               "9.33"              
##  [16] "9.5"                "14.64"              "11.22"             
##  [19] "3.38"               "3.67"               "3.29"              
##  [22] "3.5"                "32.39"              "36"                
##  [25] "31.71"              "43.2"               "9.2899999999999991"
##  [28] "6.86"               "12.8"               "1.97"              
##  [31] "10.57"              "18.75"              "3.64"              
##  [34] "6.25"               "9.6"                "10.86"             
##  [37] "9.8000000000000007" "13.67"              "5.8"               
##  [40] "3.4"                "5.33"               "8.3000000000000007"
##  [43] "8.98"               "13.55"              "10.42"             
##  [46] "13"                 "5.92"               "5.54"              
##  [49] "8.1300000000000008" "6.75"               "8.1999999999999993"
##  [52] "10.36"              "6.71"               "6"                 
##  [55] "4.0999999999999996" "9.0500000000000007" "19.440000000000001"
##  [58] "11.64"              "7.29"               "9.7100000000000009"
##  [61] "10.31"              "6.63"               "10.14"             
##  [64] "6.4"                "5.4"                "12.67"             
##  [67] "10.5"               "11.7"               "10.8"              
##  [70] "11.4"               "8.57"               "8.85"              
##  [73] "4.8"                "4.58"               "8.25"              
##  [76] "8.6300000000000008" "8.33"               "3.17"              
##  [79] "5.88"               "11.25"              "18.89"             
##  [82] "19.64"              "15.42"              "9.75"              
##  [85] "14.82"              "15.7"               "11.8"              
##  [88] "12.6"               "9.7799999999999994" "11.13"             
##  [91] "14.83"              "13.5"               "7.73"              
##  [94] "7.1"                "10.6"               "2.64"              
##  [97] "4.42"               "2.8"                "5"                 
## [100] "4.9400000000000004" "9.89"               "5.07"              
## [103] "7.36"               "10.38"              "17.329999999999998"
## [106] "15.5"               "13.6"               "14.67"             
## [109] "7.63"               "14.9"               "15.4"              
## [112] "18.329999999999998" "14.85"              "2.83"              
## [115] "5.9"                "6.29"               "3"                 
## [118] "1.86"               "4"                  "2.11"              
## [121] "6.22"               "16.43"              "7.71"              
## [124] "5.5"                "7.38"               "5.25"              
## [127] "8.8000000000000007" "4.7"                "2.59"              
## [130] "3.86"               "6.38"               "8.5"               
## [133] "6.83"               "2.93"               "7.31"              
## [136] "13.36"              "10.83"              "12.4"              
## [139] "7"                  "8"                  "16.100000000000001"
## [142] "10.73"              "14.13"              "7.86"              
## [145] "6.6"                "8.8800000000000008" "11.17"             
## [148] "3.27"               "4.93"               "3.63"              
## [151] "7.2"                "5.6"                "2.86"              
## [154] "5.75"               "13.15"              "23.22"             
## [157] "15.79"              "14.46"              "4.3099999999999996"
## [160] "14.5"               "6.78"               "7.3"               
## [163] "4.9000000000000004" "7.3."               "9.1999999999999993"
## [166] "12.63"              "12.43"              "18.2"              
## [169] "10.96"              "10.85"              "7.8"               
## [172] "5.56"               "6.49"               "6.5"               
## [175] "3.92"               "4.88"               "5.73"              
## [178] "11.88"              "7.13"               "4.6399999999999997"
## [181] "3.1"                "10.43"              "11.3"              
## [184] "15.55"              "11.86"              "9.43"              
## [187] "12.5"               "8.14"               "27"                
## [190] "5.29"               "5.57"               "6.92"              
## [193] "6.67"               "8.3800000000000008" "5.0999999999999996"
## [196] "6.64"               "5.86"               "7.33"              
## [199] "1.9"                "2"                  "1.2"               
## [202] "8.9"                "5.38"               "18.38"             
## [205] "16.8"               "10.1"               "4.71"              
## [208] "2.89"               "4.43"               "9.4"               
## [211] "11.71"              "3.55"               "4.5"               
## [214] "7.88"               "19.29"              "12.25"             
## [217] "4.13"               "7.79"               "16.5"              
## [220] "15.56"              "13.7"               "7.9"               
## [223] "9.44"               "12.3"               "12.9"              
## [226] "17.43"              "10.09"              "9.25"              
## [229] "4.4000000000000004" "7.14"               "8.4"               
## [232] "5.82"               "15.2"               "16.170000000000002"
## [235] "13.44"              "14.17"              "7.56"              
## [238] "10.17"              "11.57"              "21.46"             
## [241] "22.25"              "8.67"               "12.29"             
## [244] "22.5"               "7.67"               "4.75"              
## [247] "9.85"               "16.600000000000001" "14.21"             
## [250] "4.87"               "7.5"                "4.2"               
## [253] "4.57"               "6.98"               "1.08"              
## [256] "2.5"                "3.6"                "8.7100000000000009"
## [259] "11.2"               "15.17"              "5.17"              
## [262] "4.55"               "5.67"               "9.4499999999999993"
## [265] "14.89"              "14.77"              "9.86"              
## [268] "7.6"                "21.33"              "4.5999999999999996"
## [271] "8.56"               "10.89"              "30.5"
dat_fluency <- dat %>% 
  filter(Participant != "72")

dat_fluency$FluencySyllablesperMinute <- as.numeric(dat_fluency$FluencySyllablesperMinute) # Store values as numeric
is.numeric(dat_fluency$FluencySyllablesperMinute)
## [1] TRUE
hist(dat_fluency$FluencySyllablesperMinute) # Check the histogram of Fluency

Fit the model.

mod1flu1 <- lmer(FluencySyllablesperMinute ~ Genre * Complexity + (1|Participant), dat_fluency)
summary(mod1flu1)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: FluencySyllablesperMinute ~ Genre * Complexity + (1 | Participant)
##    Data: dat_fluency
## 
## REML criterion at convergence: 3396.6
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.1261 -0.5627 -0.0839  0.5210  5.9449 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 13.726   3.705   
##  Residual                 7.779   2.789   
## Number of obs: 628, groups:  Participant, 157
## 
## Fixed effects:
##                           Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                 9.4454     0.3701 280.8003  25.521  < 2e-16 ***
## GenreNAR                    0.3648     0.3148 468.0000   1.159 0.247123    
## ComplexitySIMPLE           -1.0564     0.3148 468.0000  -3.356 0.000856 ***
## GenreNAR:ComplexitySIMPLE   1.8588     0.4452 468.0000   4.175 3.55e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.425              
## CmplxSIMPLE -0.425  0.500       
## GNAR:CSIMPL  0.301 -0.707 -0.707

How about if I log-transform “FluencySyllablsperMinute”? Does it improve the residual distribution?

dat_fluency$FluencySyllablesperMinuteLog10 <- log10(dat_fluency$FluencySyllablesperMinute)
hist(dat_fluency$FluencySyllablesperMinuteLog10) 

mod1flu2 <- lmer(FluencySyllablesperMinuteLog10 ~ Genre * Complexity + (1|Participant), dat_fluency)
summary(mod1flu2)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## FluencySyllablesperMinuteLog10 ~ Genre * Complexity + (1 | Participant)
##    Data: dat_fluency
## 
## REML criterion at convergence: -393.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.7437 -0.4719  0.0520  0.5380  3.1832 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.02798  0.1673  
##  Residual                0.01851  0.1360  
## Number of obs: 628, groups:  Participant, 157
## 
## Fixed effects:
##                            Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)                 0.92116    0.01721 298.99637  53.531  < 2e-16 ***
## GenreNAR                    0.02275    0.01535 468.00000   1.482  0.13903    
## ComplexitySIMPLE           -0.04041    0.01535 468.00000  -2.632  0.00877 ** 
## GenreNAR:ComplexitySIMPLE   0.07086    0.02171 468.00000   3.263  0.00118 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.446              
## CmplxSIMPLE -0.446  0.500       
## GNAR:CSIMPL  0.315 -0.707 -0.707

… Doesn’t really improve the residual distribution.

Results:

  • Main effect of Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod1flu1)
##  model: FluencySyllablesperMinute ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX    SIMPLE
##   ARG 9.445414  8.389045
##   NAR 9.810191 10.612611
allEffects(mod1flu1) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Complexity significant: Changing Complexity from COMPLEX to SIMPLE reduces Fluency.
  • Interaction between Genre and Complexity significant: When Genre is NAR and Complexity is SIMPLE, the fluency is higher compared to when Genre is ARG and Complexity is COMPLEX.

2.2 RQ1b:

To what extent do individual differences moderate the effect of task complexity and genre on writing quality?

2.2.1 RQ1b(i): To what extent do individual differences moderate the effect of task complexity and genre on subordination?

summary(mod2sub) 
##  Family: nbinom2  ( log )
## Formula:          
## Subordination ~ 1 + Genre + Complexity + Genre:Complexity + StAnx +  
##     MotEng + Complexity:MotEng + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    1884.9    1925.0    -933.5    1866.9       623 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.4535   0.6734  
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom2 family (): 8.49e+07 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.44860    0.08217   5.459 4.79e-08 ***
## GenreNAR                  -0.27393    0.08600  -3.185 0.001447 ** 
## ComplexitySIMPLE          -0.08765    0.08186  -1.071 0.284251    
## StAnx                     -0.13551    0.06468  -2.095 0.036162 *  
## MotEng                     0.06554    0.07143   0.918 0.358866    
## GenreNAR:ComplexitySIMPLE -0.51452    0.13633  -3.774 0.000161 ***
## ComplexitySIMPLE:MotEng   -0.07113    0.06636  -1.072 0.283778    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Subordination ~ 1 + Genre + Complexity + Genre:Complexity + StAnx + (1 | Participant) is the best fitting model.
  • Main effect of Genre significant
  • Main effect of Stress Anxiety (StAnx) significant
  • Interaction between Genre and Complexity significant

Visualization

allEffects(mod2sub@model)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: Subordination ~ 1 + Genre + Complexity + Genre:Complexity + StAnx + 
##     MotEng + Complexity:MotEng
## 
##  StAnx effect
## StAnx
##       -2       -1      0.2        1        2 
## 1.506783 1.315823 1.118339 1.003438 0.876269 
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX    SIMPLE
##   ARG 1.565124 1.4345492
##   NAR 1.190093 0.6520681
## 
##  Complexity*MotEng effect
##           MotEng
## Complexity        -3        -1      0.2        2         3
##    COMPLEX 1.1217347 1.2788431 1.383482 1.556711 1.6621549
##    SIMPLE  0.9834796 0.9725508 0.966052 0.956385 0.9510563
allEffects(mod2sub@model) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre significant: When Genre is NAR, Subordination is lower compared to when Genre is ARG.
  • Main effect of Stress Anxiety (StAnx) significant: The higher the stress anxiety, the fewer the subordination
  • Interaction between Genre and Complexity significant: When Genre is NAR and Complexity is SIMPLE, Subordination is lower compared to when Genre is ARG and Complexity is COMPLEX.

2.2.2 RQ1b(ii): To what extent do individual differences moderate the effect of task complexity and genre on coordination?

summary(mod2coor)
##  Family: poisson  ( log )
## Formula:          
## Coordination ~ 1 + Genre + Complexity + Genre:Complexity + (1 |  
##     Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2311.4    2333.6   -1150.7    2301.4       627 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.4238   0.651   
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                0.57888    0.07732   7.487 7.07e-14 ***
## GenreNAR                   0.10216    0.07438   1.374    0.170    
## ComplexitySIMPLE           0.03989    0.07550   0.528    0.597    
## GenreNAR:ComplexitySIMPLE  0.04799    0.10358   0.463    0.643    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • Coordination ~ 1 + Genre + Complexity + Genre:Complexity + (1|Participant) is the best fitting model.
  • Nothing is significant

Visualization

allEffects(mod2coor@model)
##  model: Coordination ~ 1 + Genre + Complexity + Genre:Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 1.784031 1.856640
##   NAR 1.975920 2.157434
allEffects(mod2coor@model) %>% plot(multiline=TRUE)

Interpretation:

  • NAR seems to lead to more Coordination than ARG, but the effect is not statistically significant.
  • When Genre is NAR and Complexity is SIMPLE, it seems like the Coordination increases, but it’s not statistically significant.

2.2.3 RQ1b(iii): To what extent do individual differences moderate the effect of task complexity and genre on accuracy in number?

summary(mod2num)
##  Family: nbinom2  ( log )
## Formula:          AccuracyNumber ~ 1 + Genre + Complexity + Genre:Complexity +  
##     (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    1383.1    1409.8    -685.6    1371.1       626 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9376   0.9683  
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom2 family (): 1.91e+07 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)               -0.83913    0.13911  -6.032 1.62e-09 ***
## GenreNAR                   0.29725    0.12945   2.296   0.0217 *  
## ComplexitySIMPLE           0.06514    0.13647   0.477   0.6331    
## GenreNAR:ComplexitySIMPLE -0.34334    0.18762  -1.830   0.0673 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • AccuracyNumber ~ 1 + Genre + Complexity + Genre:Complexity + (1|Participant) is the best fitting model.
  • Main effect of Genre is significant.

Visualization

allEffects(mod2num@model)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyNumber ~ 1 + Genre + Complexity + Genre:Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.4320854 0.4611681
##   NAR 0.5816534 0.4403947
allEffects(mod2num@model) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre: Changing Genre from ARG to NAR leads to higher accuracy in number.

2.2.4 RQ1b(iv): To what extent do individual differences moderate the effect of task complexity and genre on accuracy in gender?

summary(mod2gen)
##  Family: nbinom2  ( log )
## Formula:          AccuracyGender ~ 1 + Genre + Complexity + Genre:Complexity +  
##     CogAnx + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2370.0    2401.2   -1178.0    2356.0       625 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.0122   0.1104  
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom2 family ():  4.7 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                1.09068    0.06071  17.966  < 2e-16 ***
## GenreNAR                  -0.45531    0.09042  -5.036 4.77e-07 ***
## ComplexitySIMPLE          -0.19521    0.08608  -2.268   0.0233 *  
## CogAnx                    -0.06905    0.03377  -2.045   0.0409 *  
## GenreNAR:ComplexitySIMPLE -0.08789    0.13370  -0.657   0.5109    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • AccuracyGender ~ 1 + Genre + Complexity + Genre:Complexity + CogAnx + (1|Participant) is the best fitting model.
  • Main effect of Genre is significant.
  • Main effect of Complexity is significant.
  • Main effect of Cognitive Anxiety (CogAnx) is significant.

Visualization

allEffects(mod2gen@model)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyGender ~ 1 + Genre + Complexity + Genre:Complexity + 
##     CogAnx
## 
##  CogAnx effect
## CogAnx
##       -3       -2     -0.6      0.8        2 
## 2.587304 2.414667 2.192155 1.990147 1.831880 
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 2.977639 2.449588
##   NAR 1.888580 1.422937
allEffects(mod2gen@model) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of Genre: Changing Genre from ARG to NAR leads to fewer gender accuracy.
  • Main effect of Complexity: Changing Complexity from COMPLEX to SIMPLE leads to fewer gender accuracy.
  • Main effect of Cognitive Anxiety (CogAnx) significant: The higher the cognitive anxiety, the less accurate in gender.

2.2.5 RQ1b(v): To what extent do individual differences moderate the effect of task complexity and genre on accuracy in tense?

summary(mod2ten)
##  Family: poisson  ( log )
## Formula:          
## AccuracyTense ~ 1 + Genre + Complexity + Genre:Complexity + AchievEng +  
##     RSPANpartial_WM + Complexity:RSPANpartial_WM + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##    2025.5    2061.0   -1004.7    2009.5       624 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.1537   0.392   
## Number of obs: 632, groups:  Participant, 158
## 
## Conditional model:
##                                   Estimate Std. Error z value Pr(>|z|)    
## (Intercept)                      -0.058328   0.162961  -0.358  0.72040    
## GenreNAR                          0.515165   0.093175   5.529 3.22e-08 ***
## ComplexitySIMPLE                  0.405024   0.190899   2.122  0.03387 *  
## AchievEng                         0.097013   0.044903   2.161  0.03073 *  
## RSPANpartial_WM                   0.007891   0.008731   0.904  0.36611    
## GenreNAR:ComplexitySIMPLE         0.059501   0.131958   0.451  0.65205    
## ComplexitySIMPLE:RSPANpartial_WM -0.027510   0.010137  -2.714  0.00665 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • AccuracyTense ~ 1 + Genre + Complexity + Genre:Complexity + AchievEng + RSPANpartial_WM + Complexity:RSPANpartial_WM + (1|Participant) is the best fitting model.
  • Main effect of Genre is significant.
  • Main effect of Complexity is significant.
  • Main effect of Achievement Engagement (AchievEng) is significant.
  • Interaction between Complexity and RSPANpartial_WM is significant

Visualization

allEffects(mod2ten@model)
##  model: AccuracyTense ~ 1 + Genre + Complexity + Genre:Complexity + AchievEng + 
##     RSPANpartial_WM + Complexity:RSPANpartial_WM
## 
##  AchievEng effect
## AchievEng
##       -3       -2     -0.1        1        3 
## 1.032751 1.137962 1.368292 1.522384 1.848368 
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 1.069620 1.034855
##   NAR 1.790453 1.838458
## 
##  Complexity*RSPANpartial_WM effect
##           RSPANpartial_WM
## Complexity        1       10       20       30        40
##    COMPLEX 1.230132 1.320671 1.429106 1.546445 1.6734178
##    SIMPLE  1.848521 1.549321 1.273322 1.046490 0.8600662
allEffects(mod2ten@model) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre significant: Changing Genre from ARG to NAR increases the accuracy in tense.
  • Main effect of Complexity significant: Changing Complexity from COMPLEX to SIMPLE increases the accuracy in tense
  • Main effect of AchievEng significant: Higher Achievement Engagement is associated with higher accuracy in tense
  • Interaction between Complexity and RSPANpartial_WM is significant: When Complexity is SIMPLE, the higher the working memory, the less accurate in tense.

2.2.6 RQ1b(vi): To what extent do individual differences moderate the effect of task complexity and genre on accuracy in aspect?

summary(mod2asp)
##  Family: nbinom1  ( log )
## Formula:          AccuracyAspect ~ 1 + Genre + Complexity + Genre:Complexity +  
##     RSPANpartial_WM + Genre:RSPANpartial_WM + (1 | Participant)
## Data: dat
## 
##       AIC       BIC    logLik -2*log(L)  df.resid 
##     801.5     837.1    -392.8     785.5       624 
## 
## Random effects:
## 
## Conditional model:
##  Groups      Name        Variance  Std.Dev. 
##  Participant (Intercept) 3.392e-09 5.824e-05
## Number of obs: 632, groups:  Participant, 158
## 
## Dispersion parameter for nbinom1 family (): 2.29 
## 
## Conditional model:
##                           Estimate Std. Error z value Pr(>|z|)   
## (Intercept)               -0.47424    0.88253  -0.537  0.59101   
## GenreNAR                   1.15366    0.91145   1.266  0.20560   
## ComplexitySIMPLE          -1.07390    0.83695  -1.283  0.19946   
## RSPANpartial_WM           -0.16776    0.07020  -2.390  0.01685 * 
## GenreNAR:ComplexitySIMPLE -2.56157    0.95276  -2.689  0.00718 **
## GenreNAR:RSPANpartial_WM   0.17744    0.07136   2.487  0.01290 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Results:

  • AccuracyAspect ~ 1 + Genre + Complexity + Genre:Complexity + RSPANpartial_WM + Genre:RSPANpartial_WM + (1|Participant) is the best fitting model.
  • Main effect of RSPANpartial_WM is significant.
  • Interaction between Genre and Complexity is significant
  • Interaction between Genre and RSPANpartial_WM is significant

Visualization

allEffects(mod2asp@model)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
##  model: AccuracyAspect ~ 1 + Genre + Complexity + Genre:Complexity + 
##     RSPANpartial_WM + Genre:RSPANpartial_WM
## 
##  Genre*Complexity effect
##      Complexity
## Genre    COMPLEX     SIMPLE
##   ARG 0.04303864 0.01470518
##   NAR 2.30142106 0.06069220
## 
##  Genre*RSPANpartial_WM effect
##      RSPANpartial_WM
## Genre         1         10         20          30           40
##   ARG 0.3076006 0.06796314 0.01269704 0.002372093 0.0004431604
##   NAR 0.3234733 0.35291133 0.38877268 0.428278106 0.4717979054
allEffects(mod2asp@model) %>% plot(multiline=TRUE)
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect
## Warning in Effect.glmmTMB(predictors, mod, vcov. = vcov., ...): overriding
## variance function for effects/dev.resids: computed variances may be incorrect

Interpretation:

  • Main effect of RSPANpartial_WM: The higher the WM, the less accurate in aspect.
  • Interaction between Genre and Complexity: When Genre is NAR and Complexity is SIMPLE, the accuracy in aspect is lower compared to ARG and COMPLEX
  • Interaction between Genre and RSPANpartial_WM: When Genre is NAR, higher WM is associated with higher accuracy in aspect.

2.2.7 RQ1b(vii): To what extent do individual differences moderate the effect of task complexity and genre on lexical density?

summary(mod2den)
## Linear mixed model fit by maximum likelihood (p-values based on Wald  z-scores)
##  [lmerMod]
## Formula: LexicalDensity ~ 1 + Genre + Complexity + Genre:Complexity +  
##     (1 | Participant)
##    Data: dat_density
## 
##      AIC      BIC   logLik deviance df.resid 
##  -1119.3  -1092.7    565.7  -1131.3      622 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.0965 -0.5662  0.0441  0.4970  3.5040 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.013834 0.1176  
##  Residual                0.005241 0.0724  
## Number of obs: 628, groups:  Participant, 157
## 
## Fixed effects:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                0.524925   0.011023  47.623   <2e-16 ***
## GenreNAR                   0.012968   0.008171   1.587    0.112    
## ComplexitySIMPLE          -0.017729   0.008171  -2.170    0.030 *  
## GenreNAR:ComplexitySIMPLE -0.012870   0.011556  -1.114    0.265    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.371              
## CmplxSIMPLE -0.371  0.500       
## GNAR:CSIMPL  0.262 -0.707 -0.707

Note:

  • Some caution for interpretation necessary because the assumptions are not met.

Results:

  • LexicalDensity ~ 1 + Genre + Complexity + Genre:Complexity + (1|Participant) is the best-fitting model
  • Main effect of Complexity is significant.

Visualization

allEffects(mod2den@model)
##  model: LexicalDensity ~ 1 + Genre + Complexity + Genre:Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.5249255 0.5071968
##   NAR 0.5378936 0.5072954
allEffects(mod2den@model) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Complexity: When Complexity is SIMPLE, lexical density is lower compared to COMPLEX.

2.2.8 RQ1b(viii): To what extent do individual differences moderate the effect of task complexity and genre on lexical diversity?

summary(mod2diversity)
## Linear mixed model fit by maximum likelihood (p-values based on Wald  z-scores)
##  [lmerMod]
## Formula: LexicalDiversity ~ 1 + Genre + Complexity + Genre:Complexity +  
##     (1 | Participant)
##    Data: dat_diversity
## 
##      AIC      BIC   logLik deviance df.resid 
##   -890.2   -863.6    451.1   -902.2      618 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.2812 -0.4824  0.0283  0.4847  3.4035 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.011668 0.10802 
##  Residual                0.008678 0.09316 
## Number of obs: 624, groups:  Participant, 156
## 
## Fixed effects:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                0.62803    0.01142  54.992   <2e-16 ***
## GenreNAR                   0.03443    0.01055   3.264   0.0011 ** 
## ComplexitySIMPLE          -0.01341    0.01055  -1.271   0.2036    
## GenreNAR:ComplexitySIMPLE -0.01646    0.01492  -1.103   0.2699    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.462              
## CmplxSIMPLE -0.462  0.500       
## GNAR:CSIMPL  0.327 -0.707 -0.707

Note:

Some caution for interpretation necessary because the assumptions are not met.

Results:

  • LexicalDiversity ~ 1 + Genre + Complexity + Genre:Complexity + (1|Participant) is the best-fitting model
  • Main effect of Genre is significant.

Visualization

allEffects(mod2diversity@model)
##  model: LexicalDiversity ~ 1 + Genre + Complexity + Genre:Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.6280340 0.6146231
##   NAR 0.6624673 0.6325974
allEffects(mod2diversity@model) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre: When Genre is NAR, lexical diversity is higher compared to when Genre is ARG.

2.2.9 RQ1b(ix): To what extent do individual differences moderate the effect of task complexity and genre on fluency?

summary(mod2flu)
## Linear mixed model fit by maximum likelihood (p-values based on Wald  z-scores)
##  [lmerMod]
## Formula: 
## FluencySyllablesperMinuteLog10 ~ 1 + Genre + Complexity + Genre:Complexity +  
##     (1 | Participant)
##    Data: dat_fluency
## 
##      AIC      BIC   logLik deviance df.resid 
##   -408.7   -382.1    210.4   -420.7      622 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.7589 -0.4734  0.0521  0.5397  3.1934 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.02781  0.1668  
##  Residual                0.01839  0.1356  
## Number of obs: 628, groups:  Participant, 157
## 
## Fixed effects:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                0.92116    0.01715  53.702  < 2e-16 ***
## GenreNAR                   0.02275    0.01531   1.487  0.13710    
## ComplexitySIMPLE          -0.04041    0.01531  -2.641  0.00828 ** 
## GenreNAR:ComplexitySIMPLE  0.07086    0.02164   3.274  0.00106 ** 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.446              
## CmplxSIMPLE -0.446  0.500       
## GNAR:CSIMPL  0.315 -0.707 -0.707

Note:

Some caution for interpretation necessary because the assumptions are not met.

Results:

  • FluencySyllablesperMinuteLog10 ~ 1 + Genre + Complexity + Genre:Complexity + (1|Participant) is the best fitting model.
  • Main effect of Complexity is significant.
  • Interaction between Genre and Complexity is significant.

Visualization

allEffects(mod2flu@model)
##  model: FluencySyllablesperMinuteLog10 ~ 1 + Genre + Complexity + Genre:Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre   COMPLEX    SIMPLE
##   ARG 0.9211617 0.8807485
##   NAR 0.9439152 0.9743591
allEffects(mod2flu@model) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Complexity: When Complexity is SIMPLE, fluency is lower compared to when Complexity is COMPLEX.
  • Interaction between Genre and Complexity: When Genre is NAR and Complexity is SIMPLE, the fluency is higher compared to when Genre is ARG and Complexity is COMPLEX.

2.3 RQ2a:

How does altering task complexity and genre — specifically argumentative and narrative — influence the perceived difficulty of a task in L2 writing?

hist(dat$PTD_composite) # Check the histogram of PTD

Fit the model.

mod2PTD <- lmer(PTD_composite ~ Genre * Complexity + (1|Participant), dat)
summary(mod2PTD)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: PTD_composite ~ Genre * Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2074.3
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7069 -0.5831  0.0497  0.6775  3.3679 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9409   0.970   
##  Residual                1.0545   1.027   
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                           Estimate Std. Error       df t value Pr(>|t|)    
## (Intercept)                 5.5016     0.1124 376.7217  48.955  < 2e-16 ***
## GenreNAR                    1.1630     0.1155 471.0000  10.066  < 2e-16 ***
## ComplexitySIMPLE            0.2911     0.1155 471.0000   2.520   0.0121 *  
## GenreNAR:ComplexitySIMPLE  -1.1108     0.1634 471.0000  -6.798 3.22e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CSIMPL
## GenreNAR    -0.514              
## CmplxSIMPLE -0.514  0.500       
## GNAR:CSIMPL  0.363 -0.707 -0.707

Note:

Some caution for interpretation necessary because the assumptions are not met.

Results:

  • Main effect of Genre significant.
  • Main effect of Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2PTD)
##  model: PTD_composite ~ Genre * Complexity
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
allEffects(mod2PTD) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre: When Genre is NAR, PTD is higher compared to when Genre is ARG.
  • Main effect of Complexity: When Complexity is SIMPLE, PTD is higher compared to when Complexity is COMPLEX.
  • Interaction between Genre and Complexity: When Genre is NAR and Complexity is SIMPLE, PTD is lower compared to when Genre is ARG and Complexity is Complex.

2.4 RQ2b:

How do individual learner differences, such as working memory, motivation, and anxiety, moderate the relationship between task complexity, genre, and perceived task difficulty??

2.4.1 Method 1: Buildmer

summary(mod2b)
## Linear mixed model fit by maximum likelihood (p-values based on Wald  z-scores)
##  [lmerMod]
## Formula: PTD_composite ~ 1 + Genre + Complexity + Genre:Complexity + CogAnx +  
##     Complexity:CogAnx + (1 | Participant)
##    Data: dat
## 
##      AIC      BIC   logLik deviance df.resid 
##   2073.3   2108.9  -1028.6   2057.3      624 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7445 -0.5777  0.0543  0.6690  3.3456 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9366   0.9678  
##  Residual                1.0354   1.0175  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                           Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                5.50120    0.11172  49.241  < 2e-16 ***
## GenreNAR                   1.16297    0.11448  10.159  < 2e-16 ***
## ComplexitySIMPLE           0.29239    0.11448   2.554   0.0106 *  
## CogAnx                    -0.05840    0.09598  -0.608   0.5429    
## GenreNAR:ComplexitySIMPLE -1.11076    0.16190  -6.861 6.86e-12 ***
## ComplexitySIMPLE:CogAnx    0.19342    0.08099   2.388   0.0169 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) GnrNAR CmSIMPLE CogAnx GNAR:C
## GenreNAR    -0.512                              
## CmplxSIMPLE -0.512  0.500                       
## CogAnx       0.006  0.000 -0.002                
## GNAR:CSIMPL  0.362 -0.707 -0.707    0.000       
## CmSIMPLE:CA -0.002  0.000  0.005   -0.422  0.000

Results:

  • PTD_composite ~ 1 + Genre + Complexity + Genre:Complexity + CogAnx + Complexity:CogAnx + (1|Participant) is the best-fitting model.
  • Main effect of Genre is significant
  • Main effect of Complexity is significant
  • Interaction between Genre and Complexity is significant
  • Interaction between Complexity and Cognitive Anxiety (CogAnx) is significant

Visualization

allEffects(mod2b@model)
##  model: PTD_composite ~ 1 + Genre + Complexity + Genre:Complexity + CogAnx + 
##     Complexity:CogAnx
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
## 
##  Complexity*CogAnx effect
##           CogAnx
## Complexity       -3       -2     -0.6      0.8        2
##    COMPLEX 6.257898 6.199496 6.117733 6.035969 5.965886
##    SIMPLE  5.414661 5.549675 5.738696 5.927716 6.089733
allEffects(mod2b@model) %>% plot(multiline=TRUE)

Interpretation:

  • Main effect of Genre: Changing Genre to NAR leads to an increase in PTD by 1.16.
  • Main effect of Complexity: Changing Complexity to Simple leads to an increase in PTD by 0.29.
  • Interaction between Genre and Complexity is significant: When Genre is NAR and Complexity is SIMPLE, there is a decrease in PTD by -1.11 compared to when Genre is ARG and Complexity is COMPLEX.
  • Interaction between Complexity and Cognitive Anxiety (CogAnx): When Complexity is SIMPLE, a one-SD increase in CogAnx is associated with an increase in PTD by 0.19.

2.4.2 Method 2: Checking the moderation of individual differences, one by one.

2.4.2.1 RQ2b(i): Effect of Task Complexity and Genre moderated by Achievement Engagement

How does the effect of altering task complexity and genre — specifically argumentative and narrative — influence on the perceived difficulty of a task in L2 writing, moderated by Achievement Engagement?

Fit the model.

mod2eng <- lmer(PTD_composite ~ AchievEng * Genre + AchievEng * Complexity + Genre * Complexity + (1|Participant), dat)
summary(mod2eng)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: PTD_composite ~ AchievEng * Genre + AchievEng * Complexity +  
##     Genre * Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2083.4
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6987 -0.5918  0.0383  0.6744  3.3741 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9477   0.9735  
##  Residual                1.0582   1.0287  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                             Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)                  5.50159    0.11268 373.84119  48.827  < 2e-16 ***
## AchievEng                    0.03466    0.10469 302.71935   0.331   0.7408    
## GenreNAR                     1.16297    0.11574 469.00000  10.048  < 2e-16 ***
## ComplexitySIMPLE             0.29113    0.11574 469.00000   2.515   0.0122 *  
## AchievEng:GenreNAR          -0.01565    0.08161 469.00000  -0.192   0.8481    
## AchievEng:ComplexitySIMPLE  -0.04570    0.08161 469.00000  -0.560   0.5758    
## GenreNAR:ComplexitySIMPLE   -1.11076    0.16368 469.00000  -6.786 3.49e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) AchvEn GnrNAR CSIMPL AE:GNA AE:CSI
## AchievEng    0.000                                   
## GenreNAR    -0.514  0.000                            
## CmplxSIMPLE -0.514  0.000  0.500                     
## AchvEn:GNAR  0.000 -0.390  0.000  0.000              
## AcE:CSIMPLE  0.000 -0.390  0.000  0.000  0.000       
## GNAR:CSIMPL  0.363  0.000 -0.707 -0.707  0.000  0.000

Results:

  • Main effect of Genre significant.
  • Main effect of Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2eng)
##  model: PTD_composite ~ AchievEng * Genre + AchievEng * Complexity + 
##     Genre * Complexity
## 
##  AchievEng*Genre effect
##          Genre
## AchievEng      ARG      NAR
##      -3   5.611713 6.266240
##      -2   5.623527 6.262408
##      -0.1 5.645973 6.255129
##      1    5.658969 6.250915
##      3    5.682597 6.243252
## 
##  AchievEng*Complexity effect
##          Complexity
## AchievEng  COMPLEX   SIMPLE
##      -3   6.002556 5.875396
##      -2   6.029396 5.856539
##      -0.1 6.080392 5.820710
##      1    6.109916 5.799967
##      3    6.163596 5.762252
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
allEffects(mod2eng) %>% plot(multiline=TRUE)

2.4.2.2 RQ2a(ii): Effect of Task Complexity and Genre moderated by Motivation Engagement

How does the effect of altering task complexity and genre — specifically argumentative and narrative — influence on the perceived difficulty of a task in L2 writing, moderated by Motivation Engagement?

Fit the model.

mod2mot <- lmer(PTD_composite ~ MotEng * Genre + MotEng * Complexity + Genre * Complexity + (1|Participant), dat)
summary(mod2mot)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: PTD_composite ~ MotEng * Genre + MotEng * Complexity + Genre *  
##     Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2078.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7270 -0.5800  0.0550  0.6482  3.2352 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9382   0.9686  
##  Residual                1.0507   1.0250  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                             Estimate Std. Error         df t value Pr(>|t|)    
## (Intercept)                 5.501621   0.112200 374.297362  49.034  < 2e-16 ***
## MotEng                      0.005166   0.104724 303.055389   0.049   0.9607    
## GenreNAR                    1.162124   0.115328 469.000001  10.077  < 2e-16 ***
## ComplexitySIMPLE            0.290300   0.115328 469.000001   2.517   0.0122 *  
## MotEng:GenreNAR            -0.112047   0.081703 469.000001  -1.371   0.1709    
## MotEng:ComplexitySIMPLE    -0.110539   0.081703 469.000001  -1.353   0.1767    
## GenreNAR:ComplexitySIMPLE  -1.110759   0.163096 469.000001  -6.810 2.99e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) MotEng GnrNAR CSIMPL ME:GNA ME:CSI
## MotEng       0.007                                   
## GenreNAR    -0.514 -0.002                            
## CmplxSIMPLE -0.514 -0.002  0.500                     
## MtEng:GnNAR -0.003 -0.390  0.005  0.000              
## MtE:CSIMPLE -0.003 -0.390  0.000  0.005  0.000       
## GNAR:CSIMPL  0.363  0.000 -0.707 -0.707  0.000  0.000

Results:

  • Main effect of Genre significant.
  • Main effect of Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2mot)
##  model: PTD_composite ~ MotEng * Genre + MotEng * Complexity + Genre * 
##     Complexity
## 
##  MotEng*Genre effect
##       Genre
## MotEng      ARG      NAR
##    -3  5.797082 6.739966
##    -1  5.696875 6.415666
##    0.2 5.636751 6.221086
##    2   5.546565 5.929216
##    3   5.496462 5.767067
## 
##  MotEng*Complexity effect
##       Complexity
## MotEng  COMPLEX   SIMPLE
##    -3  6.235255 6.301793
##    -1  6.133541 5.979001
##    0.2 6.072512 5.785325
##    2   5.980969 5.494812
##    3   5.930112 5.333416
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
allEffects(mod2mot) %>% plot(multiline=TRUE)

2.4.2.3 RQ2a(iii): Effect of Task Complexity and Genre moderated by Stress Anxiety

How does the effect of altering task complexity and genre — specifically argumentative and narrative — influence on the perceived difficulty of a task in L2 writing, moderated by Stress Anxiety?

Fit the model.

mod2stanx <- lmer(PTD_composite ~ StAnx * Genre * Complexity + (1|Participant), dat)
summary(mod2stanx)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: PTD_composite ~ StAnx * Genre * Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2084
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.6879 -0.5868  0.0479  0.6780  3.2630 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9381   0.9686  
##  Residual                1.0606   1.0299  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                                  Estimate Std. Error        df t value Pr(>|t|)
## (Intercept)                       5.50152    0.11247 375.70097  48.914  < 2e-16
## StAnx                             0.06586    0.11215 375.70097   0.587   0.5574
## GenreNAR                          1.16295    0.11587 468.00000  10.037  < 2e-16
## ComplexitySIMPLE                  0.29111    0.11587 468.00000   2.512   0.0123
## StAnx:GenreNAR                    0.02532    0.11554 468.00000   0.219   0.8266
## StAnx:ComplexitySIMPLE            0.02413    0.11554 468.00000   0.209   0.8347
## GenreNAR:ComplexitySIMPLE        -1.11077    0.16386 468.00000  -6.779 3.66e-11
## StAnx:GenreNAR:ComplexitySIMPLE   0.01301    0.16339 468.00000   0.080   0.9366
##                                    
## (Intercept)                     ***
## StAnx                              
## GenreNAR                        ***
## ComplexitySIMPLE                *  
## StAnx:GenreNAR                     
## StAnx:ComplexitySIMPLE             
## GenreNAR:ComplexitySIMPLE       ***
## StAnx:GenreNAR:ComplexitySIMPLE    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) StAnx  GnrNAR CSIMPL StA:GNAR SA:CSI GNAR:C
## StAnx       -0.001                                            
## GenreNAR    -0.515  0.001                                     
## CmplxSIMPLE -0.515  0.001  0.500                              
## StAnx:GnNAR  0.001 -0.515 -0.001 -0.001                       
## StA:CSIMPLE  0.001 -0.515 -0.001 -0.001  0.500                
## GNAR:CSIMPL  0.364  0.000 -0.707 -0.707  0.001    0.001       
## SA:GNAR:CSI  0.000  0.364  0.001  0.001 -0.707   -0.707 -0.001

Results:

  • Main effect of Genre significant.
  • Main effect of Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2stanx)
##  model: PTD_composite ~ StAnx * Genre * Complexity
## 
##  StAnx*Genre*Complexity effect
## , , Complexity = COMPLEX
## 
##      Genre
## StAnx      ARG      NAR
##   -2  5.369787 6.482092
##   -1  5.435652 6.573278
##   0.2 5.514689 6.682702
##   1   5.567380 6.755651
##   2   5.633244 6.846838
## 
## , , Complexity = SIMPLE
## 
##      Genre
## StAnx      ARG      NAR
##   -2  5.612645 5.588154
##   -1  5.702638 5.716481
##   0.2 5.810629 5.870472
##   1   5.882623 5.973133
##   2   5.972616 6.101460
allEffects(mod2stanx) %>% plot(multiline=TRUE)

2.4.2.4 RQ2b(iv): Effect of Task Complexity and Genre moderated by Cognitive Anxiety

How does the effect of altering task complexity and genre — specifically argumentative and narrative — influence on the perceived difficulty of a task in L2 writing, moderated by Cognitive Anxiety?

Fit the model.

mod2coganx <- lmer(PTD_composite ~ CogAnx * Genre + CogAnx * Complexity + Genre * Complexity + (1|Participant), dat)
summary(mod2coganx)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: PTD_composite ~ CogAnx * Genre + CogAnx * Complexity + Genre *  
##     Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2077.5
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7338 -0.5508  0.0559  0.6591  3.3172 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9494   0.9743  
##  Residual                1.0457   1.0226  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                            Estimate Std. Error        df t value Pr(>|t|)    
## (Intercept)                 5.50105    0.11237 371.67356  48.954  < 2e-16 ***
## CogAnx                     -0.08208    0.10479 301.14097  -0.783   0.4341    
## GenreNAR                    1.16328    0.11505 469.00000  10.111  < 2e-16 ***
## ComplexitySIMPLE            0.29239    0.11505 469.00000   2.541   0.0114 *  
## CogAnx:GenreNAR             0.04735    0.08139 469.00000   0.582   0.5610    
## CogAnx:ComplexitySIMPLE     0.19342    0.08139 469.00000   2.377   0.0179 *  
## GenreNAR:ComplexitySIMPLE  -1.11076    0.16271 469.00000  -6.827  2.7e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) CogAnx GnrNAR CSIMPL CA:GNA CA:CSI
## CogAnx       0.006                                   
## GenreNAR    -0.512 -0.002                            
## CmplxSIMPLE -0.512 -0.002  0.500                     
## CgAnx:GnNAR -0.002 -0.388  0.005  0.000              
## CgA:CSIMPLE -0.002 -0.388  0.000  0.005  0.000       
## GNAR:CSIMPL  0.362  0.000 -0.707 -0.707  0.000  0.000

Results:

  • Main effect of Genre significant.
  • Main effect of Complexity significant.
  • Interaction between Cognitive Anxiety and Complexity significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2coganx)
##  model: PTD_composite ~ CogAnx * Genre + CogAnx * Complexity + Genre * 
##     Complexity
## 
##  CogAnx*Genre effect
##       Genre
## CogAnx      ARG      NAR
##   -3   5.603356 6.069203
##   -2   5.617987 6.131185
##   -0.6 5.638469 6.217959
##   0.8  5.658951 6.304734
##   2    5.676507 6.379112
## 
##  CogAnx*Complexity effect
##       Complexity
## CogAnx  COMPLEX   SIMPLE
##   -3   6.257898 5.414661
##   -2   6.199496 5.549675
##   -0.6 6.117733 5.738696
##   0.8  6.035969 5.927716
##   2    5.965886 6.089733
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
allEffects(mod2coganx) %>% plot(multiline=TRUE)

2.4.2.5 RQ2b(vi): Effect of Task Complexity and Genre moderated by Working Memory

How does the effect of altering task complexity and genre — specifically argumentative and narrative — influence on the perceived difficulty of a task in L2 writing, moderated by Reading Span Working Memory?

Fit the model.

mod2wm <- lmer(PTD_composite ~ RSPANpartial_WM * Genre + RSPANpartial_WM * Complexity + Genre * Complexity + (1|Participant), dat)
summary(mod2wm)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## PTD_composite ~ RSPANpartial_WM * Genre + RSPANpartial_WM * Complexity +  
##     Genre * Complexity + (1 | Participant)
##    Data: dat
## 
## REML criterion at convergence: 2091.8
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -2.7094 -0.5719  0.0289  0.6720  3.3715 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  Participant (Intercept) 0.9477   0.9735  
##  Residual                1.0528   1.0260  
## Number of obs: 632, groups:  Participant, 158
## 
## Fixed effects:
##                                    Estimate Std. Error         df t value
## (Intercept)                        5.615343   0.288526 312.009939  19.462
## RSPANpartial_WM                   -0.007144   0.016684 302.117094  -0.428
## GenreNAR                           0.898472   0.236855 469.000002   3.793
## ComplexitySIMPLE                   0.513236   0.236855 469.000002   2.167
## RSPANpartial_WM:GenreNAR           0.016610   0.012988 469.000002   1.279
## RSPANpartial_WM:ComplexitySIMPLE  -0.013947   0.012988 469.000002  -1.074
## GenreNAR:ComplexitySIMPLE         -1.110759   0.163256 469.000002  -6.804
##                                  Pr(>|t|)    
## (Intercept)                       < 2e-16 ***
## RSPANpartial_WM                  0.668819    
## GenreNAR                         0.000168 ***
## ComplexitySIMPLE                 0.030747 *  
## RSPANpartial_WM:GenreNAR         0.201561    
## RSPANpartial_WM:ComplexitySIMPLE 0.283434    
## GenreNAR:ComplexitySIMPLE        3.12e-11 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) RSPANp_WM GnrNAR CSIMPL RSPAN_WM:G RSPAN_WM:C
## RSPANprt_WM -0.921                                              
## GenreNAR    -0.410  0.340                                       
## CmplxSIMPLE -0.410  0.340     0.119                             
## RSPAN_WM:GN  0.358 -0.389    -0.873  0.000                      
## RSPAN_WM:CS  0.358 -0.389     0.000 -0.873  0.000               
## GNAR:CSIMPL  0.141  0.000    -0.345 -0.345  0.000      0.000

Results:

  • Main effect of Genre significant.
  • Interaction between Genre and Complexity significant.

Visualization

allEffects(mod2wm)
##  model: PTD_composite ~ RSPANpartial_WM * Genre + RSPANpartial_WM * Complexity + 
##     Genre * Complexity
## 
##  RSPANpartial_WM*Genre effect
##                Genre
## RSPANpartial_WM      ARG      NAR
##              1  5.857844 6.217546
##              10 5.730785 6.239980
##              20 5.589609 6.264907
##              30 5.448433 6.289834
##              40 5.307257 6.314760
## 
##  RSPANpartial_WM*Complexity effect
##                Complexity
## RSPANpartial_WM  COMPLEX   SIMPLE
##              1  6.065741 6.009649
##              10 6.076191 5.894574
##              20 6.087802 5.766714
##              30 6.099414 5.638853
##              40 6.111025 5.510992
## 
##  Genre*Complexity effect
##      Complexity
## Genre  COMPLEX   SIMPLE
##   ARG 5.501582 5.792722
##   NAR 6.664557 5.844937
allEffects(mod2wm) %>% plot(multiline=TRUE)

2.5 Buildmer …. code template

# mod1sub_trunc_nbinom_BM <- buildglmmTMB(formula = Subordination ~ Genre * Complexity + 
#                                MotEng * Genre + 
#                                MotEng * Complexity + 
#                                AchievEng * Genre + 
#                                AchievEng * Complexity + 
#                                StAnx * Genre + 
#                                CogAnx * Complexity + 
#                                RSPANpartial_WM * Genre + 
#                                RSPANpartial_WM * Complexity + 
#                                (1|Participant), 
#                                data = dat,
#                              family = truncated_nbinom2,
#                              buildmerControl(cl = 6, 
#                              include = ~ Genre * Complexity + (1|Participant)))
# summary(mod1sub_trunc_nbinom_BM)
# allEffects(mod1sub_trunc_nbinom_BM@model)
# allEffects(mod1sub_trunc_nbinom_BM@model) %>% plot(multiline=TRUE)
# 
# 
# mod1coor_trunc_nbinom_BM <- buildglmmTMB(formula = Coordination ~ Genre * Complexity +
#                                MotEng * Genre + 
#                                MotEng * Complexity + 
#                                AchievEng * Genre + 
#                                AchievEng * Complexity + 
#                                StAnx * Genre + 
#                                CogAnx * Complexity + 
#                                RSPANpartial_WM * Genre + 
#                                RSPANpartial_WM * Complexity + 
#                                (1|Participant), 
#                                data = dat,
#                              family = ,
#                              buildmerControl(cl = 6, 
#                              include = ~ Genre * Complexity + (1|Participant)))
# summary(mod1sub_trunc_nbinom_BM)
# allEffects(mod1sub_trunc_nbinom_BM@model)
# allEffects(mod1sub_trunc_nbinom_BM@model) %>% plot(multiline=TRUE)
# 




# mod1sub_trunc_poisson <- glmmTMB(Subordination ~ Genre * Complexity + (1|Participant), family = truncated_poisson, dat)

# mod1sub_trunc_nbinom <- glmmTMB(Subordination ~ Genre * Complexity + (1|Participant), family = truncated_nbinom2, dat)
#summary(mod1sub_trunc_poisson)
#summary(mod1sub_trunc_nbinom)


# allEffects(mod1sub_trunc_poisson)
# allEffects(mod1sub_trunc_poisson) %>% plot(multiline=TRUE)
# 
# allEffects(mod1sub_trunc_nbinom)
# allEffects(mod1sub_trunc_nbinom) %>% plot(multiline=TRUE)