# threefactors

#### 2024-05-27

version of R:4.3.2 version of Rstudio: 2023.12.0+369

We run the models for each dependent variables (on FFD,SFD,GD,TRT,RPD) in the following order:

Full_mdoel=lmer(depvar~ group * readingmode* predictability+(1+readingmode* predictability|pp)+(1+group* readingmodepredictability|item), datafile) model=lmer(depvar~group readingmode* predictability+(1+readingmode*predictability|pp)+(1|item), datafile)

model=lmer(depvar~group* readingmode* predictability+(0+readingmode*predictability|pp)+(1|item), datafile)

model=lmer(depvar~group* readingmode*predictability+(1+readingmode+predictability|pp)+(1|item), datafile)

model=lmer(depvar~group* readingmode*predictability+(0+readingmode+predictability|pp)+(1|item), datafile)

model=lmer(depvar ~group* readingmode*predictability+ (1+readingmode|pp) + (1|item), datafile)

model=lmer(depvar ~group* readingmode*predictability+ (0+readingmode|pp) + (1|item), datafile)

model=lmer(depvar ~group* readingmode*predictability+ (1+predictability|pp) + (1|item), datafile)

model=lmer(depvar ~group* readingmode*predictability+ (0+predictability|pp) + (1|item), datafile)

model=lmer(depvar ~group* readingmode*predictability+ (1|pp) + (1|item), datafile)

Only the model that successfully converged for each dependent variables was retained.

    library(lmerTest) # version 3.1-3

    ## 载入需要的程序包：lme4

    ## 载入需要的程序包：Matrix

    ##
    ## 载入程序包：'lmerTest'

    ## The following object is masked from 'package:lme4':
    ##
    ##     lmer

    ## The following object is masked from 'package:stats':
    ##
    ##     step

    library(lattice)  # version 0.21-9
    library(MASS)     # version 7.3-60
    library(plyr)     # version 1.8.9
    library(plotrix)  # version 3.8-4

    rm(list=ls())
    datafile0 = read.csv("threefactors.csv", sep = ",", dec = ".")
    datafile <- datafile0
    colnames(datafile)

    ##  [1] "pp"             "item"           "group"          "readingmode"
    ##  [5] "predictability" "rm_pred"        "group_rm"       "group_pred"
    ##  [9] "condition"      "TRT"            "IA_SKIP"        "FFD"
    ## [13] "SFD"            "GD"             "RPD"            "accuracy"
    ## [17] "ifquestion"

    nrow(datafile)

    ## [1] 5472

    datafile$pp = datafile[,1]
    datafile$item = datafile[,2]
    datafile$group = datafile[,3]
    datafile$readingmode = datafile[,4]
    datafile$predictability = datafile[,5]
    datafile$rm_pred=datafile[,6]
    datafile$group_rm=datafile[,7]
    datafile$group_pred=datafile[,8]
    datafile$condition = datafile[,9]
    datafile$pp = as.factor(datafile$pp)
    datafile$item = as.factor(datafile$item)
    datafile$group = factor(datafile$group, levels = c("K","M"))
    datafile$readingmode = factor(datafile$readingmode, levels = c("S","A"))
    datafile$predictability = factor(datafile$predictability, levels = c("H","L"))
    datafile$rm_pred = factor(datafile$rm_pred, levels = c("SH","SL","AH","AL"))
    datafile$group_rm=factor(datafile$group_rm,levels=c("KS","KA","MS","MA"))
    datafile$group_pred=factor(datafile$group_pred,levels=c("KH","KL","MH","ML"))
    datafile$condition=factor(datafile$condition, levels=c("KSH","KSL","KAH","KAL","MSH","MSL","MAH","MAL"))

