Dear allstat,
currently I am stuck because I don't find suitable software to do a
particular nonlinear regression analysis. I would like to fit the following
model by maximum likelihood to a dataset:
p=q*exp(-mu*t),
where p is the probability of success (binary outcome variable), t is a
covariate (without measurement error) and mu ∈{R+} and q ∈[0,1] are
parameters to be estimated (at a later stage I would like to model them on
covariates).
I'm using R, and I could just write a function that calculates the
likelihood, and use optim() to fit the model. But this would mean that e.g.
fitting random effects models would become tedious, and I don't want to
re-invent the square wheel.
Is there an R function that can do that, or one that could be tweaked into
doing it?
As far as I understand, the nls() function does iterated least squares
fitting for nonlinear models, but i don't think it can deal with binary
outcomes (rather assuming normal distribution of residuals).
glm(), on the other hand, seems to have sufficiently customizable link
functions** to do something like that, but is not made for fitting
non-linear models (as far as i understand least squares fit is only a ML
estimator for linear models, assuming the correct distribution of
residuals).
I can't believe that fitting nonlinear models directly specifying the
probability of success (as opposed to specifying a logit-probability) should
be so hard.
So, is there a suitable function, or can e.g. the nls() or gnls() functions
be tweaked into doing this regression?
regards
Michael
--
Michael Bretscher
Swiss TPH
Department of Epidemiology and Public Health (EPH)
Socinstrasse 57
P.O . Box
CH-4002 Basel
Switzerland
Tel +41 61 284 87 08
email: [log in to unmask]
http://www.swisstph.ch/en/research/public-health-and-epidemiology/biostatistics.html
You may leave the list at any time by sending the command
SIGNOFF allstat
to [log in to unmask], leaving the subject line blank.
|