[R] add spline to longitudinal data - preferably similar to SAS's 'I=SM50S' routine

Eric Fail e at it.dk
Tue Jan 19 00:25:25 CET 2010


Hi Ruser

I'm trying to replicate some SAS code. I have to add a spline to my  
longitudinal spaghetti plot.

I have the plot, but I can't add the spline, a overall trend line. In  
the SAS code they use the command   'I=SM50S' and I would prefer  
something similar. I’m using R 2.10.1 on windows XP…

I have made this working example.

tolerance.pp <- read.table("http://www.ats.ucla.edu/stat/R/examples/alda/tolerance1_pp.txt 
", sep=",", header=T)
# install.packages("lattice", dep = T)
library(lattice)
xyplot(tolerance ~ age, groups = id, data=tolerance.pp, type = "l")

This is where I want to add a overall spline.

Hope someone out there can figure this out.

Thanks

Eric


More information about the R-help mailing list