# FOR ACCURACY

    measure = "accuracy"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## regression analysis for accuracy

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_accuracy = glm(depvar~group*readingmode*predictability,datafile,family=binomial)
    summary(model_accuracy)

    ##
    ## Call:
    ## glm(formula = depvar ~ group * readingmode * predictability,
    ##     family = binomial, data = datafile)
    ##
    ## Coefficients:
    ##                                           Estimate Std. Error z value Pr(>|z|)
    ## (Intercept)                                 3.1037     0.1652  18.791   <2e-16
    ## group2-1                                   -0.3085     0.3303  -0.934   0.3504
    ## readingmode2-1                             -0.3503     0.3303  -1.060   0.2890
    ## predictability2-1                          -0.1843     0.3303  -0.558   0.5770
    ## group2-1:readingmode2-1                     1.1544     0.6607   1.747   0.0806
    ## group2-1:predictability2-1                  0.8788     0.6607   1.330   0.1835
    ## readingmode2-1:predictability2-1           -0.1852     0.6607  -0.280   0.7792
    ## group2-1:readingmode2-1:predictability2-1   2.1887     1.3213   1.656   0.0976
    ##
    ## (Intercept)                               ***
    ## group2-1
    ## readingmode2-1
    ## predictability2-1
    ## group2-1:readingmode2-1                   .
    ## group2-1:predictability2-1
    ## readingmode2-1:predictability2-1
    ## group2-1:readingmode2-1:predictability2-1 .
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    ##
    ## (Dispersion parameter for binomial family taken to be 1)
    ##
    ##     Null deviance: 384.67  on 994  degrees of freedom
    ## Residual deviance: 371.62  on 987  degrees of freedom
    ##   (因为不存在，4477个观察量被删除了)
    ## AIC: 387.62
    ##
    ## Number of Fisher Scoring iterations: 6

# FOR IA_SKIP RATE

    measure = "IA_SKIP"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for skipping rate

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_SKIP=glmer(depvar ~ group*readingmode*predictability + (1|pp)+ (1|item),
                         datafile, family=binomial, control=glmerControl(optimizer="Nelder_Mead",optCtrl = list(maxfun = 200000)))
    summary(model_SKIP)

    ## Generalized linear mixed model fit by maximum likelihood (Laplace
    ##   Approximation) [glmerMod]
    ##  Family: binomial  ( logit )
    ## Formula: depvar ~ group * readingmode * predictability + (1 | pp) + (1 |
    ##     item)
    ##    Data: datafile
    ## Control:
    ## glmerControl(optimizer = "Nelder_Mead", optCtrl = list(maxfun = 2e+05))
    ##
    ##      AIC      BIC   logLik deviance df.resid
    ##   5269.1   5335.1  -2624.5   5249.1     5462
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -1.8317 -0.5501 -0.3252  0.5854  6.4258
    ##
    ## Random effects:
    ##  Groups Name        Variance Std.Dev.
    ##  item   (Intercept) 0.02099  0.1449
    ##  pp     (Intercept) 0.34408  0.5866
    ## Number of obs: 5472, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error z value Pr(>|z|)
    ## (Intercept)                               -1.32067    0.08466 -15.600  < 2e-16
    ## group2-1                                   0.68408    0.16591   4.123 3.74e-05
    ## readingmode2-1                            -1.87826    0.07733 -24.290  < 2e-16
    ## predictability2-1                         -0.18293    0.07538  -2.427 0.015236
    ## group2-1:readingmode2-1                   -0.52376    0.15312  -3.421 0.000625
    ## group2-1:predictability2-1                -0.04968    0.15074  -0.330 0.741711
    ## readingmode2-1:predictability2-1          -0.09516    0.15073  -0.631 0.527846
    ## group2-1:readingmode2-1:predictability2-1  0.28363    0.30147   0.941 0.346805
    ##
    ## (Intercept)                               ***
    ## group2-1                                  ***
    ## readingmode2-1                            ***
    ## predictability2-1                         *
    ## group2-1:readingmode2-1                   ***
    ## group2-1:predictability2-1
    ## readingmode2-1:predictability2-1
    ## group2-1:readingmode2-1:predictability2-1
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    ##
    ## Correlation of Fixed Effects:
    ##             (Intr) grp2-1 rdn2-1 prd2-1 grp2-1:r2-1 grp2-1:p2-1 r2-1:2
    ## group2-1    -0.034
    ## readngmd2-1  0.193 -0.049
    ## prdctblt2-1  0.029 -0.012  0.066
    ## grp2-1:r2-1 -0.042  0.185 -0.104 -0.018
    ## grp2-1:p2-1 -0.011  0.029 -0.018 -0.113  0.065
    ## rdng2-1:2-1  0.028 -0.009  0.060  0.389 -0.026      -0.084
    ## g2-1:2-1:2- -0.009  0.029 -0.026 -0.084  0.061       0.389      -0.113

    confint(model_SKIP)

    ## Computing profile confidence intervals ...

    ##                                                2.5 %      97.5 %
    ## .sig01                                     0.0000000  0.26039512
    ## .sig02                                     0.4715817  0.73514553
    ## (Intercept)                               -1.4915088 -1.15480640
    ## group2-1                                   0.3563779  1.01693257
    ## readingmode2-1                            -2.0322393 -1.72776326
    ## predictability2-1                         -0.3316514 -0.03494084
    ## group2-1:readingmode2-1                   -0.8243833 -0.22143676
    ## group2-1:predictability2-1                -0.3462933  0.24744890
    ## readingmode2-1:predictability2-1          -0.3925560  0.20099787
    ## group2-1:readingmode2-1:predictability2-1 -0.3092779  0.87771148

