我有想要拟合对数逻辑曲线的剂量反应数据。
这是数据:
df <- data.frame(dose=c(10,0.625,2.5,0.15625,0.0390625,0.00244140625,0.009765625,0.0006103515625,10,0.625,2.5,0.15625,0.0390625,0.00244140625,0.009765625,0.0006103515625,10,0.625,2.5,0.15625,0.0390625,0.00244140625,0.009765625,0.0006103515625),
response=c(0.990196078431373,0.841175218686903,0.756728767942187,0.650910609644933,0.845425185365378,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.990196078431373,0.544378228848476,0.815621363298204,0.810605311840132,0.990196078431373,0.783062670405492,0.761774545153645,0.720957414865623,0.917229218695802))
拟合drc
LL4
模型:
require(drc)
fit <- drm(response~dose,data=df,fct=LL.4(names=c("slope","low","high","ED50")))
并使用预测数据绘制它:
new.data <- expand.grid(dose=exp(seq(log2(max(df$dose)),log2(min(df$dose)),length=100)))
pred <- predict(fit,newdata=new.data,interval="confidence")
points(log2(new.data$dose),pred[,1],type="l")
原因是最高剂量的单点比所有其他点小得多,强烈表明那里的反应低。
显然,这些数据中有很多噪音。其中之一是,恰好在 response=1.0 处的所有点最初都较高(由于批量更正),但由于在我的情况下响应 > 1 是没有意义的,所以被推低了。
响应 < 0(设置为 0)的点也会发生同样的情况,尽管该数据集没有任何这些。
我的问题是如何获得这样的拟合曲线?如果这是通过约束drm
,这些约束应该是什么?