Dear all,

I'm attempting to use a piecewise regression to model the trajectory of reproductive traits with age in a longitudinal data set using a mixed model framework. The aim is to find three slopes and two points- the slope from low performance in early age to a point of high performance in middle age, the slope (may be 0) of the plateau from the start of high performance to the end of high performance , and the slope of the decline from the end of high performance to the end of life.

I've found the segmented package useful, but it cannot be implemented in a mixed model framework. I've also attempted piecewise regression using this formula in lmer:

m<-lmer(repro ~ OTHER FIXED EFFECTS + age*(age < 2) + age*(age >= 2 & age < 8) + age*(age >= 8) + (1|id) + (1|yr), data = reproduction, family = binomial, link = "logit", GHQ = TRUE)

However, this gives the warning:

Warning message:
In mer_finalize(ans) : gr cannot be computed at initial par (65)

which is not apparent if I use just two break points or I implement the model in glm.

My question is essentially whether anyone can recommend a method for performing piecewise regression in lmer or another mixed model framework. Any advice would be greatly appreciated.

Regards,

Adam


----------------------------------------------------------------
Adam Hayward
PhD Student
Wild Evolution Group
Institute of Evolutionary Biology
Room 133 Ashworth Laboratories
King's Buildings
University of Edinburgh
West Mains Road
Edinburgh
EH9 3JT

adam.hayw...@ed.ac.uk
http://wildevolution.biology.ed.ac.uk/lkruuk/AdamHayward.html
----------------------------------------------------------------

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

______________________________________________
R-help@r-project.org mailing list
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.

Reply via email to