# FOR FIRST FIXATION DURATION (FFD)

    measure = "FFD"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for FFD

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_FFD= lmer(depvar ~group*readingmode*predictability+ (1+readingmode|pp) + (1|item), datafile)
    summary(model_FFD, corr = FALSE)

    ## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    ## lmerModLmerTest]
    ## Formula: depvar ~ group * readingmode * predictability + (1 + readingmode |
    ##     pp) + (1 | item)
    ##    Data: datafile
    ##
    ## REML criterion at convergence: 48746.6
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -3.5283 -0.5972 -0.1519  0.4205  7.7333
    ##
    ## Random effects:
    ##  Groups   Name           Variance Std.Dev. Corr
    ##  item     (Intercept)      48.58   6.97
    ##  pp       (Intercept)     993.36  31.52
    ##           readingmode2-1  600.38  24.50    0.38
    ##  Residual                8994.07  94.84
    ## Number of obs: 4070, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error       df t value
    ## (Intercept)                                252.906      4.313   64.670  58.643
    ## group2-1                                   -12.343      8.496   62.054  -1.453
    ## readingmode2-1                              63.628      4.408   58.356  14.435
    ## predictability2-1                            8.074      3.107 3926.262   2.599
    ## group2-1:readingmode2-1                     24.689      8.817   58.391   2.800
    ## group2-1:predictability2-1                   3.173      6.212 3917.496   0.511
    ## readingmode2-1:predictability2-1            15.867      6.212 3928.284   2.554
    ## group2-1:readingmode2-1:predictability2-1   -4.741     12.423 3923.270  -0.382
    ##                                           Pr(>|t|)
    ## (Intercept)                                < 2e-16 ***
    ## group2-1                                   0.15133
    ## readingmode2-1                             < 2e-16 ***
    ## predictability2-1                          0.00938 **
    ## group2-1:readingmode2-1                    0.00691 **
    ## group2-1:predictability2-1                 0.60957
    ## readingmode2-1:predictability2-1           0.01068 *
    ## group2-1:readingmode2-1:predictability2-1  0.70278
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    confint(model_FFD)

    ## Computing profile confidence intervals ...

    ##                                                   2.5 %      97.5 %
    ## .sig01                                      0.000000000  11.7452060
    ## .sig02                                     25.437224410  38.1665556
    ## .sig03                                      0.007916985   0.7102335
    ## .sig04                                     14.992350628  33.2762887
    ## .sigma                                     92.713392081  96.9438674
    ## (Intercept)                               244.475783321 261.3807738
    ## group2-1                                  -28.948133219   4.3654242
    ## readingmode2-1                             55.022072097  72.3175777
    ## predictability2-1                           1.993608717  14.1683630
    ## group2-1:readingmode2-1                     7.477049830  42.0457675
    ## group2-1:predictability2-1                 -8.992101448  15.3523650
    ## readingmode2-1:predictability2-1            3.695012897  28.0442441
    ## group2-1:readingmode2-1:predictability2-1 -29.095750478  19.5993959

