简体   繁体   English

比较速率-曲线和降级

[英]Comparing rates - curves and degradation

I have 9 degradation curves which I would like to compare and would like advice as to how best to do this. 我有9条降解曲线,我想比较一下,并建议如何最好地做到这一点。 My initial thoughts surrounded comparing non-linear regressions. 我最初的想法是围绕比较非线性回归。 I will first explain the question and then detail the experimental design a bit more: 我将首先解释该问题,然后再详细说明实验设计:

My questions are: 我的问题是:

  1. how can I compare the rate of degradation between my 9 groups? 如何比较我的9组之间的降解率?
  2. how can I determine to what extent my two primary independent variables (type of organic matter and field plot) drive the rate of degradation. 如何确定我的两个主要自变量(有机物类型和场图)在多大程度上驱动了降解速率。

I placed 3 types of organic matter (X, Y, Z) outside in 3 field plots (A, B, C). 我在3个田地图中(A,B,C)将3种有机物(X,Y,Z)放在外面。 12 samples of each organic matter were placed in each plot (36 samples per plot, total 108 samples). 将每种有机物的12个样品放置在每个样地中(每个样地36个样品,总共108个样品)。 I know the original organic matter (OM) (as both a total value and as percentage of dry matter) content for each sample. 我知道每个样品的原始有机物(OM)含量(总价值和干物质百分比)。 At 3 time points a week apart (T1, T2, T3) I removed 4 samples of each type from each plot and again measured organic matter content. 在每周间隔3个时间点(T1,T2,T3)时,我从每个小区中取出了每种类型的4个样品,并再次测量了有机物含量。

So for each of the 9 combinations (AX, AY, AZ, BX, BY, BZ, CX, CY, CZ) I have: 12 measurments of original organic matter at T0 and 4 measurements of organic matter at each of the latter 3 time points (T1, T2, T3). 因此,对于9种组合(AX,AY,AZ,BX,BY,BZ,CX,CY,CZ)中的每一种,我都有:在T0时对原始有机物进行12次测量,在后3次中分别进行4次测量点(T1,T2,T3)。

I hope that I have provided enough information - please ask if I have not. 我希望我提供了足够的信息-请询问是否还没有。 I am very appreciative of any help and advice surrounding this query. 我非常感谢与此查询相关的任何帮助和建议。

Thank you, and Merry Christmas. 谢谢,圣诞快乐。

Andrew. 安德鲁。

Link to sample date: https://docs.google.com/spreadsheets/d/1a5w9BeeogprKAOwHi3WYSW7JF8EtjQOaaG9z-qzDRgw/pub?output=xlsx 链接到示例日期: https//docs.google.com/spreadsheets/d/1a5w9BeeogprKAOwHi3WYSW7JF8EtjQOaaG9z-qzDRgw/pub?output = xlsx

Here is something quick to give you a start. 这里有个快速入门的方法。 Due to your few time points I would use a linear model. 由于您的时间少,我将使用线性模型。 I assume that absolute differences of OM are sensible here, ie, that samples are normalized in some meaningful way. 我认为OM的绝对差异在这里是明智的,即,以某种有意义的方式对样本进行了归一化。 You might need to work with relative values instead (and could possibly even need a GLMM in that case?). 您可能需要使用相对值(在这种情况下甚至可能需要GLMM?)。

library(data.table)
DT <- fread("Untitled spreadsheet.csv")
setnames(DT, make.names(names(DT)))
DT[, DiffOM := OM.at.collection..g. - Original.OM..T0...g.]
DT <- DT[-1]

library(ggplot2)
p <- ggplot(DT, aes(x = Day.of.collection, y = DiffOM, color = Plot)) +
  geom_point() +
  facet_wrap(~ Sample.type, ncol = 1)
print(p)

情节1

Some people advice only fitting random effects if a larger number of groups is available, but I generally trust also models with few groups if the resulting fit seems reasonable. 某些人建议仅在可用大量组的情况下才拟合随机效果,但我通常相信如果结果拟合合理,则也可以使用少数组的模型。 Of course, you shouldn't put too much trust into the variance estimate of the random effects in such a case. 当然,在这种情况下,您不应该对随机效应的方差估计抱有太大的信任。 Alternatively, you could treat Plot as a fixed effects, but your model would need two more parameters then. 另外,您可以将Plot视为固定效果,但是您的模型将需要两个以上的参数。 However, usually we are not interested too much in plot differences and prefer to concentrate on treatment effects. 但是,通常情况下,我们对地块差异不太感兴趣,而宁愿专注于治疗效果。 YMMV. YMMV。

library(lmerTest)

fit1 <- lmer(DiffOM ~ Day.of.collection * Sample.type + (1 | Plot), data = DT)
fit2 <- lmer(DiffOM ~ Day.of.collection * Sample.type + (Day.of.collection | Plot), data = DT)
lme4:::anova.merMod(fit1, fit2)
#random slope doesn't really improve the model

fit3 <- lmer(DiffOM ~ Day.of.collection * Sample.type + (Sample.type | Plot), data = DT)
lme4:::anova.merMod(fit1, fit3)
#including the Sample type doesn't either

summary(fit1)
#apparently the interactions are far from significant

fit1a <- lmer(DiffOM ~ Day.of.collection + Sample.type + (1 | Plot), data = DT)
lme4:::anova.merMod(fit1, fit1a)
plot(fit1a)
#seems more or less okay with possibly exception of small degradation
#you could try a variance structure as implemented in package nlme

anova(fit1a)
#Analysis of Variance Table of type III  with  Satterthwaite 
#approximation for degrees of freedom
#                  Sum Sq Mean Sq NumDF DenDF F.value    Pr(>F)    
#Day.of.collection 3909.4  3909.4     1   102 222.145 < 2.2e-16 ***
#Sample.type        452.4   226.2     2   102  12.853 1.051e-05 ***
#---
#Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Apparently degradation rates before your samplings were different between sample types (see the different intercepts according to sample type), which would mean non-linear rates (as we would expect). 样本类型之间的抽样之前的降解率显然不同(请参见根据样本类型的不同截距),这意味着非线性速率(如我们预期)。 A linear model of the differences means constant absolute degradation rates. 差异的线性模型表示恒定的绝对降解率。

summary(fit1a)

newdat <- expand.grid(Day.of.collection = seq(28, 84, by = 1), 
                      Plot = c("A", "B", "C"), 
                      Sample.type = c("X", "Y", "Z"))
newdat$pred <- predict(fit1a, newdata = newdat)
newdat$pred0 <- predict(fit1a, newdata = newdat, re.form = NA)

p +
  geom_line(data = newdat, aes(y = pred, size = "subjects")) +
  geom_line(data = newdat, aes(y = pred0, size = "population", color = NULL)) +
  scale_size_manual(name = "Level",
                    values = c("subjects" = 0.5, "population" = 1.5))

情节2

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

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