# How to add fixed effect to four-parameter logistic model in nlmer

I am trying to use nlmer with SSfpl to fit some data with a four-parameter logistic function. I can get a fine fit for the overall data using:

nm.fpl <- nlmer(meanFix ~ SSfpl(Time, A, B, xmid, scal) ~ (scal | Subject), data = dataSubset, start = c(A = 0.2, B = 0.7, xmid = 600, scal = 100))

Now I want to add a fixed effect of Condition, which has 2 within-Subject levels. I would like to evaluate whether the two Conditions differ in terms of any of the 4 parameters (A, B, xmid, scal), but I don't know how to specify that in this formula. I can fit model separately to the two subsets (Condition A and Condition B) and then compare the parameters, but that doesn't seem like the right approach.

## Answers

Have you tried to add an interaction?

nm.fpl <- nlmer(meanFix ~ SSfpl(Time, A * Condition, B, xmid, scal) ~ (scal | Subject), data = dataSubset, start = c(A = 0.2, B = 0.7, xmid = 600, scal = 100)) nm.fpl <- nlmer(meanFix ~ SSfpl(Time, A : Condition, B, xmid, scal) ~ (scal | Subject), data = dataSubset, start = c(A = 0.2, B = 0.7, xmid = 600, scal = 100))