4

Im trying to plot continuous percentiles of a variable against another variable. Ive found the package gamlss which lets me do pretty much that.

data(iris)
(gamlss)
(gamm4)
r1<-gamlss(Sepal.Length~cs(Sepal.Width, 3), sigma.formula=~cs(Sepal.Width, 3), data=iris, family=BCT)

centiles(r1,cent = c(2.5, 5, 10, 50, 90, 95, 97.5), 
         pch=1,cex=0.5,col="black", 
         main="Centile curves for sepal width", 
         iris$Sepal.Width)

enter image description here

However, I have multilevel data, and id like to account for that, since the upper limit in this model primarily represents the group with the highest distribution.

Ive found the package gamm4, which seems to account for multilevel data, however im not sure about the output.

r2 <- gamm4(Sepal.Length~s(Sepal.Width),data=iris,random=~(1|Species), family= "poisson")
plot.gam(r2$gam)

enter image description here

I was wondering if there is a way to add percentile lines, or is that not possible in a multilevel GAMLSS? Also, it seems the output only gives an association line/curve, is it possible to show absolute values?

Thanks in advance

Jajo123
  • 75
  • 4

0 Answers0