Dear all, I am working on a data set in which I have sequentially measured egg temperatures ("eggtemp") in birds incubating in different ambient temperatures ("treat", sample data set below), "id" is not replicated within treatment.
id treat eggtemp 1 79 3 30.90166 2 42 3 34.94044 3 10 3 32.69945 4 206 3 36.64127 5 23 3 31.80055 6 5 3 29.98338 7 24 3 35.72992 8 45 3 30.49584 9 29 3 33.64958 10 78 3 31.37673 11 44 3 32.85873 12 368 3 34.44875 13 79 4 31.24100 14 42 4 34.11634 15 10 4 34.73407 16 206 4 36.20914 17 23 4 34.98061 18 5 4 34.17590 19 24 4 37.71468 20 45 4 35.34765 21 29 4 35.48892 22 78 4 33.26593 23 44 4 34.86981 24 368 4 34.44875 25 79 2 27.33241 26 42 2 30.73269 27 10 2 29.54986 28 206 2 31.78947 29 23 2 29.69114 30 24 2 36.48199 31 45 2 29.76454 32 29 2 30.56510 33 78 2 27.71468 For this data, I want to construct a model with a random intercept and slope to compare with a model containing only the random intercept to check whether or not different individuals respond differently to treatment. > temp2.lme<-lme(eggtemp~treat,random=~treat|id,data=temp3.df) However, I get the below error, which I suspect might be because individuals are not replicated within treatments. > nlminb problem, convergence error code = 1 message = iteration limit reached without convergence (9) If I specify treatment as a factor (which it really is not, just different ambient temperatures), the model seems to converge. Similarly, the model converges if I exclude one of the treatment levels. However, this does not feel very satisfactorily. So, how do I move on from here? Any tips and hints are much appreciated. I have tried to include the random slope only, which also works, but the inference for such a model would be quite different and not really what I am after. > temp3.lme<-lme(eggtemp~treat,random=~treat-1|id,data=temp3.df) Kind regards, Andreas Nord Lund University Sweden -- View this message in context: http://n4.nabble.com/random-slope-models-with-lme-failured-to-converge-tp1469575p1469575.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.