## fit sitar model
m1 <- sitar(x=age, y=height, id=id, data=heights, df=7)
## draw fitted distance and velocity curves
## with velocity curve in blue
## adding age at peak velocity
plot(m1, y2par=list(col='blue'), apv=TRUE)
## draw individually coloured growth curves adjusted for random effects
## using same x-axis limits as for previous plot
plot(m1, opt='a', col=id, xlim=xaxsd())
## add mean curve in red
lines(m1, opt='d', col='red', lwd=2)
## add mean curve for a, b, c = -1 SD
lines(m1, opt='d', lwd=2, abc=-sqrt(diag(getVarCov(m1))))
Run the code above in your browser using DataLab