Reputation: 313
I estimated a random coefficient discrete-time hazard model with the following command:
(logit.model <-
glmer(event ~
a1
+ a2
+ a3
+ a4
+ high * I(a5 - 2)
+ midup * I(a5 - 2)
+ obsnum1 + obsnum2 + obsnum3
+ (1 + obsnum1 + obsnum2 + obsnum3 | country_cluster),
family=binomial("logit"), data=data.final,
verbose=TRUE, control=list(maxIter=400)))
Now I would like to calculate the deviance residuals by using the following command:
data.final.r <- cbind(data.final,
dev.res = residuals(logit.model,
type="deviance"))
Unfortunately, I get the following error command:
"$ operator not defined for this S4 class".
Does anyone knows, where the errror could come from, how it can be solved or how the deviance residuals can be calculated alternatively?
Any help would be appreciated very much!
Upvotes: 0
Views: 944
Reputation: 4223
This has to do with the version of lme4
you are using. You can check the version you have with:
packageVersion("lme4")
Is this a stable version you got from CRAN, then get the latest using update.packages()
or install.package(lme4)
)
Is it a development version, which seems to be the case, then get the latest development release using:
install.packages("lme4",repos="http://lme4.r-forge.r-project.org/repos")
Warning: if you were using a stable/CRAN version, changing to the development release may break stuff in your code.
Upvotes: 1