# \donttest{
library(lme4)
data("clustertraindata")
data("clustertestdata")
mFit = glmer(y ~ x1 + x2 + x3 + x5 + (1 | cluster),
data = clustertraindata, family = "binomial")
preds = predict(mFit, clustertestdata, type = "response", re.form = NA)
y = clustertestdata$y
cluster = clustertestdata$cluster
valClusterData = data.frame(y = y, preds = preds, center = cluster)
# Assess calibration performance
Results = valProbCluster(
p = valClusterData$preds, y = valClusterData$y, cluster = valClusterData$center,
plot = TRUE,
approach = "MIXC", method = "slope", grid_l = 100
)
Results
# }
Run the code above in your browser using DataLab