CAT_Test <- read.delim("Data/CAT_Test.txt") #Main data
posthoc <- read.delim("Data/posthoc.txt") #Data post-hoc test
CAT_Test <- subset(CAT_Test, Subject !="540") #ADHD
# N = 49
Participants are subjected to either Condition 1 or Condition 2 (between-subjects) of the learning phase, during which they see tokens from the continuum (stimuli 1-11). Participants that did the Condition 1 learning phase are hypothesized to categorize stimuli S and D2 together, while participants that did the Condition 2 learning phase are hypothesized to categorize stimuli S and D1 together. In the test phase (8 test items), participants are asked which stimulus combines better with stimulus S: stimulus D1 or stimulus D2. Condition 1 participants are expected to have a larger preference for stimulus D2 than Condition 2 participants. This should be reflected by a main effect of Condition on choosing stimulus D1/D2.
# Descriptives
#Stimulus Choice depending on condition
table(CAT_Test$Condition, CAT_Test$AnswerStim)
##
## D1 D2
## Condition 1 116 84
## Condition 2 144 48
#Proportion choosing Stimulus D1 depending on condition
tapply(CAT_Test$AnswerStimD1,list(CAT_Test$Condition),mean,na.rm=TRUE)
## Condition 1 Condition 2
## 0.58 0.75
#Proportion choosing Stimulus D2 depending on condition
tapply(CAT_Test$AnswerStimD2,list(CAT_Test$Condition),mean,na.rm=TRUE)
## Condition 1 Condition 2
## 0.42 0.25
Plot the stimulus choice (D1/D2) per Condition
p
Overall, there is a preference for stimulus D1. However, according to our expectations, this preference is smaller for participants in the Condition 1.
Set contrast for Condition 1 vs Condition 2, as well as a contrast for the position of D2 during the test question, which was counterbalanced left/right
#Condition
CAT_Test$Condition <- as.factor(CAT_Test$Condition)
contrast <- cbind(c(+0.5, -0.5)) # Condition 1, Condition 2
colnames (contrast) <- c("-Condition2+Condition1")
contrasts (CAT_Test$Condition) <- contrast
contrasts(CAT_Test$Condition)
## -Condition2+Condition1
## Condition 1 0.5
## Condition 2 -0.5
CAT_Test$PositionD2 <- as.factor(CAT_Test$PositionD2)
contrast <- cbind(c(+0.5, -0.5)) # Left, Right
colnames (contrast) <- c("+Left-Right")
contrasts (CAT_Test$PositionD2) <- contrast
contrasts(CAT_Test$PositionD2)
## +Left-Right
## Left 0.5
## Right -0.5
Testing whether odds of choosing for stimulus D2 depend on Condition. Expectation: participants in Condition 1 are more likely to choose stimulus D2 while participants in Condition 2 are more likely to choose stimulus D1 (so less likely to choose stimulus D2). A significant positive main effect of Condition on the odds of choosing stimulus D2 would show a learning effect.
model1 <- glmer(AnswerStimD2~Condition*PositionD2+(PositionD2|Subject), data=CAT_Test, family = binomial,control=glmerControl(optimizer="bobyqa", optCtrl=list(maxfun=2e5)))
options(width=500)
summary(model1)
## Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
## Family: binomial ( logit )
## Formula: AnswerStimD2 ~ Condition * PositionD2 + (PositionD2 | Subject)
## Data: CAT_Test
## Control: glmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 2e+05))
##
## AIC BIC logLik deviance df.resid
## 452.0 479.8 -219.0 438.0 385
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.6205 -0.5417 -0.3281 0.6517 2.4595
##
## Random effects:
## Groups Name Variance Std.Dev. Corr
## Subject (Intercept) 2.212 1.487
## PositionD2+Left-Right 1.941 1.393 -0.48
## Number of obs: 392, groups: Subject, 49
##
## Fixed effects:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -1.1128 0.2788 -3.991 6.57e-05 ***
## Condition-Condition2+Condition1 1.2745 0.5346 2.384 0.0171 *
## PositionD2+Left-Right 0.7259 0.4075 1.781 0.0748 .
## Condition-Condition2+Condition1:PositionD2+Left-Right -0.5753 0.7421 -0.775 0.4382
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Cn-C2+C1 PD2+L-
## Cndtn-C2+C1 -0.173
## PstnD2+Lf-R -0.400 0.118
## C-C2+C1:PD2 0.125 -0.353 -0.292
### Compute profile confidence intervals for the Condition effect
ci <- confint (model1, parm = "Condition-Condition2+Condition1")
lower.bound.logodds.model1 <- ci ["Condition-Condition2+Condition1", 1]
upper.bound.logodds.model1 <- ci ["Condition-Condition2+Condition1", 2]
lower.bound.odds.model1 <- exp(lower.bound.logodds.model1)
upper.bound.odds.model1 <- exp(upper.bound.logodds.model1)
#Estimate and CI Condition effect:
exp(1.2745) # 3.576913
lower.bound.odds.model1 #1.295335
upper.bound.odds.model1 #11.49572
### Compute profile confidence intervals for the PositionD2 effect
ci <- confint (model1, parm = "PositionD2+Left-Right")
lower.bound.logodds.model1 <- ci ["PositionD2+Left-Right", 1]
upper.bound.logodds.model1 <- ci ["PositionD2+Left-Right", 2]
lower.bound.odds.model1 <- exp(lower.bound.logodds.model1)
upper.bound.odds.model1 <- exp(upper.bound.logodds.model1)
#Estimate and CI PositionDC2 effect:
exp(0.7259) # 2.06659
lower.bound.odds.model1 #0.9669446
upper.bound.odds.model1 #5.294853
According to our expectations, participants in Condition 1 were 3.6 (95% CI: 1.3 … 11.5) times more likely to choose stimulus D2 than participants in the Condition 2, z = 2.384, p = 0.017.
Participants were 2.1 (95% CI: 0.97 … 5.3) times more likely to choose stimulus D2 when it was positioned left than when it was positioned right, but the effect of PositionD2 was not significant: z = 1.781, p = 0.075.
In our posthoc test we asked 32 adults whether they thought D1 or D2 looked more like S (4 questions). There was no learning phase. Is there an “a priori” preference for S+D1?
stimulus choice (D1/D2) posthoc test
p
Did participants choose stimulus D1 more often then would be predicted by chance?
t.test(posthoc$AnswerStimD1, mu=0.5)
##
## One Sample t-test
##
## data: posthoc$AnswerStimD1
## t = 6.5064, df = 127, p-value = 1.611e-09
## alternative hypothesis: true mean is not equal to 0.5
## 95 percent confidence interval:
## 0.6739665 0.8260335
## sample estimates:
## mean of x
## 0.75
Answer: yes. There seems to be a preference for the combination S+D1 as opposed to S+D2.