【问题标题】:Nonlinear mixed model without random effects structure specification无随机效应结构规范的非线性混合模型
【发布时间】:2019-07-22 19:56:47
【问题描述】:

我想使用 nlme R 包来拟合仅具有固定结构规范的非线性模型。

model <- nlme(y ~ Asym/(1+exp((xmid-x)/scal)),
                      data = data,
                      fixed = list(Asym + xmid + scal ~ treatment))
                      #random =  Asym ~ 1|subject)

但是我收到以下错误:

Error in parse(text = paste("~", paste(nVal, collapse = "/"))) : 
  <text>:2:0: unexpected end of input
1: ~ 
   ^

有没有办法绕过这个问题?任何建议都非常受欢迎。

【问题讨论】:

    标签: r mixed-models non-linear-regression nlme


    【解决方案1】:

    我相信您想要带有 params= 参数而不是 fixed=gnls() 函数(也来自 nlme 包)。试试这个:

    model <- gnls(y ~ Asym/(1+exp((xmid-x)/scal)),
                      data = data,
                      params = list(Asym + xmid + scal ~ treatment),
                      start= ...)
    

    FWIW,如果您真的要拟合物流(这不仅仅是您想要做的简化示例),使用 SSlogis() 自启动功能代替你的明确公式...

    【讨论】:

      猜你喜欢
      • 2018-01-13
      • 2018-05-10
      • 1970-01-01
      • 2020-12-10
      • 2017-04-03
      • 2015-05-26
      • 1970-01-01
      • 1970-01-01
      • 2014-12-25
      相关资源
      最近更新 更多