# NOT RUN {
data(simdat)
# simulate some missing data:
simdat[sample(1:nrow(simdat), size=15),]$Y <- NA
simdat[sample(1:nrow(simdat), size=7),]$Group <- NA
# Fit simple GAM models:
gam1 <- bam(Y ~ s(Time), data=simdat, discrete=TRUE)
gam2 <- bam(Y ~ Group + s(Time, by=Group), data=simdat, discrete=TRUE)
# number of data points in data frame:
nrow(simdat)
# observations model gam1:
observations(gam1)
# observations model gam2:
observations(gam2)
# }
Run the code above in your browser using DataLab