Hi,
xyplot(threshold ~ age |frequency.a, data=rage,
groups=HL,
cex=0.5,
layout=c(7,4),
par.strip.tex=list(cex=0.8),
xlab="Age (years)",
ylab="Threshold (dB SPL)",
na.rm="TRUE",
panel=function(x,y,groups,...) {
panel.superpose(x,y,groups=HL,...)
# panel.abline(segmented(lm(threshold~age),seg.Z = ~age, psi = NA, control =
seg.control(K=1)))
panel.abline(lm(threshold~age))
},
)
Is there anyway to make the commented line work in lattice? I need to fit my
data in each panel using piecewise regression. Being able to use segmented
would make it easy.
The code above works to give me a linear fit.
Thanks for your help in advance.
Regards,
Sumit
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.