data(simdat)
if (FALSE) {
infoMessages('on')
# some arbitrary models:
m1 <- bam(Y~Group + s(Time, by=Group), method='ML', data=simdat)
m2 <- bam(Y~Group + s(Time), method='ML', data=simdat)
compareML(m1, m2)
# same models, but now with fREML (default):
m1 <- bam(Y~Group + s(Time, by=Group), data=simdat)
m2 <- bam(Y~Group + s(Time), data=simdat)
compareML(m1, m2)
# exclude significance stars:
compareML(m1, m2, signif.stars=FALSE)
# same model as m1, increased k:
m3 <- bam(Y~Group + s(Time, by=Group, k=25), method='fREML',
data=simdat)
compareML(m1, m3)
# do not print output, but save table for later use:
cml <- compareML(m1, m2, print.output=FALSE)$table
cml
# Use suppressWarnings to also suppress warnings:
suppressWarnings(cml <- compareML(m1, m2, print.output=FALSE)$table)
}
Run the code above in your browser using DataLab