Main analyses
##GLMMS
Rationale:
Pre-registered analysis: ### GLMM01 - exploit vs. chance 1. We will conduct binomial Generalized Linear Mixed Models (GLMM). The main analysis pertains to the main test phase (trials 1 – 4) and tests the key prediction that children will exploit the certain option significantly above chance (conservative chance level .5) while controlling for participants’ age (z-transformed), trial number (z-transformed), and accounting for individual differences in slope and intercept. To examine whether children’s performance differs significantly from 50% chance, we will fit this binomial mixed effect model (including z-transformed age and trial number as main predictors, random intercepts for participants and random slope for trial number) and suppress the intercept. - Main model: exploit.certain ~ z.age + z.trial + (1 + z.trial| id) - Main model BA: exploit.certain ~ (1 + z.trial| id)
# GLMM01
m1a <- lme4::glmer(exploit.comp ~ 1 + (1 + z.trial|code),
family = "binomial",
data = data.main,
control = glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e4)))
## boundary (singular) fit: see help('isSingular')
summary(m1a)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.comp ~ 1 + (1 + z.trial | code)
## Data: data.main
## Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 20000))
##
## AIC BIC logLik -2*log(L) df.resid
## 193.9 205.8 -93.0 185.9 142
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.0309 -0.6790 -0.5273 0.9656 1.5882
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## code (Intercept) 0.8313 0.9118
## z.trial 0.0808 0.2843 1.00
## Number of obs: 146, groups: code, 37
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.7240 0.2465 -2.937 0.00332 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
#GLMM01b w/o pilot data
m1b <- lme4::glmer(exploit.comp ~ 1 + (1 + z.trial|code),
family = "binomial",
data = data.main.s,
control = glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e4)))
## boundary (singular) fit: see help('isSingular')
summary(m1b) # intercept not significant any more
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.comp ~ 1 + (1 + z.trial | code)
## Data: data.main.s
## Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 20000))
##
## AIC BIC logLik -2*log(L) df.resid
## 107.8 117.2 -49.9 99.8 74
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.2108 -0.6634 -0.4354 0.7599 1.5690
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## code (Intercept) 1.50324 1.2261
## z.trial 0.06326 0.2515 1.00
## Number of obs: 78, groups: code, 20
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.5593 0.3815 -1.466 0.143
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
# transforming estimate from logit space
plogis(fixef(m1a)["(Intercept)"])
## (Intercept)
## 0.3265232
plogis(fixef(m1b)["(Intercept)"])
## (Intercept)
## 0.3636997
# test against chance included!!
#install.packages("multcomp")
library(multcomp)
## Loading required package: mvtnorm
## Loading required package: survival
## Loading required package: TH.data
## Loading required package: MASS
##
## Attaching package: 'MASS'
## The following object is masked from 'package:dplyr':
##
## select
##
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
##
## geyser
# against 33% chance level
#install.packages("gtools")
library(gtools)
summary(glht(m1a,
alternative = "two.sided",
rhs = gtools::logit(0.33), # gegen was wird getestet (33 % im logit space)
test = adjusted("none")))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Fit: lme4::glmer(formula = exploit.comp ~ 1 + (1 + z.trial | code),
## data = data.main, family = "binomial", control = glmerControl(optimizer = "bobyqa",
## optCtrl = list(maxfun = 20000)))
##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) == -0.708185057924486 -0.7240 0.2465 -0.064 0.949
## (Adjusted p values reported -- single-step method)
# intercept = angelegtes chance level
# nicht signifikant von 0.33 verschieden
# against 33% chance w/o pilot data
summary(glht(m1b,
alternative = "two.sided",
rhs = gtools::logit(0.33), # gegen was wird getestet (33 % im logit space)
test = adjusted("none")))
##
## Simultaneous Tests for General Linear Hypotheses
##
## Fit: lme4::glmer(formula = exploit.comp ~ 1 + (1 + z.trial | code),
## data = data.main.s, family = "binomial", control = glmerControl(optimizer = "bobyqa",
## optCtrl = list(maxfun = 20000)))
##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) == -0.708185057924486 -0.5593 0.3815 0.39 0.696
## (Adjusted p values reported -- single-step method)
GLMM02 - exploit predictors vs. null model
2a. Descriptively, we will analyze how many children spontaneously split their decisions (see above) and which decision they act on first. These factors are further included as predictors to our main model to test for their respective effects on children’s exploitation performance.
2b. Hence, we will extend our main model (specified as below) and run a model comparison with a respective null model lacking only the main and interaction effects of decision.split and decision.order (R function anova with argument ‘test’ set to “Chisq” with p < .05). - Full model: exploit.certain ~ decision.split * decision.order + z.age + z.trial + (1 + z.trial | id) - Null model: exploit.certain ~ 1 + z.age + z.trial + (1 + z.trial | id) - BA Null model: exploit.certain ~ 1 + (1 + z.trial | id)
# specify full model
m2 <- lme4::glmer(exploit.comp ~ 1 + sticker_split*sticker_first + z.age + z.trial + (1 + z.trial|code),
family = "binomial",
data = data.main)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00731414 (tol = 0.002, component 1)
## w/o pilot data
m2b <- lme4::glmer(exploit.comp ~ 1 + sticker_split*sticker_first + z.age + z.trial + (1 + z.trial|code),
family = "binomial",
data = data.main.s)
## fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
## boundary (singular) fit: see help('isSingular')
# specify null model
m2.null <- lme4::glmer(exploit.comp ~ 1 + (1 + z.trial|code),
family = "binomial",
data = data.main)
## boundary (singular) fit: see help('isSingular')
## w/o pilot data
m2b.null <- lme4::glmer(exploit.comp ~ 1 + (1 + z.trial|code),
family = "binomial",
data = data.main.s)
# model comparison
anova(m2, m2.null, test = "Chisq") # not significant
## Data: data.main
## Models:
## m2.null: exploit.comp ~ 1 + (1 + z.trial | code)
## m2: exploit.comp ~ 1 + sticker_split * sticker_first + z.age + z.trial + (1 + z.trial | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m2.null 4 193.90 205.84 -92.951 185.90
## m2 11 198.54 231.36 -88.268 176.54 9.3651 7 0.2275
## w/o pilot data
anova(m2b, m2b.null, test = "Chisq") # marginally significant
## Data: data.main.s
## Models:
## m2b.null: exploit.comp ~ 1 + (1 + z.trial | code)
## m2b: exploit.comp ~ 1 + sticker_split * sticker_first + z.age + z.trial + (1 + z.trial | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m2b.null 4 107.8 117.22 -49.899 99.797
## m2b 10 108.3 131.86 -44.148 88.296 11.501 6 0.07406 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# full model nicht signifikant mehr Var. aufgeklärt (berichten in Klammern: df, Chisq, p-Wert)
# drop1 full model
drop1(m2, test = "Chisq") # jeweiligen Faktor kicken und gucken, ob signifikant zum Effekt beitragen => brauch ich jetzt nicht!
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00774251 (tol = 0.002, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00353045 (tol = 0.002, component 1)
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00259368 (tol = 0.002, component 1)
## Single term deletions
##
## Model:
## exploit.comp ~ 1 + sticker_split * sticker_first + z.age + z.trial +
## (1 + z.trial | code)
## npar AIC LRT Pr(Chi)
## <none> 198.54
## z.age 1 198.65 2.1098 0.14636
## z.trial 1 196.75 0.2125 0.64484
## sticker_split:sticker_first 2 199.62 5.0840 0.07871 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(m2b, test = "Chisq") # significant interaction... -> Abbildung (nicht für BA nötig -- fehlender Schritt: getrennte Analysen je nach Split ja oder nein, Modell nur mit sticker_frist (subsample gesplittet vs. nicht))
## fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
## boundary (singular) fit: see help('isSingular')
## fixed-effect model matrix is rank deficient so dropping 1 column / coefficient
## boundary (singular) fit: see help('isSingular')
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, : Model is nearly unidentifiable: large eigenvalue ratio
## - Rescale variables?
## Single term deletions
##
## Model:
## exploit.comp ~ 1 + sticker_split * sticker_first + z.age + z.trial +
## (1 + z.trial | code)
## npar AIC LRT Pr(Chi)
## <none> 108.30
## z.age 1 106.84 0.5489 0.45875
## z.trial 1 106.30 0.0003 0.98640
## sticker_split:sticker_first 1 111.21 4.9184 0.02657 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Zusatz: Altersgruppen statt z.age
m2.1 <- lme4::glmer(exploit.comp ~ 1 + age_group + z.trial + (1 + z.trial|code),
family = "binomial",
data = data.main)
summary(m2.1)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.comp ~ 1 + age_group + z.trial + (1 + z.trial | code)
## Data: data.main
##
## AIC BIC logLik -2*log(L) df.resid
## 196.1 214.0 -92.1 184.1 140
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.0994 -0.6357 -0.5521 0.9695 1.9214
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## code (Intercept) 0.69891 0.8360
## z.trial 0.04085 0.2021 1.00
## Number of obs: 146, groups: code, 37
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.0236 0.3734 -2.741 0.00612 **
## age_group4yo 0.5755 0.4733 1.216 0.22395
## z.trial 0.1187 0.2020 0.588 0.55680
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) ag_gr4
## age_group4y -0.766
## z.trial 0.062 0.021
# w/o pilot data
m2.1b <- lme4::glmer(exploit.comp ~ 1 + age_group + z.trial + (1 + z.trial|code),
family = "binomial",
data = data.main.s)
## boundary (singular) fit: see help('isSingular')
summary(m2.1b) # 4yo still not significantly better than 3yo
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.comp ~ 1 + age_group + z.trial + (1 + z.trial | code)
## Data: data.main.s
##
## AIC BIC logLik -2*log(L) df.resid
## 109.5 123.6 -48.7 97.5 72
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.2887 -0.6029 -0.4524 0.7409 2.0301
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## code (Intercept) 1.18585 1.089
## z.trial 0.06051 0.246 1.00
## Number of obs: 78, groups: code, 20
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.23556 0.61850 -1.998 0.0458 *
## age_group4yo 1.13572 0.75896 1.496 0.1345
## z.trial 0.06278 0.28216 0.223 0.8239
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) ag_gr4
## age_group4y -0.801
## z.trial 0.092 0.028
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
GLMM03 - forced choice trial
3a. Regarding the forced-choice in the fifth trial, we will analyze children’s preferences for either explore or exploit choices descriptively. -> descriptive analyses!
3b. Then, we will analyze children’s exploit choices in the final trial in more detail. We will conduct another GLMM to test whether children’s choices to exploit the certain option differ significantly from chance (see 1. main analysis, chance level set at .5) and whether this performance in the final trial is affected by their previous performance (proportion to exploit rationally in the main test trials). - Full model: exploit.certain ~ exploit.prev.performance + z.age + (1 | id) - Null model: exploit.certain ~ 1 + z.age + (1 | id) - BA null model: exploit.certain ~ 1 + (1 | id)
# compute previous performance on subject level
library(dplyr)
subject_prev_perf <- data.main %>%
filter(trial %in% 1:4) %>% # filter previous trials
group_by(code) %>% # group by subject
dplyr::summarise(
prev_perf_1_4 = mean(as.numeric(as.character(exploit.comp)), na.rm = TRUE)
) %>% # calculating mean of numeric versions of binary DV, because it's essentially the proportion!; as.numeric and as.character bc converting directly to numeric would give me levels 1,2 instead of 0 and 1 => character first!
ungroup()
head(subject_prev_perf) # check if it worked
## # A tibble: 6 × 2
## code prev_perf_1_4
## <fct> <dbl>
## 1 01_MS46_vj 0.333
## 2 02_GL37_vn 0.75
## 3 03_HG41_vj 0.25
## 4 04_AB56_vj 0.75
## 5 05_IT40_vj 0
## 6 06_FT40_vj 0.333
# add previous performance to dataset
data.choice.prev <- data.test %>%
filter(trial_type == "test_or") %>%
filter(!is.na(exploit.comp)) %>%
left_join(subject_prev_perf, by = "code") %>%
mutate(z.age = scale(as.numeric(age.d)),
z.prev.perf = scale(as.numeric(as.character(prev_perf_1_4))))
# specify full model
m3 <- lme4::glmer(exploit.forced ~ z.prev.perf + z.age + (1 |code), # column name pre_perf_1_4 for whatever reason??
family = "binomial",
data = data.choice.prev)
# specify null model
m3.null <- lme4::glmer(exploit.forced ~ 1 + (1 |code),
family = "binomial",
data = data.choice.prev)
## boundary (singular) fit: see help('isSingular')
summary(m3.null)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.forced ~ 1 + (1 | code)
## Data: data.choice.prev
##
## AIC BIC logLik -2*log(L) df.resid
## 50.7 53.7 -23.3 46.7 32
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.1255 -1.1255 0.8885 0.8885 0.8885
##
## Random effects:
## Groups Name Variance Std.Dev.
## code (Intercept) 7.179e-09 8.473e-05
## Number of obs: 34, groups: code, 34
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.2364 0.3454 0.684 0.494
## optimizer (Nelder_Mead) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
# transforming estimate from logit space
plogis(fixef(m3.null)["(Intercept)"])
## (Intercept)
## 0.5588235
# against 33% chance level
library(gtools)
summary(glht(m3.null,
alternative = "two.sided",
rhs = gtools::logit(0.33),
test = adjusted("none"))) # significantly better than lenient chance crit
##
## Simultaneous Tests for General Linear Hypotheses
##
## Fit: lme4::glmer(formula = exploit.forced ~ 1 + (1 | code), data = data.choice.prev,
## family = "binomial")
##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) == -0.708185057924486 0.2364 0.3454 2.734 0.00625 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## (Adjusted p values reported -- single-step method)
# model comparison
anova(m3, m3.null, test = "Chisq") #m3 klärt signifikant mehr Varianz auf (könnte power sein)
## Data: data.choice.prev
## Models:
## m3.null: exploit.forced ~ 1 + (1 | code)
## m3: exploit.forced ~ z.prev.perf + z.age + (1 | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m3.null 2 50.662 53.715 -23.331 46.662
## m3 4 48.275 54.381 -20.138 40.275 6.3869 2 0.04103 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m3) #aber keiner der Effekte signifikant in summary... jedenfalls beide in positive Richtung
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.forced ~ z.prev.perf + z.age + (1 | code)
## Data: data.choice.prev
##
## AIC BIC logLik -2*log(L) df.resid
## 48.3 54.4 -20.1 40.3 30
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.6345 -0.8039 0.3368 0.7243 1.7265
##
## Random effects:
## Groups Name Variance Std.Dev.
## code (Intercept) 0.09797 0.313
## Number of obs: 34, groups: code, 34
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) 0.3271 0.4137 0.791 0.429
## z.prev.perf 0.7813 0.5394 1.449 0.147
## z.age 0.4594 0.4389 1.047 0.295
##
## Correlation of Fixed Effects:
## (Intr) z.prv.
## z.prev.perf 0.288
## z.age 0.152 -0.003
## w/o pilot data: new data set
data.choice.prev.s <- data.choice.prev %>%
dplyr::filter(!grepl("^p", code)) %>%
mutate(z.age = scale(as.numeric(age.d)),
z.prev.perf = scale(as.numeric(as.character(prev_perf_1_4))))
### specify model w/o pilot data
m3b <- lme4::glmer(exploit.forced ~ z.prev.perf + z.age + (1 |code),
family = "binomial",
data = data.choice.prev.s)
# specify null model w/o pilot data
m3b.null <- lme4::glmer(exploit.forced ~ 1 + (1 |code),
family = "binomial",
data = data.choice.prev.s)
## boundary (singular) fit: see help('isSingular')
# transforming estimate from logit space
plogis(fixef(m3b.null)["(Intercept)"]) # performance exactly at 50% chance level
## (Intercept)
## 0.5
# model comparison w/o pilot data
anova(m3b, m3b.null, test = "Chisq") # klärt signifikant mehr Varianz auf
## Data: data.choice.prev.s
## Models:
## m3b.null: exploit.forced ~ 1 + (1 | code)
## m3b: exploit.forced ~ z.prev.perf + z.age + (1 | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m3b.null 2 28.953 30.734 -12.4766 24.9533
## m3b 4 17.090 20.652 -4.5451 9.0901 15.863 2 0.0003592 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m3b) # previous performance marginally significant --> ganz knapp an 0.05
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.forced ~ z.prev.perf + z.age + (1 | code)
## Data: data.choice.prev.s
##
## AIC BIC logLik -2*log(L) df.resid
## 17.1 20.7 -4.5 9.1 14
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -0.075482 -0.000395 0.000000 0.001897 0.109060
##
## Random effects:
## Groups Name Variance Std.Dev.
## code (Intercept) 2007 44.8
## Number of obs: 18, groups: code, 18
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.3928 3.6910 -0.106 0.9152
## z.prev.perf 16.5648 8.6427 1.917 0.0553 .
## z.age 7.6868 5.2253 1.471 0.1413
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) z.prv.
## z.prev.perf 0.061
## z.age -0.282 0.503
control analyses
- We will run additional analyses on the (converging) 2b GLMM with the control variables sex, order of familiarization, position of boxes, order of hiding, and experimental test setting (lab or kindergarten).
# descriptively (looking for hints at biases)
## grouped by sex
exploit.perf.sex <- data.main %>%
group_by(sex) %>%
dplyr::count(exploit.comp) %>%
mutate(prop = n/sum(n))
exploit.perf.sex # no hint at difference
## # A tibble: 4 × 4
## # Groups: sex [2]
## sex exploit.comp n prop
## <fct> <fct> <int> <dbl>
## 1 f 0 43 0.295
## 2 f 1 27 0.185
## 3 m 0 51 0.349
## 4 m 1 25 0.171
## grouped by order of familiarization
exploit.perf.ofam <- data.main %>%
group_by(order_fam) %>%
dplyr::count(exploit.comp) %>%
mutate(prop = n/sum(n))
exploit.perf.ofam # no hint at difference
## # A tibble: 4 × 4
## # Groups: order_fam [2]
## order_fam exploit.comp n prop
## <fct> <fct> <int> <dbl>
## 1 bilder_first 0 55 0.377
## 2 bilder_first 1 29 0.199
## 3 postbote_first 0 39 0.267
## 4 postbote_first 1 23 0.158
## grouped by position of target
exploit.perf.tpos <- data.main %>%
group_by(position_target) %>%
dplyr::count(exploit.comp) %>%
mutate(prop = n/sum(n))
exploit.perf.tpos # maybe bias?? slightly better performance when target_left (allerdings auch viel öfter links gewesen... - also eher SP Größe?)
## # A tibble: 4 × 4
## # Groups: position_target [2]
## position_target exploit.comp n prop
## <fct> <fct> <int> <dbl>
## 1 target_left 0 47 0.322
## 2 target_left 1 39 0.267
## 3 target_right 0 47 0.322
## 4 target_right 1 13 0.0890
### control analyses position of target
mcon1 <- lme4::glmer(exploit.comp ~ 1 + position_target + (1 + z.trial|code),
family = "binomial",
data = data.main,
control = glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e4)))
## boundary (singular) fit: see help('isSingular')
anova(mcon1, m2.null, test = "Chisq") # highly significant
## Data: data.main
## Models:
## m2.null: exploit.comp ~ 1 + (1 + z.trial | code)
## mcon1: exploit.comp ~ 1 + position_target + (1 + z.trial | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m2.null 4 193.9 205.84 -92.951 185.9
## mcon1 5 184.1 199.02 -87.050 174.1 11.802 1 0.0005917 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(mcon1) #scheint bias zu geben
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: binomial ( logit )
## Formula: exploit.comp ~ 1 + position_target + (1 + z.trial | code)
## Data: data.main
## Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 20000))
##
## AIC BIC logLik -2*log(L) df.resid
## 184.1 199.0 -87.0 174.1 141
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.2277 -0.5649 -0.4046 0.7565 2.2159
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## code (Intercept) 1.3256 1.1514
## z.trial 0.2156 0.4643 1.00
## Number of obs: 146, groups: code, 37
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -0.1621 0.3168 -0.512 0.60878
## position_targettarget_right -1.5068 0.4821 -3.125 0.00178 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr)
## pstn_trgtt_ -0.496
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
## grouped by order of hiding
exploit.perf.ohid <- data.main %>%
group_by(hide_first) %>%
dplyr::count(exploit.comp) %>%
mutate(prop = n/sum(n))
exploit.perf.ohid #not hint at bias
## # A tibble: 4 × 4
## # Groups: hide_first [2]
## hide_first exploit.comp n prop
## <fct> <fct> <int> <dbl>
## 1 distractors_first 0 49 0.336
## 2 distractors_first 1 27 0.185
## 3 target_first 0 45 0.308
## 4 target_first 1 25 0.171
## grouped by experimental setting
exploit.perf.set <- data.main %>%
group_by(where) %>%
dplyr::count(exploit.comp) %>%
mutate(prop = n/sum(n))
exploit.perf.set #hint at better in WW (but again, more tested in WW)
## # A tibble: 4 × 4
## # Groups: where [2]
## where exploit.comp n prop
## <fct> <fct> <int> <dbl>
## 1 Kita 0 47 0.322
## 2 Kita 1 19 0.130
## 3 WW 0 47 0.322
## 4 WW 1 33 0.226
### control analyses setting
mcon2 <- lme4::glmer(exploit.comp ~ 1 + where + (1 + z.trial|code),
family = "binomial",
data = data.main,
control = glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e4)))
## boundary (singular) fit: see help('isSingular')
anova(mcon2, m2.null, test = "Chisq") # marginally significant, possibly artefact more WW
## Data: data.main
## Models:
## m2.null: exploit.comp ~ 1 + (1 + z.trial | code)
## mcon2: exploit.comp ~ 1 + where + (1 + z.trial | code)
## npar AIC BIC logLik -2*log(L) Chisq Df Pr(>Chisq)
## m2.null 4 193.90 205.84 -92.951 185.90
## mcon2 5 193.15 208.07 -91.575 183.15 2.7508 1 0.09721 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1