I'm trying to replicate some results that were published in "Linear Quantile mixed models", Geraci M. and Bottai M. (2013). The data can be downloaded from: http://www.hsph.harvard.edu/fitzmaur/ala/tlc.txt
I am using linear quantile mixed model, with natural cubic splines (df=3, break points 0, 4, 6) and random effects. I have created the splines using
t1.t2 <-ns(Lead.r$week, df=3, knots=4)
t1.t2
t1 <- t1.t2[1:400, 2]
t1
The quantile mixed model is
.
I can manage to get an output when I model the splines and treatment (interaction and main effects), as given by:
fit.int2 <-lqmm(lead ~ t1.t2*group, random= ~1, group=id,
data=Lead.r, tau=c(0.25, 0.5, 0.75))
However, once I try to put in the T1 and treatment term (main effects and interaction), as below, I get an error.
fit.int2 <-lqmm(lead ~ t1.t2*group+t1*group, random= ~1, group=id,
data=Lead.r, tau=c(0.25, 0.5, 0.75))
Error: NA/NaN/Inf in foreign function call (arg 1)
I'm pretty new to R and quantile mixed models so I'm not sure if this is an error on my behalf, being coding, or lack of knowledge!