Dear mixed modellers, especially non-linear mixed modellers,

I have spent some time searching for answers on this topic, and I apologise in advance if I have missed something on the topic.  I apologise if it requires a reproducible example, which i haven't yet managed to produce.

I have used the nlme() function in the nlme() package for some time for plant growth analysis, with good success.

Following the tip from Ben Bolker I have read  Madsen and Thyregod's extension of the orange tree analysis in "Introduction to General & Generalized Linear Models".  Excellent tip - thank you!

>From this I believe that the ability to add crossed random effects for the measurement time point, would help fitting with some of my tree growth datasets.

For this particular dataset I have about 800 trees from 12 different species growth in 3 different light environments. There are 5 repeated measures on each individual over the course of a year.

The current power law model fits well, but I haven't managed to directly compare to nlme as I haven't managed to include fixed effects other than the fixed estimate of M0, Amax and beta - whereas in nlme I have Amax varying with continuous light.  I had concluded that the approach with nlmer() is to have everything as random effects.  I would be happy to keep everything as random effects, but does anyone know how to add in the effect of a continuous variable (such as light here), on one of the parameters (like Amax here).

My next step would be to try AD Model Builder as suggested by Ben Bolker, but using lme4 would be much preferable as I have a nice analysis using glmer() for the mortality data on the same dataset

So the main question is how to add in continuous covariates into nlmer() in a similar way to nlme

I have been running these models using both the lme4 package and lme4a. I get to a level of complexity that runs in lme4a but not in lme4.  However any models I try today with lme4a give the following error message.

"Error in .local(x, ...) : 
  the leading minor of order 4 is not positive definite"

The code is identical to that I'm running successfully in lme4.  Any ideas?

Thank you everyone for your debugging input.  I hope that I haven't broken any of the rules too badly.  I am also happy to do more beta testing of new versions of nlmer() in return!

Cheers
Chris

power.law <- deriv(expression((( ( M0 )^(1-beta))+ exp(Amax)*(1-beta)*x)^(1/(1-beta))),
							c("M0", "Amax", "beta"), function(x, M0, Amax, beta) {})
	
nlmer3a <- nlmer(total.mass ~ power.law(day, M0, Amax, beta) ~
					 M0 + Amax + beta
					 + (Amax + beta |Seedling_no2)
					 + (M0|Species)
					 + (beta |MeasurementDay)
	                		 + (Amax |Species)
					 + (Amax |Light),
					 data=datNEW,			 
					 start=mystart,
					 REML=FALSE,
					 nAGQ=0, 
					 verbose=TRUE);

Dr. Christopher Philipson
Institute of Evolutionary Biology and Environmental Studies,
Winterthuerstrasse 190,
CH-8057,
Zurich
Tel:  00 41 44 635 61 29
Fax: 00 41 44 635 57 11
christopher.philipson@ieu.uzh.ch





	[[alternative HTML version deleted]]


