# NOT RUN {
data(sleepstudy, package = 'lme4')
fm <- lme4::lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
# Deleting every Subject
fmDel <- case_delete(model = fm, level = "Subject", type = "both")
# Deleting only subject 308
del308 <- case_delete(model = fm, level = "Subject", type = "both", delete = 308)
# Deleting a subset of subjects
delSubset <- case_delete(model = fm, level = "Subject", type = "both", delete = 308:310)
# }
Run the code above in your browser using DataLab