Re: [R] need help on nlme()

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon 20 Feb 2006 - 21:52:10 EST

On Mon, 20 Feb 2006, ronggui wrote:

> I think nlme is not for logistic mixed effect model.
> you should use glmmPQL in MASS or lmer in Matrix

There are two senses of 'logistic mixed effect model'. One is for a continuous response as given by SSlogis, and nlme is appropriate. The other is a glm with a binomial (or binary) response, and nlme is inappropriate.

The issue here is that when the fixed includes an rhs, there are parameters for intercept and slope for each level of SKILLS, although they will be coded using contrasts. So 2 starting values are not enough.

>
> 2006/2/20, Mingyu Feng <mingyufeng@gmail.com>:
>> Hello there,
>>
>> I am using nlme() to fit a logistic mixed effect model on our data.
>> The outcome variable is binary.
>> I got the error when I wanted to add a group factor to my model.
>>
>> My initial model is as below:
>>
>> model.a <- nlme(response~ 1/(1 + exp( -intercept- u0 - slope*TIME -
>> u1*TIME)),
>> + fixed=intercept+slope~1, random= u0+u1~1
>> |studentID,
>> + start=c(slope=.01, intercept=-1), data=log.data,
>> method='ML')
>>
>> This works fine on my data. But when i update it by adding a group factor
>> SKILLS,
>> I got the error message:
>> "Error in nlme.formula(response ~ 1/(1 + exp( -intercept- u0 - slope*TIME
>> :
>> starting values for the fixed component are not the correct length"
>>
>> The model is as below:
>> model.a <- nlme(response~ 1/(1 + exp( -intercept- u0 - slope*TIME -
>> u1*TIME)),
>> + fixed=intercept+slope ~ SKILLS, random= u0+u1~1
>> |studentID,
>> + start=c(slope=.01, intercept=-1), data=log.data,
>> method='ML')
>>
>> Does anybody see anything wrong with the "start" part of this model?
>>
>> Thanks a lot!!
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>
>
>
> --
> ٹ
> Deparment of Sociology
> Fudan University
>
>

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Received on Mon Feb 20 21:55:40 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:36 EST