I have a data frame
str(Context)
'data.frame': 120 obs. of 4 variables:
$ Obs : Factor w/ 6 levels "A","B","C","D",..: 1 1 1
$ TargCntr: num 0 0.002 0.004 0.006 0.008 0 0.
$ NumYes : int 0 0 5 18 23 24 22 22 22 24 ...
$ NumNo : int 24 24 19 6 1 0 2 2 2 0 ...
and find that if I run lmList as follows, I get an error message
in which names from the data frame are not found if enclosed in
a cbind for the LHS of formula (for a binomial family)
lmList(cbind(NumYes, NumNo) ~ TargCntr | Obs,
data = Context, family = binomial)
Error in cbind(NumYes, NumNo) : object 'NumYes' not found
...
but it works fine if I either define a 2 column matrix in my
workspace or add one to the data frame.
resp <- with(Context, cbind(NumYes, NumNo))
lmList(resp ~ TargCntr | Obs, Context, binomial)
Call: lmList(formula = resp ~ TargCntr | Obs, data = Context, family =
binomial)
Coefficients:
(Intercept) TargCntr
A -0.8574118 369.1977
B -0.8048122 425.1355
...