在lme函数中的split实验中的时间变量。

huangapple go评论63阅读模式
英文:

time variable in split experiment in lme function

问题

I am carrying out an split experiment with microbiology. Totally 3 blocks I set: A,B,C; each block contains 2 incubators, with setting temperature at 19 and 31°C, respectively. In each incubator, 2 replicated microorganism samples are cultured (a,b).

现在我正在进行一项微生物学的分裂实验。总共有3个区块:A、B、C;每个区块包含2个孵育箱,分别设置温度为19°C和31°C。在每个孵育箱中,分别培养了2个重复的微生物样本(a、b)。

now I want to compare density of microorganism between generation 27 (which I got and stocked a years ago) and 2400 (which I got and stocked now). split experiment diagram

现在,我想比较第27代(一年前获得并保存的)和第2400代(现在获得并保存的)的微生物密度。分裂实验图表

[my data][1]

[我的数据][1]

I write this code, it works
modele.ed <- lme ( density ~ temperature*generation, random = ~1|block/temperature/generation, na.action = na.omit, data = datae)

I write this code, it works

```modele.ed <- lme ( density ~ temperature*generation, random = ~1|block/temperature/generation, na.action = na.omit, data = datae)```

but it looks like wrong. I still don't know how to deal with "generation". What is the right code?

但它似乎是错误的。我仍然不知道如何处理"generation"。正确的代码是什么?

<details>
<summary>英文:</summary>

I am carrying out an split experiment with microbiology. 
Totally 3 blocks I set: A,B,C;
each block contains 2 incobators, with setting temperature at 19 and 31 &#176;c, respectively.
In each incubator, 2 replicated microganism sample are cultured (a,b).

now I want to compare density of microganism between generation 27 (which I got and stocked a years agao) and 2400 (which I got and stocked now). [split experiment diagram](https://i.stack.imgur.com/t7LOD.png)

[my data][1]

I write this code, it works

modele.ed <- lme ( density ~ temperature*generation, random = ~1|block/temperature/generation, na.action = na.omit, data = datae)

but it looks like wrong. I still dont know how to deal with &quot;generation&quot;.what is the right code?


  [1]: https://i.stack.imgur.com/ueqOp.png

</details>


# 答案1
**得分**: 0

以下是已翻译的内容:

我的第一反应是从嵌套的随机效应中移除'generation'(因为我认为它没有嵌套在每个实验内),应该是'replicate',因此:

modele.ed <- lme(density ~ temperature*generation, random = ~1|block/temperature/replicate, na.action = na.omit, data = datae)


关于嵌套的随机效应是否有足够的水平来工作是另一个问题。要检查实验设计的有效性,最好在 http://stats.stackexchange.com(用于统计)上发布问题,而不是在这里,这里主要用于代码。

还考虑使用`library(lme4)`及其`lmer()`函数,因为它更受欢迎,更容易制定公式。

<details>
<summary>英文:</summary>

My first reaction is to remove &#39;generation&#39; (because I don&#39;t think it&#39;s nested inside each experiment) from the nested random effects, it should probably be &#39;replicate&#39; in there, thus:

modele.ed <- lme ( density ~ temperature*generation, random = ~1|block/temperature/replicate, na.action = na.omit, data = datae)



Whether or not there is enough levels for that nested random effect to work is another question. To check the validity of your experimental design, you would do better to post on http://stats.stackexchange.com (for stats) as opposed to here which is mainly for code.

Also consider using `library(lme4)` and its `lmer()` functions as it is more popular and easier to make formulae for.

</details>



huangapple
  • 本文由 发表于 2023年2月16日 15:45:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75469176.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定