data(simdat)
infoMessages("on")
# some arbitrary models:
m1 <- bam(Y~Group + s(Time, by=Group), method="fREML", data=simdat)
m2 <- bam(Y~Group + s(Time), method="fREML", data=simdat)
compareML(m1, m2)
# exclude significance stars:
compareML(m1, m2, signif.stars=FALSE)
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
# alternative way:
infoMessages('off')
cml <- compareML(m1, m2, print.output=FALSE)$table
infoMessages('on')
# Use suppressWarnings to also suppress warnings:
suppressWarnings(cml <- compareML(m1, m2, print.output=FALSE)$table)
Run the code above in your browser using DataLab