I'm trying to fit ELISA plate data to a non-linear mixed effect model, using the nlme function. Previously, I asked about how to make the syntax work for nested groups, though responses made it seem like that was a lost cause. However, I'm still having difficulty producing a model object when just applying a single group.
Sample data can be found here: https://pastebin.com/UzVa04TY
This is my original envisioning of running the NLME function, using separate variables for fixed and random effects (upper- and lower-case letters, respectively). x is the sample dilution factor, while y is ELISA signal density.
# Define the 3-parameter logistic function
logistic3PL <- function(x, A, B, C, a, b, c) {
(A + a) / (1 + (x / (C + c))^ (B + b))
}
# Define the nonlinear mixed effects model
model <- nlme(y ~ logistic3PL(x, A, B, C, a, b, c),
data = dataSet,
fixed = A + B + C ~ 1,
random = a + b + c ~ 1,
groups = ~ Plate,
start = c(A = 1, B = 1, C = 1))
This produced the following error:
Error in nlme.formula(y ~ logistic3PL(x, A, B, C, a, b, c), data = dataSet, :
Singularity in backsolve at level 0, block 1
A commenter from my prior question suggested that he would actually phrase the 3-parameter function to have both the fixed and random effects denoted by the same set of letters.
# Define the 3-parameter logistic function
logistic3PL <- function(x, A, B, C) {
A / (1 + (x / C) ^B)
}
# Define the nonlinear mixed effects model
model <- nlme(y ~ logistic3PL(x, A, B, C),
data = dataSet,
fixed = A + B + C ~ 1,
random = A + B + C ~ 1,
groups = ~ Plate,
start = c(A = 1, B = 1, C = 1))
This produced an identical error.
I should note that I also attempted replacing random = A + B + C ~ 1,
with ... ~ Plate,
in both methods. Each time, the program run would think for about 30 seconds before giving the exact same error, as opposed to giving the error immediately when the line ended with ~ 1
.
Happy to answer any questions that may help solve the issue. Thank you in advance for your help!