如何为mvabund的R stat公式解释嵌套抽样设计?

问题描述 投票:0回答:1

我有一个实验数据集,其中4个水箱中有16条鱼(64条鱼)。有两种处理-加热和控制以及四个水箱。在水箱1和2中进行加热,而在水箱3和4中进行控制。在整个实验中的4个不同时间点(1、2、3和4天),对四只鱼进行采样,并在肠道的四个位置分析了微生物群落。因此,我有256个样本。

在这种情况下,因变量是可以拟合为负二项式分布的多元社区组成矩阵。

我想知道在每个时间点和热处理情况下,采样鱼的微生物群存在差异。

我的问题是:输入到manyglm函数(package :: mvabund)以表示此抽样设计的正确公式语法是什么?

我已经尝试运行4个manyglm模型-每个采样时间使用一个模型(但是我怀疑我在此分析中失去了力量)。

我也尝试过:

manyglm(phy.mv ~ Treatment * Time + (1/Tank/Individual/GutLocation),
    data=meta.phy, family="negative.binomial")

建立示例社区矩阵。请注意,正确的数据集是零膨胀的,因此为什么要使用负二项式分布。此示例也只有4个分类单元(列),实际数据具有1000个分类单元。

# Build example data with community matrrix Y and experimental design
# and factor in x

Y <- data.frame(cbind(round(runif(256,0,100000), 0),
round(runif(256,0,100000), 0),
round(runif(256,0,100000), 0),
round(runif(256,0,100000), 0)))

Individual <- as.factor(rep(1:64, each=4))
GutLocation <- as.factor(rep(c(1,2,3,4), times=64))
Tank <- as.factor(rep(rep(1:4, each=16), time=4))
Treatment <- as.factor(rep(rep(1:2, each=32),times=4))
Time <-as.factor(rep(1:4, each=64))
x <- data.frame(cbind(Individual, GutLocation, Tank, Treatment, Time))

输入到mvabund

library(mvabund)
Y.mv <- mvabund(Y)
mod <- manyglm(Y.mv ~ Treatment * Time + 
                (1/Tank/Individual/GutLocation),
                     data=x, family="negative.binomial")

并测试模型

mod.anova <- anova(mod, nBoot=10, test="LR")
# nBoot = 10 to keep computing time to a min

此公式是否准确代表我的研究设计?

谢谢,克里斯

r formula glm lm vegan
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.