# FOR SINGLE FIXATION DURATION (SFD)

    measure = "SFD"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for SFD

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_SFD= lmer(depvar ~group*readingmode*predictability+ (1+readingmode|pp) + (1|item), datafile)
    summary(model_SFD, corr = FALSE)

    ## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    ## lmerModLmerTest]
    ## Formula: depvar ~ group * readingmode * predictability + (1 + readingmode |
    ##     pp) + (1 | item)
    ##    Data: datafile
    ##
    ## REML criterion at convergence: 39784.6
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -3.5787 -0.5862 -0.1598  0.4096  7.7615
    ##
    ## Random effects:
    ##  Groups   Name           Variance Std.Dev. Corr
    ##  item     (Intercept)      23.11   4.807
    ##  pp       (Intercept)    1048.78  32.385
    ##           readingmode2-1  685.46  26.181   0.39
    ##  Residual                8909.89  94.392
    ## Number of obs: 3324, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error       df t value
    ## (Intercept)                                255.826      4.423   63.111  57.846
    ## group2-1                                   -14.241      8.786   62.728  -1.621
    ## readingmode2-1                              71.795      4.728   61.735  15.184
    ## predictability2-1                           10.078      3.352 3196.548   3.006
    ## group2-1:readingmode2-1                     20.057      9.458   61.759   2.121
    ## group2-1:predictability2-1                   4.339      6.704 3191.250   0.647
    ## readingmode2-1:predictability2-1            20.956      6.701 3193.841   3.127
    ## group2-1:readingmode2-1:predictability2-1   -7.368     13.403 3204.972  -0.550
    ##                                           Pr(>|t|)
    ## (Intercept)                                < 2e-16 ***
    ## group2-1                                   0.11006
    ## readingmode2-1                             < 2e-16 ***
    ## predictability2-1                          0.00266 **
    ## group2-1:readingmode2-1                    0.03797 *
    ## group2-1:predictability2-1                 0.51755
    ## readingmode2-1:predictability2-1           0.00178 **
    ## group2-1:readingmode2-1:predictability2-1  0.58255
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    confint(model_SFD)

    ## Computing profile confidence intervals ...

    ##                                                  2.5 %      97.5 %
    ## .sig01                                      0.00000000  10.9963639
    ## .sig02                                     26.07509969  39.2515357
    ## .sig03                                      0.02452419   0.7141645
    ## .sig04                                     16.19105605  35.4211040
    ## .sigma                                     92.03713538  96.7268297
    ## (Intercept)                               247.17153377 264.5017014
    ## group2-1                                  -31.40681393   3.0278480
    ## readingmode2-1                             62.55648952  81.0973835
    ## predictability2-1                           3.51777441  16.6581853
    ## group2-1:readingmode2-1                     1.59977846  38.6820859
    ## group2-1:predictability2-1                 -8.78772046  17.4818736
    ## readingmode2-1:predictability2-1            7.82179381  34.0891666
    ## group2-1:readingmode2-1:predictability2-1 -33.67433109  18.9314147

