# NOT RUN {
data(simdat)
# }
# NOT RUN {
# models take somewhat longer time to run:
# Fit simple GAM model:
gam1 <- bam(Y ~ s(Time), data=simdat, discrete=TRUE)
modeledf(gam1)
gam2 <- bam(Y ~ s(Time)+s(Time, Subject, bs='fs', m=1),
data=simdat, discrete=TRUE)
modeledf(gam2)
gam3 <- bam(Y ~ Subject+s(Time, by=Subject),
data=simdat, discrete=TRUE)
modeledf(gam3)
gam4 <- bam(Y ~ Group+s(Time)+s(Time, Subject, bs='fs', m=1),
data=simdat, discrete=TRUE)
modeledf(gam4)
gam5 <- bam(Y ~ Group+s(Time, by=Group)+s(Time, Subject, bs='fs', m=1),
data=simdat, discrete=TRUE)
modeledf(gam5)
# Fit a gamm:
gam6 <- gamm(Y ~ Group+s(Time), random=list(Subject=~1) data=simdat, discrete=TRUE)
# this produces an error...
modeledf(gam6)
# ... but this works:
modeledf(gam6$gam)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab