[R-sig-ME] Logistic and nonlinear mixed models: Accounting for guessing probability

Manuel Morales Manuel.A.Morales at williams.edu
Mon Sep 27 18:25:24 CEST 2010


I found this link doing a search for your error message on Google:
https://stat.ethz.ch/pipermail/r-sig-mixed-models/2007q4/000408.html

Following the recipe:
grModel <- function(x,y,a,b,c,d) .33 + .67*(exp(log(x)*a+y*b+log(x)*y*c
+ d))/
  (1+exp( log(x)*a + y*b +log(x)*y*c + d))

grModg <- deriv(body(grModel), namevec = c("a","b","c","d"),
function.arg=grModel)

mod3 <- nlmer(Correct~grModg(Concentrat,Test,a,b,c,d)~(Test|Code),
              start = c(a = 0.115, b=-0.1, c=0.65, d=-3),
              data = rawdata)
Which appears to work.

My messages haven't been posted to R, so you may want to post again with
this solution if it works for you.

Best,

Manuel

On Mon, 2010-09-27 at 15:54 +0200, Robert Miller wrote:
> Hello everyone,
> 
> Recently i tried to predict the discrimination probability of a chemosignal
> by its concentration and an experimental manipulation factor (term:
> concentration*x + test*b + concentration*test*c + d) with nested factor
> "manipulation" within "participants". For statistical analysis i needed to
> incorporate a fixed guessing probability into my model (similiar to a 3-PL
> IRT model) resulting in the following equation:
> 
> P(correct) = 0.33 + 0.67*(exp(term)/(1 + exp(term)))
> 
> As i found no way to do so via the glmer()-function of the lme4-package, i
> tried to use nlmer() but unfortunately even the simplest analysis with just
> the concentration factor and intercept resulted in cryptic error messages.
> 
> Syntax:
> library(lme4)
> rawdata <- read.csv2("http://dl.dropbox.com/u/7147679/AND_data.csv")
> 
> mod1 <- glmer(Correct ~ log(Concentrat) * Test + (Test|Code), family =
> binomial, data=rawdata) #works fine but is inappropriate
> mod2 <- nlmer(Correct ~ .33 + .67*(exp(log(Concentrat)*a+d))
> /(1+exp(log(Concentrat)*a+d)) ~ (Test|Code), start = c(a = 0.1, d = -3),
> data = rawdata) #doesnt work
> mod3 <- nlmer(Correct ~ .33 + .67*(exp(log(Concentrat)*a + Test*b +
> log(Concentrat)*Test*c + d))/(1+exp( log(Concentrat)*a + Test*b +
> log(Concentrat)*Test*c + d)) ~ (Test|Code), start = c(a = 0.115,b = -0.05,
> c= 0.065, d= -3), data = rawdata) #doesnt work either
> 
> Even without specifying random effects nls() doesnt work, but brute force
> ML-parameter estimation on the aggregated data produces reasonable results.
> 
> Right now I'm quite desperate and would appreciate any help.
> Thank you
> Robert Miller
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

-- 
http://mutualism.williams.edu




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