import("lme4")
import("partykit")
import("Formula")
import("grid")

importFrom("utils", "globalVariables", "installed.packages")
importFrom("graphics", "plot")
importFrom("stats", "coef", "logLik", "model.frame", "predict", "terms", "update", 
           "residuals", "as.formula", "complete.cases", "model.response", "qlogis", "weights")
importFrom("grDevices", "devAskNewPage", "gray")
importFrom("graphics", "boxplot", "hist")
importFrom("stats", "model.matrix", "na.omit", "relevel", "binomial")

export(
  "lmertree",
  "glmertree",
  "betamertree",
  "cv.lmertree",
  "cv.glmertree"
)

S3method("print", "lmertree")
S3method("print", "glmertree")
S3method("plot", "lmertree")
S3method("plot", "glmertree")
S3method("coef", "lmertree")
S3method("coef", "glmertree")
S3method("fixef", "lmertree")
S3method("fixef", "glmertree")
S3method("ranef", "lmertree")
S3method("ranef", "glmertree")
S3method("logLik", "lmertree")
S3method("logLik", "glmertree")
S3method("model.frame", "lmertree")
S3method("model.frame", "glmertree")
S3method("predict", "lmertree")
S3method("predict", "glmertree")
S3method("residuals", "lmertree")
S3method("residuals", "glmertree")
S3method("terms", "lmertree")
S3method("terms", "glmertree")
S3method("as.party", "lmertree")
S3method("as.party", "glmertree")
S3method("VarCorr", "lmertree")
S3method("VarCorr", "glmertree")

S3method("print", "betamertree")
S3method("plot", "betamertree")
S3method("coef", "betamertree")
S3method("fixef", "betamertree")
S3method("ranef", "betamertree")
S3method("logLik", "betamertree")
S3method("model.frame", "betamertree")
S3method("predict", "betamertree")
S3method("residuals", "betamertree")
S3method("terms", "betamertree")
S3method("as.party", "betamertree")
S3method("VarCorr", "betamertree")

S3method("summary", "cv.lmertree")
S3method("summary", "cv.glmertree")