如何在nlmer中为四参数逻辑模型添加固定效应 [英] How to add fixed effect to four-parameter logistic model in nlmer
问题描述
我正在尝试将nlmer
与SSfpl
结合使用,以通过四参数逻辑函数拟合某些数据.我可以使用以下方法对整体数据进行调整:
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))
现在,我想添加Condition
的固定效果,该效果具有2个主题内"级别.我想评估这两个条件在4个参数(A,B,xmid,scal)中是否有所不同,但是我不知道如何在此公式中指定.我可以将模型分别拟合到两个子集(条件A和条件B),然后比较参数,但这似乎不是正确的方法.
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.
推荐答案
您是否尝试添加互动?
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))
这篇关于如何在nlmer中为四参数逻辑模型添加固定效应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!