attempt mixed-effects logistic regression. it doesn’t like that.

model1 <- glmer(ChoseShape ~ Condition + TotalChoices + (1|SubjID), combined, family="binomial")
summary(model1)
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: ChoseShape ~ Condition + TotalChoices + (1 | SubjID)
##    Data: combined
## 
##      AIC      BIC   logLik deviance df.resid 
##    250.9    263.8   -121.4    242.9      184 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -0.9589 -0.9520 -0.6351  1.0429  1.5803 
## 
## Random effects:
##  Groups Name        Variance  Std.Dev. 
##  SubjID (Intercept) 1.138e-14 1.067e-07
## Number of obs: 188, groups:  SubjID, 32
## 
## Fixed effects:
##               Estimate Std. Error z value Pr(>|z|)   
## (Intercept)  -0.126761   2.147791  -0.059   0.9529   
## Condition    -0.824078   0.308180  -2.674   0.0075 **
## TotalChoices  0.007123   0.366038   0.019   0.9845   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Condtn
## Condition   -0.001       
## TotalChoics -0.995 -0.063
## convergence code: 0
## singular fit

linear regression

model2 <- lm(NumShape ~ Condition + TotalChoices, wide)
summary(model2)
## 
## Call:
## lm(formula = NumShape ~ Condition + TotalChoices, data = wide)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.8674 -0.7599  0.1326  0.4901  2.1326 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    1.1098     2.5199   0.440  0.66289   
## Condition     -1.1433     0.3801  -3.008  0.00539 **
## TotalChoices   0.2929     0.4311   0.680  0.50219   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.072 on 29 degrees of freedom
##   (3 observations deleted due to missingness)
## Multiple R-squared:  0.2422, Adjusted R-squared:  0.1899 
## F-statistic: 4.634 on 2 and 29 DF,  p-value: 0.01794

regression with poisson distribution because that’s more appropriate for count data

model3 <- glm(NumShape ~ Condition + TotalChoices, wide, family="poisson")
summary(model3)
## 
## Call:
## glm(formula = NumShape ~ Condition + TotalChoices, family = "poisson", 
##     data = wide)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8510  -0.5573   0.0735   0.3167   1.1334  
## 
## Coefficients:
##              Estimate Std. Error z value Pr(>|z|)  
## (Intercept)    0.2902     1.6258   0.179   0.8583  
## Condition     -0.5175     0.2437  -2.123   0.0337 *
## TotalChoices   0.1276     0.2770   0.461   0.6450  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for poisson family taken to be 1)
## 
##     Null deviance: 23.462  on 31  degrees of freedom
## Residual deviance: 18.689  on 29  degrees of freedom
##   (3 observations deleted due to missingness)
## AIC: 105.41
## 
## Number of Fisher Scoring iterations: 5

look at individual kids’ performance

English

ggplot(filter(wideGraph, Condition==0), aes(choiceType, choice, fill=choiceType))+
  geom_col()+
  theme_classic()+
  facet_wrap(~SubjID, nrow=4, ncol=4)

Spanish

ggplot(filter(wideGraph, Condition==1), aes(choiceType, choice, fill=choiceType))+
  geom_col()+
  theme_classic()+
  facet_wrap(~SubjID, nrow=4, ncol=4)