#NOT RUN
#Example 1. The Dale's model
data(ulcer)
m1 <- pblm(fo1=cbind(pain,medication)~1, fo12=~I(operation=="vh"), RC.fo=~Col,
data=ulcer, weights=freq, contrasts=list(Col="contr.SAS"))
summary(m1)
# Example 2. An artificial data set:
set.seed(1234)
da <- expand.grid("Y1"=1:3,"Y2"=1:3,"fat1"=0:9,"fat2"=0:1)
da$x1 <- seq(-5,5,l=180)
da$x2 <- rnorm(180)
da$Freq <- sample(5:30,180,replace=TRUE)
m1 <- pblm(fo1=cbind(Y1,Y2) ~ pbs(x1) + fat2,
fo2=~pb(x1) + x2,
fo12=~pb(x1) + x2, data=da, weights=Freq)
plot(m1)
Run the code above in your browser using DataLab