【问题标题】:how to fit model using loess gamm如何使用 loess gamm 拟合模型
【发布时间】:2019-06-26 15:09:01
【问题描述】:

我想用黄土伽马给出方差的概念。但是用我的数据拟合模型会给我一个错误。

我有一个昆虫计数和治疗的响应变量,以四个水平作为解释变量。随着时间的推移收集计数。

loess_model <- loess(ground_beetle ~ Treatment, span=0.4, data=m_data)
gg<-gamm(ground_beetle ~ lo(Treatment) + s(Sampling_date, k = 5, fx = 
T), family = poisson, data = m_data)

Error in loess(ground_beetle ~ Treatment, span = 0.4, data = m_data) : 
predictors must all be numeric
Error in names(dat) <- object$term :'names' attribute [1] must be the 
same length as the vector [0]

【问题讨论】:

    标签: model gam loess


    【解决方案1】:

    您不能使用gamm(),也不能使用 mgcv 包中的任何其他内容。 lo() 来自 gam 包,这些平滑不能与 mgcv 中的惩罚样条创意结合。

    一个更普遍的问题和loess() 错误的直接原因是您可以平滑因子变量,例如Treatment。这两个概念根本上是不相容的。

    【讨论】:

      猜你喜欢
      • 2019-09-27
      • 1970-01-01
      • 2013-02-26
      • 2021-12-08
      • 2020-07-29
      • 2018-11-07
      • 2020-05-01
      • 2015-12-01
      • 2021-07-29
      相关资源
      最近更新 更多