# FOR GAZE DURATION

    measure = "GD"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for GD

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_GD= lmer(depvar ~group*readingmode*predictability+ (1+readingmode+predictability|pp) + (1|item), datafile)
    summary(model_GD, corr = FALSE)

    ## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    ## lmerModLmerTest]
    ## Formula: depvar ~ group * readingmode * predictability + (1 + readingmode +
    ##     predictability | pp) + (1 | item)
    ##    Data: datafile
    ##
    ## REML criterion at convergence: 51907.2
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -2.6181 -0.6135 -0.1899  0.4241  5.1990
    ##
    ## Random effects:
    ##  Groups   Name              Variance Std.Dev. Corr
    ##  item     (Intercept)         227.5   15.08
    ##  pp       (Intercept)        1022.7   31.98
    ##           readingmode2-1     1875.2   43.30   0.44
    ##           predictability2-1   155.4   12.47   0.31 0.70
    ##  Residual                   19600.6  140.00
    ## Number of obs: 4070, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error       df t value
    ## (Intercept)                                294.208      4.903   71.461  60.009
    ## group2-1                                   -26.356      9.264   62.253  -2.845
    ## readingmode2-1                             120.608      7.150   65.373  16.868
    ## predictability2-1                           19.967      4.851   75.231   4.116
    ## group2-1:readingmode2-1                     23.896     14.304   65.431   1.671
    ## group2-1:predictability2-1                  -8.138      9.699   75.125  -0.839
    ## readingmode2-1:predictability2-1            34.455      9.184 3913.179   3.752
    ## group2-1:readingmode2-1:predictability2-1    2.516     18.365 3908.729   0.137
    ##                                           Pr(>|t|)
    ## (Intercept)                                < 2e-16 ***
    ## group2-1                                  0.006001 **
    ## readingmode2-1                             < 2e-16 ***
    ## predictability2-1                         9.76e-05 ***
    ## group2-1:readingmode2-1                   0.099581 .
    ## group2-1:predictability2-1                0.404054
    ## readingmode2-1:predictability2-1          0.000178 ***
    ## group2-1:readingmode2-1:predictability2-1 0.891031
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    confint(model_GD)

    ## Computing profile confidence intervals ...

    ##                                                  2.5 %      97.5 %
    ## .sig01                                      7.99406754  21.4919284
    ## .sig02                                     24.76372829  39.6385531
    ## .sig03                                      0.07838069   0.7800826
    ## .sig04                                     -0.65638389   0.9160993
    ## .sig05                                     30.48807747  56.0380794
    ## .sig06                                     -1.00000000   0.9773087
    ## .sig07                                      0.75263219  26.2960398
    ## .sigma                                    136.87852911 143.1712926
    ## (Intercept)                               284.60166279 303.8142361
    ## group2-1                                  -44.44662303  -8.1246178
    ## readingmode2-1                            106.57260706 134.6130292
    ## predictability2-1                          10.45078078  29.4596910
    ## group2-1:readingmode2-1                    -4.03672717  52.0006800
    ## group2-1:predictability2-1                -27.08465486  10.8738113
    ## readingmode2-1:predictability2-1           16.42742558  52.4456013
    ## group2-1:readingmode2-1:predictability2-1 -33.47202613  38.5200332

# FOR TOTAL READING TIME (TRT)

    measure = "TRT"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for TRT

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_TRT= lmer(depvar ~group*readingmode*predictability+ (1+readingmode+predictability|pp) + (1|item), datafile)
    summary(model_TRT, corr = FALSE)

    ## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    ## lmerModLmerTest]
    ## Formula: depvar ~ group * readingmode * predictability + (1 + readingmode +
    ##     predictability | pp) + (1 | item)
    ##    Data: datafile
    ##
    ## REML criterion at convergence: 60685.2
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -2.9281 -0.6497 -0.2085  0.4746  8.8842
    ##
    ## Random effects:
    ##  Groups   Name              Variance Std.Dev. Corr
    ##  item     (Intercept)         836.9   28.93
    ##  pp       (Intercept)        2105.2   45.88
    ##           readingmode2-1     3046.7   55.20    0.47
    ##           predictability2-1   158.9   12.60    0.43 -0.01
    ##  Residual                   33605.0  183.32
    ## Number of obs: 4563, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error       df t value
    ## (Intercept)                                351.316      7.084   85.287  49.593
    ## group2-1                                   -50.707     12.754   63.181  -3.976
    ## readingmode2-1                             122.111      8.871   60.519  13.766
    ## predictability2-1                           28.558      5.762   62.222   4.956
    ## group2-1:readingmode2-1                     23.089     17.742   60.524   1.301
    ## group2-1:predictability2-1                 -11.583     11.521   62.195  -1.005
    ## readingmode2-1:predictability2-1            21.205     11.082 4388.572   1.913
    ## group2-1:readingmode2-1:predictability2-1  -11.615     22.159 4384.320  -0.524
    ##                                           Pr(>|t|)
    ## (Intercept)                                < 2e-16 ***
    ## group2-1                                  0.000183 ***
    ## readingmode2-1                             < 2e-16 ***
    ## predictability2-1                         5.83e-06 ***
    ## group2-1:readingmode2-1                   0.198049
    ## group2-1:predictability2-1                0.318605
    ## readingmode2-1:predictability2-1          0.055763 .
    ## group2-1:readingmode2-1:predictability2-1 0.600201
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    confint(model_TRT)

    ## Computing profile confidence intervals ...

    ##                                                 2.5 %      97.5 %
    ## .sig01                                     21.5773652  37.0661927
    ## .sig02                                     36.5098863  56.0871023
    ## .sig03                                      0.1421787   0.7427085
    ## .sig04                                     -0.9218792   0.8965120
    ## .sig05                                     38.9545392  71.3063502
    ## .sig06                                     -0.9639964   0.6623061
    ## .sig07                                      0.8661146  31.6436499
    ## .sigma                                    179.4665202 187.2228501
    ## (Intercept)                               337.4465469 365.1921649
    ## group2-1                                  -75.6944468 -25.6678536
    ## readingmode2-1                            104.7245076 139.5070232
    ## predictability2-1                          17.2678837  39.8296618
    ## group2-1:readingmode2-1                   -11.6446248  57.8737705
    ## group2-1:predictability2-1                -34.1273990  10.9621984
    ## readingmode2-1:predictability2-1           -0.5621371  42.8979795
    ## group2-1:readingmode2-1:predictability2-1 -55.0641095  31.8015620

