[R-sig-ME] syntax for indicating fixed covariates in nlmer ?

Douglas Bates bates at stat.wisc.edu
Wed Mar 11 13:30:38 CET 2009

On Wed, Mar 11, 2009 at 6:20 AM, Ben Bolker <bolker at ufl.edu> wrote:
> Laurent Gentzbittel wrote:
>> Dear all,
>> I would like to use the nlmer for fitting logistic curves to disease
>> index curves. I'm typically comparing different plant lines (several
>> plants from each line are subjected to a pathogen) and would like to
>> test if the 'population' (fixed effects) parameters of the curves are
>> the same between the lines.
>> I need to specify a random effect for each parameter to account for
>> plant-to-plant variability and a fixed effect for some parameter to
>> account for 'general' differences among lines.
>> I previously used the nlme function of the nlme package and was able to
>> specify both fixed and random effects for each parameter, including a
>> fixed covariate 'line' for example.
>> I would like to switch to the lme4 package, but I was unable to find how
>> to specify fixed covariates (fixed effects) in the formula.
>> A search in the different mail lists and Googl'ing  was also unsuccessful.
>   The fixed effects formula looks just like that in nlme.  The random
> effects are specified differently -- where nlme would use (for example)
> fixed=response~(something),random=~1|plant+a|plant+b|plant
> nlmer would use
> formula = response~(something)+(1|plant)+(a|plant)+(b|plant)

I think Laurent and Dieter might have been asking a different
question.  In a nonlinear mixed-effects model the nonlinear model
function incorporates covariates and "nonlinear model parameters".
For example, the four-parameter logistic model is a function of a
covariate, often something like log-dose, and four parameters that
could be the asymptote on the left, the asymptote on the right, the
midpoint and a scale parameter.


produces a plot showing these.

I think the question was how to express an NLMM in which one of these
parameters, say the midpoint, xmid, incorporates the effect of a
covariate like treatment group.

If that is the question then the answer is "not easily at present".
The development version of nlmer, in the branches/allcoef section of
the SVN repository, has the capability of doing that.  That's the good
news.  The bad news is that the syntax of the formula has changed a
bit and I don't want to release the development branch until I can
resolve problems with GLMMs in that branch.

I am having some bizarre problems with GLMMs there - the sort of
problem that will seem trivial once I know the answer but right now is
very frustrating.  For some reason the current code fits Poisson GLMMs
like a charm and diverges on Bernoulli GLMMs and binomial GLMMs.

What I will do is to polish up the documentation of the nlmer function
over the next few days so the brave (or foolhardy, depending on your
point of view) user can fit those models.  Then I will try to get the
binomial GLMMs happy again.

More information about the R-sig-mixed-models mailing list