简体   繁体   English

分段 SEM 中的零膨胀模型

[英]Zero-inflated models in piecewise SEM

I analyze bee observations from a field experiment and I want to apply SEM.我分析了野外实验中的蜜蜂观察结果,我想应用 SEM。 Piecewise sem (psem) seems most appropriate.分段 sem (psem) 似乎最合适。 My problem is that my data is highly zero-inflated because of many observations with zero bees.我的问题是,由于对零蜜蜂的许多观察,我的数据高度零膨胀。 So far, I worked with glmmTMB and nbinom2-distribution in the analysis, which worked very well.到目前为止,我在分析中使用了 glmmTMB 和 nbinom2-distribution,效果很好。 Unfortunately, glmmTMB and nbinom2 are not implemented in psem and I am now clueless whether and how I can apply psem to my data.不幸的是,glmmTMB 和 nbinom2 没有在 psem 中实现,我现在不知道是否以及如何将 psem 应用于我的数据。

By means of the piecewise sem, I want to investigate the effect of the treatment (which is flower strip, hedgerow …) on flower abundance (which I want to be log-transformed because of strongly varying counts) and plant species richness and finally on the abundance of bees by taking into account the month and the year.通过分段 sem,我想研究处理(花带、树篱……)对花丰度(由于数量变化很大,我想对其进行对数转换)和植物物种丰富度的影响,最后通过考虑月份和年份来计算蜜蜂的数量。 This way, I want to quantify the contribution of the vegetation variables and the direct effects of the treatments and hope to find an indication about whether the treatments differ also in other properties than only flower abundance and plant species richness.通过这种方式,我想量化植被变量的贡献和处理的直接影响,并希望找到一个指示,说明处理是否在其他属性上也有所不同,而不仅仅是花卉丰度和植物物种丰富度。

The psem-models include several dummy variables for the treatments (FF, HC, HI) and the months of observation. psem 模型包括几个用于处理(FF、HC、HI)和观察月份的虚拟变量。 w_b_abu indicates the aubndance of bees, pl_abu the abundance of flowers (pl_abu_ln = log-tranformed) and pl_sr the plant species richness. w_b_abu 表示蜜蜂的丰富度,pl_abu 表示花朵的丰富度(pl_abu_ln = log-tranformed),pl_sr 表示植物物种的丰富度。

My code is the following:我的代码如下:

w_b_abu_sem <- psem(
  glmer(w_b_abu  ~ FF + HC + HI + pl_abu_ln + pl_sr + april + may + june + july + august + september + years + (1|site), dat_treat_habitat, family = "poisson"),
  lmer(pl_abu_ln  ~ FF + HC + HI + april + may + june + july + august + september  + years +  (1|site),  dat_treat_habitat),
  glmer(pl_sr  ~ FF + HC + HI + pl_abu_ln + april + may + june + july + august + september  + years + >  (1|site), dat_treat_habitat, family = "poisson"),
  dat_treat_habitat)

This SEM however fails to converge with "Model failed to converge with max|grad| =..." (because of submodels 1 and 3).然而,此 SEM 未能收敛于“模型未能收敛于 max|grad| =...”(因为子模型 1 和 3)。 Anyway, the poisson error distribution does not really fit the data.无论如何,泊松误差分布并不真正适合数据。 I used “nbinom2” in the previous analysis, which worked much better, but is not implemented in psem.我在前面的分析中使用了“nbinom2”,它工作得更好,但没有在 psem 中实现。 Submodel 1 is highly zero-inflated (tested with Dharma).子模型 1 是高度零膨胀的(通过 Dharma 测试)。

My question is, whether there are possibilities to include zero-inflated models with nbinom2-distribution in psem.我的问题是,是否有可能在 psem 中包含具有 nbinom2 分布的零膨胀模型。

If not, do you have other ideas how I could apply psem on my data?如果没有,您是否有其他想法如何将 psem 应用于我的数据? An idea that I had was to transform the variables to make them normally distributed.我的一个想法是转换变量,使它们呈正态分布。 Would that be appropriate?这样合适吗? And if so, which way of transformation would be best?如果是这样,哪种转型方式最好?

To try out the psem I scaled the responses, so that they are “normally distributed” (they are not indeed).为了尝试 psem,我缩放了响应,以便它们“正态分布”(它们确实不是)。 This psem version works, but I fear that it violates several statistical assumptions:这个 psem 版本有效,但我担心它违反了几个统计假设:

w_b_abu_sem <- psem(
  lmer(w_b_abu_scaled  ~ FF + HC + HI + pl_abu_ln + pl_sr_scaled + april + may + june + july + august + september + years + (1|site), dat_treat_habitat),
  lmer(pl_abu_ln  ~ FF + HC + HI + april + may + june + july + august + september  + years +  (1|site), dat_treat_habitat),
  lmer(pl_sr_scaled  ~ FF + HC + HI + pl_abu_ln + april + may + june + july + august + september  + years + (1|site), dat_treat_habitat),
  dat_treat_habitat)

This is the head of my data.table:这是我的 data.table 的负责人:

  w_b_abu pl_abu pl_abu_ln pl_sr FF HC HI april may june july august september years
1       0    730  6.593045     2  0  1  0     1   0    0    0      0         0     0
2       3     51  3.931826     4  0  1  0     1   0    0    0      0         0     0
3       3     41  3.713572     3  0  1  0     1   0    0    0      0         0     0
4       0     43  3.761200     4  0  1  0     1   0    0    0      0         0     0
5       4    126  4.836282     3  0  1  0     0   1    0    0      0         0     0
6       0      0  0.000000     0  0  1  0     0   0    1    0      0         0     0

I would really appreciate help – thank you very much in advance.我非常感谢您的帮助——非常感谢您。 This is the first time I ask a question here and I hope I don't miss something.这是我第一次在这里提问,我希望我不会错过任何东西。 I can also upload the full dataset if necessary.如有必要,我还可以上传完整的数据集。

I got the model running without glmmTMB.我在没有 glmmTMB 的情况下运行了 model。 It works this way (without zero-inflation):它以这种方式工作(没有零通货膨胀):

w_b_abu_sem <- psem( glmer.nb(w_b_abu ~ FF + HC + HI + pl_abu_ln + pl_sr + april + may + june + july + august + september + years + (1|site), dat_treat_habitat, control=glmerControl(optimizer="bobyqa"), nAGQ=0), lmer(pl_abu_ln ~ FF + HC + HI + april + may + june + july + august + september + years + (1|site), dat_treat_habitat), glmer(pl_sr ~ FF + HC + HI + pl_abu_ln + april + may + june + july + august + september + years + (1|site), dat_treat_habitat, family = "poisson", control=glmerControl(optimizer="bobyqa"), nAGQ=0), dat_treat_habitat)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM