My question is quite simple, but I've been unable to find a clear answer in either R manuals or online searching. Is there a good way to verify what your reference is for the response variable when doing a logistic regression with glmer?
I am getting results that consistently run the exact opposite of theory and I think my response variable must be reversed from my intention, but I have been unable to verify.
My response variable is coded in 0's and 1's.
Thanks!
You could simulate some data where you know the true effects ... ?simulate.merMod
makes this relatively easy. In any case,
glmer
inherits its framework from glm
. In particular, ?family
states:For the ‘binomial’ and ‘quasibinomial’ families the response can be specified in one of three ways:
1. As a factor: ‘success’ is interpreted as the factor not having the first level (and hence usually of having the second level). 2. As a numerical vector with values between ‘0’ and ‘1’, interpreted as the proportion of successful cases (with the total number of cases given by the ‘weights’). 3. As a two-column integer matrix: the first column gives the number of successes and the second the number of failures.
Your data are a (common) special case of #2 (the "proportion of successes" is either zero or 100% for each case, because there is only one case per observation; the weights vector is a vector of all ones by default).