# NOT RUN {
<!-- % checked in test-confint.R -->
# }
# NOT RUN {
data("wafers")
wfit <- HLfit(y ~X1+(1|batch),family=Gamma(log),data=wafers,method="ML")
confint(wfit,"X1") # profile CI
if (spaMM.getOption("example_maxtime")>30) {
# bootstrap CI induced by 'boot_args':
confint(wfit,names(fixef(wfit)), boot_args=list(nsim=99, seed=123))
# bootstrap CI induced by 'parm' being a function:
confint(wfit,parm=function(v) fixef(v),
boot_args=list(nb_cores=10, nsim=199, seed=123))
# Same effect if 'parm' is a quoted expression in terms of 'hlfit':
confint(wfit,parm=quote(fixef(hlfit)),
boot_args=list(nb_cores=10, nsim=199, seed=123))
# CI for the variance of the random effect:
( ci <- confint(wfit,parm=function(fit){VarCorr(fit)[1,"Variance"]},
boot_args=list(nb_cores=10, nsim=199, seed=123)) )
# The distribution of bootstrap replicates:
plot(ecdf(ci$call$t))
# We may be far from ideal condition for accuracy of bootstrap intervals;
# for variances, a log transformation may sometimes help, but not here.
}
# }
Run the code above in your browser using DataLab