# FOR REGRESSION PATH DURATION (RPD)

    measure = "RPD"
    datafile$depvar = datafile[,measure]
    datafile$depvar = as.numeric(datafile$depvar)

## linear mixed effect model analysis for RPD

    contrasts(datafile$group) <- contr.sdif(2)
    contrasts(datafile$predictability) <- contr.sdif(2)
    contrasts(datafile$readingmode) <- contr.sdif(2)
    model_RPD= lmer(depvar ~group*readingmode*predictability+ (1+readingmode|pp) + (1|item), datafile)
    summary(model_RPD, corr = FALSE)

    ## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
    ## lmerModLmerTest]
    ## Formula: depvar ~ group * readingmode * predictability + (1 + readingmode |
    ##     pp) + (1 | item)
    ##    Data: datafile
    ##
    ## REML criterion at convergence: 55594.9
    ##
    ## Scaled residuals:
    ##     Min      1Q  Median      3Q     Max
    ## -1.9860 -0.5428 -0.2293  0.2767 10.2396
    ##
    ## Random effects:
    ##  Groups   Name           Variance Std.Dev. Corr
    ##  item     (Intercept)      848.3   29.13
    ##  pp       (Intercept)     1449.7   38.08
    ##           readingmode2-1  4483.2   66.96   0.41
    ##  Residual                48773.1  220.85
    ## Number of obs: 4070, groups:  item, 88; pp, 64
    ##
    ## Fixed effects:
    ##                                           Estimate Std. Error       df t value
    ## (Intercept)                                339.941      6.769   80.487  50.223
    ## group2-1                                   -39.296     12.030   62.754  -3.267
    ## readingmode2-1                             126.593     11.138   58.810  11.366
    ## predictability2-1                           18.084      7.236 3921.369   2.499
    ## group2-1:readingmode2-1                     29.328     22.283   58.874   1.316
    ## group2-1:predictability2-1                 -14.859     14.466 3914.703  -1.027
    ## readingmode2-1:predictability2-1            33.614     14.472 3922.413   2.323
    ## group2-1:readingmode2-1:predictability2-1  -10.111     28.937 3918.351  -0.349
    ##                                           Pr(>|t|)
    ## (Intercept)                                < 2e-16 ***
    ## group2-1                                   0.00177 **
    ## readingmode2-1                             < 2e-16 ***
    ## predictability2-1                          0.01249 *
    ## group2-1:readingmode2-1                    0.19323
    ## group2-1:predictability2-1                 0.30441
    ## readingmode2-1:predictability2-1           0.02024 *
    ## group2-1:readingmode2-1:predictability2-1  0.72679
    ## ---
    ## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

    confint(model_RPD)

    ## Computing profile confidence intervals ...

    ##                                                   2.5 %      97.5 %
    ## .sig01                                     19.261983439  39.0927762
    ## .sig02                                     27.786254404  48.7786955
    ## .sig03                                      0.009900461   0.7775085
    ## .sig04                                     45.468492222  87.8385808
    ## .sigma                                    215.906164328 225.7586786
    ## (Intercept)                               326.676287476 353.2025447
    ## group2-1                                  -62.827176875 -15.6018499
    ## readingmode2-1                            104.789161898 148.4221882
    ## predictability2-1                           3.910291218  32.2711524
    ## group2-1:readingmode2-1                   -14.217850696  73.0807633
    ## group2-1:predictability2-1                -43.183282836  13.5067677
    ## readingmode2-1:predictability2-1            5.271296546  62.0128504
    ## group2-1:readingmode2-1:predictability2-1 -66.785928017  46.6105178