[R] NLME - multilevel model using binary outcome - logistic regression

Douglas Bates bates at stat.wisc.edu
Tue May 13 18:09:40 CEST 2003

"Andrej Kveder" <andrejk at zrc-sazu.si> writes:

> I just want to followup on my earlier question. I tried fitting a nonlinear
> regression using the NLS and specified a following model.
> model.1<-nls(clinton ~ 1/(1 + exp(-(sex + educ + age))), data=elect)
> The testing data set I'm using is on the US election polls. Clinton is a
> binary outcome (1-vote, 0-no-vote).
> However I get the following error message.
> Error in match.call(definition, call, expand.dots) : .Primitive... is not a
> function
> What am I doing wrong?
> I know that for the single level models R has better functions (e.g. lrm or
> glm), I used them before with success. However in the final instance I want
> to fit a multilevel model with a binary outcome variable as a simple binary
> logistic model.
> I would be thankfull for all the insights.

As I understand it you are trying to fit a generalized linear mixed
model.  For that you should use one of the functions for GLMMs.  I
would recommend glmmPQL from the MASS package.

Your problem with the call to nls is that you did not include all the
required arguments but, since you don't want to use nls to fit this
model, there is no purpose in following up on that.

More information about the R-help mailing list