Displaying 2 results from an estimated 2 matches for "tolerance1_pp".
2010 Jan 18
3
add spline to longitudinal data - preferably similar to SAS's 'I=SM50S' routine
...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
2013 Jan 17
3
Colors in interaction plots
...but not with the other plots, from the NPK
dataset:
# from http://www.ats.ucla.edu/stat/r/examples/alda/ch2.htm
tolerance <- read.csv("http://www.ats.ucla.edu/stat/r/examples/alda/data/tolerance1.txt")
tolerance.pp <-
read.csv("http://www.ats.ucla.edu/stat/r/examples/alda/data/tolerance1_pp.txt")
attach(tolerance.pp)
# fitting the linear model by id
fit <- by(tolerance.pp, id, function(bydata)
fitted.values(lm(tolerance ~ time, data=bydata)))
fit <- unlist(fit)
# plotting the linear fit by id
interaction.plot(age, id, fit, xlab="age", ylab="tolerance")...