I calculated duration (IV) in seconds using two different ranges (0 to 5s and 0 to 10s). The aim was to find out which range contributes to higher word learning outcomes (dichotomous DV).
I approached this in 2 ways:
Approach 1
I inserted data and scaled duration to have a data frame as follows:
Subject Word Score Duration Range
1 1 0 -0.03 0to5
1 1 1 0.80 0to10
1 2 1 -0.93 0to5
1 2 0 -0.15 0to10
1 3 1 0.75 0to5
1 3 0 0.17 0to10
The number of Subjects and Word extend to 53 and 20 respectively. I run the "Range as factor" model of 2968 observations.
glmer(score~duration + Range + (1|Subject) + (1|Word),data= df,family='binomial')
As you see below, results showed that 0to10s range lowers scores by 0.46 (p = 0.04*).
AIC BIC logLik deviance df.resid
2347.8 2387.4 -1166.9 2333.8 2113
Scaled residuals:
Min 1Q Median 3Q Max
-4.1945 -0.6678 0.2181 0.6278 3.1624
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.5388 0.3101 1.737 0.0823 .
duration 0.9457 0.4345 2.177 0.0295 *
range0to10 -0.4597 0.2271 -2.025 0.0429 *
duration:Range0to10 -0.5851 0.3179 -1.840 0.0657 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Approach 2 Using filter function for Range levels, I split data into 2 data sets (0to5s data; and 0to10s data) and run separate models, each having 1060 observations.
Mod0to5s: glmer(score ~ duration + (1|Subject), data= 0to5data,family = 'binomial')
AIC BIC logLik deviance df.resid
1252.7 1277.5 -621.4 1242.7 1055
Scaled residuals:
Min 1Q Median 3Q Max
-3.6159 -0.7101 0.2650 0.6633 2.5760
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 0.5423 0.3104 1.747 0.0806 .
duration 1.1416 0.4913 2.324 0.0201 *
Mod0to10s: glmer(score ~ duration + (1|Subject), data= 0to10data,family = 'binomial')
AIC BIC logLik deviance df.resid
1248.0 1272.9 -619.0 1238.0 1055
Scaled residuals:
Min 1Q Median 3Q Max
-3.7953 -0.7132 0.2689 0.6561 2.5497
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.08436 0.25928 -0.325 0.744896
duration 0.52693 0.15461 3.408 0.000654 ***
*10s model had the lowest AIC, hence, could probably be the best? But does AIC simply give the better fit and not necessarily whats the most better range for better scores? [which is exactly what I'm looking for in this pre-analysis stage]?