Here is my dumb example how I would do it. I'll just generate some random data. Basically you take the difference of the scores of A and B and use your glm model.
> library(lme4)
> df=data.frame(thot=rep(c("Alice","Barbara"),each=50),
> value=runif(100,-10,10)-runif(100,-10,10))
> df$cup=factor(sample(rep(c("A","B"),each=50)))
> summary(glmer(cup~value+(1|thot),data=df,family=binomial(link="logit")))
Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) ['glmerMod']
Family: binomial ( logit )
Formula: cup ~ value + (1 | thot)
Data: df
AIC BIC logLik deviance df.resid
142.9 150.7 -68.4 136.9 97
Scaled residuals:
Min 1Q Median 3Q Max
-1.33077 -1.00604 0.00095 0.99804 1.31654
Random effects:
Groups Name Variance Std.Dev.
thot (Intercept) 0 0
Number of obs: 100, groups: thot, 2
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.02589 0.20274 -0.128 0.898
value 0.03221 0.02444 1.318 0.187
Correlation of Fixed Effects:
(Intr)
value -0.097
Edit sample of data
> head(df)
thot value cup
1 Alice 2.899886 B
2 Alice 9.030560 B
3 Alice 1.281790 B
4 Alice 16.263392 B
5 Alice -5.369385 A
6 Alice 6.438415 A
First, what's the data frame look like? Is it one column for 'Alice' or 'Barbara', and another column for 'difference'? So, one column looks like 'alice, alice, alice, barbara, barbara, alice...', and the other looks like '-2, -5, 6, -1, 4...' ?
Second, what's 'thot' here?
thanks again... (new (ish) to models)
– cathalcom Feb 06 '19 at 15:35