- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个包含多个变量的大型数据集。我需要进行双向方差分析,然后使用 Tukey HSD 进行事后成对多重比较。
我的前 25 个条目的数据头部是这样的:
> head(my_data2, 25 )
CellType variable value
1 Cell1 W1 18.780294
2 Cell1 W1 13.932397
3 Cell1 W1 20.877093
4 Cell1 W1 9.291295
5 Cell1 W1 10.939570
6 Cell1 W1 12.236713
7 Cell1 W1 13.810722
8 Cell1 W1 23.944473
9 Cell1 W1 17.355429
10 Cell1 W1 18.248215
11 Cell2 W1 17.988200
12 Cell2 W1 15.427909
13 Cell2 W1 21.839687
14 Cell2 W1 22.322325
15 Cell2 W1 12.535762
16 Cell2 W1 12.743278
17 Cell2 W1 15.007214
18 Cell2 W1 12.054787
19 Cell2 W1 15.639977
20 Cell2 W1 16.006960
21 Cell3 W1 17.452199
22 Cell3 W1 23.280391
23 Cell3 W1 7.902728
24 Cell3 W1 8.353992
25 Cell3 W1 24.360250
我做方差分析
#ANOVA
my_data2$CellType <- as.factor(my_data2$CellType)
my_ANOVA = aov(value ~ CellType + variable + CellType:variable, data = my_data2)
summary(my_ANOVA)
然后事后
my_posthoc =TukeyHSD(my_ANOVA, which = "CellType:variable")
my_posthoc
到目前为止一切正常,但我的事后分析的输出包括所有成对比较,这给我们提供了超过 2200 行的大量数据。例如我的输出是这样的:
> my_posthoc
Tukey multiple comparisons of means
95% family-wise confidence level
Fit: aov(formula = value ~ CellType + variable + CellType:variable, data = my_data2)
$`CellType:variable`
diff lwr upr p adj
Cell2:W1-Cell1:W1 0.21499 -29.46177884 29.8917588 1.0000000
Cell3:W1-Cell1:W1 0.88234 -28.79442884 30.5591088 1.0000000
Cell4:W1-Cell1:W1 1.24301 -28.43375884 30.9197788 1.0000000
Cell5:W1-Cell1:W1 1.61684 -28.05992884 31.2936088 1.0000000
Cell6:W1-Cell1:W1 0.65009 -29.02667884 30.3268588 1.0000000
Cell7:W1-Cell1:W1 1.08223 -28.59453884 30.7589988 1.0000000
Cell1:W2-Cell1:W1 9.00094 -20.67582884 38.6777088 1.0000000
Cell2:W2-Cell1:W1 27.62765 -2.04911884 57.3044188 0.1249342
Cell3:W2-Cell1:W1 29.40077 -0.27599884 59.0775388 0.0570151
Cell4:W2-Cell1:W1 28.84731 -0.82945884 58.5240788 0.0736530
Cell5:W2-Cell1:W1 42.51407 12.83730116 72.1908388 0.0000144
Cell6:W2-Cell1:W1 30.78610 1.10933116 60.4628688 0.0288235
Cell7:W2-Cell1:W1 27.62966 -2.04710884 57.3064288 0.1248307
Cell1:W3-Cell1:W1 20.95847 -8.71829884 50.6352388 0.7816085
Cell2:W3-Cell1:W1 42.50116 12.82439116 72.1779288 0.0000146
Cell3:W3-Cell1:W1 47.07037 17.39360116 76.7471388 0.0000004
Cell4:W3-Cell1:W1 47.26760 17.59083116 76.9443688 0.0000003
Cell5:W3-Cell1:W1 64.08026 34.40349116 93.7570288 0.0000000
Cell6:W3-Cell1:W1 53.90284 24.22607116 83.5796088 0.0000000
最后说:
[ reached getOption("max.print") -- omitted 2290 rows ]
但是我只对每个变量内部的比较感兴趣,而不是它们之间的比较。作为上面输出的例子,我只需要Cell1:W1-Cell2:W1
。都在同一个变量 w1
中。或者例如 Cell6:W3-Cell1:W3
。我对 Cell6:W3-Cell6:W1
我如何指定它?谢谢
最佳答案
我采用简单诚实的方式,将术语 (rowname) 分为四个部分并进行过滤。
library(dplyr); library(tibble); library(purrr) # OR library(tidyverse) # EDITED
my_posthoc2 <- my_posthoc %>%
pluck("CellType:variablen") %>% # get element of list
as_tibble(rownames = "Term") %>% # convert to tibble
separate(Term, # separate terms by - and :
into = c("LL", "LR", "RL", "RR"),
sep = "-|:",
remove = FALSE)
my_posthoc2 %>%
filter(LR == "W1", RR == "W1") # get Cell1:W1-Cell2:W1
关于r - 在 R 中的双向方差分析中为 Tukey HSD 选择的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58331405/
我的应用程序上有一个抽屉式菜单,它在桌面上运行良好,但在任何移动设备上我都看到一个丑陋的卡顿。 在 header 中,我有一个 bool 值,在单击汉堡包时将其设置为 true/false,这会将 o
在CLRS书中,自上而下的heapify构建堆的复杂度为O(n)。也可以通过反复调用插入来建立堆,其最坏情况下的复杂度为nlg(n)。 我的问题是:对于后一种方法性能较差的原因,是否有任何见解? 我问
我在所有层和输出上使用 sigmoid,得到的最终错误率为 0.00012,但是当我使用理论上更好的 Relu 时,我得到了最差的结果。谁能解释为什么会发生这种情况?我正在使用一个非常简单的 2 层实
我想计算有多少人(百分比)在我的测试中表现比我差。 这是我想要的结果: student | vak | resultaat | percentielscore ---------+-------
令人惊讶的是,使用 PLINQ 并没有在我创建的一个小测试用例上产生好处;事实上,它比通常的 LINQ 还要糟糕。 测试代码如下: int repeatedCount = 10000000;
我正在开发一个高度基于 map 的应用程序,并且我正在使用 MBXMapKit 框架(基于 MapKit 构建)以便在我的 MapView 中显示自定义 Mapbox map 图 block 而不是默
这个问题在这里已经有了答案: Is it always better to use 'DbContext' instead of 'ObjectContext'? (1 个回答) 关闭 9 年前。
我正在尝试使用 FFmpeg 进行一些复杂的视频转码(例如连接多个文件)。为此,我一直在尝试使用 filter_complex,但我注意到我之前使用普通视频过滤器看到的质量略有下降。 为了仔细检查,我
我是 R 中并行计算的新手,想使用并行包来加速我的计算(这比下面的示例更复杂)。但是,与通常的 lapply 函数相比,使用 mclapply 函数的计算时间更长。 我在我的笔记本电脑上安装了一个全新
我正在尝试使用 BERT 解决文档排名问题。我的任务很简单。我必须对输入文档进行相似度排名。这里唯一的问题是我没有标签——所以它更像是一个定性分析。 我正在尝试一系列文档表示技术——主要是 word2
如何计算两点的差?例如:(5,7) - (2,3) = (3,4) using point = boost::geometry::model::point point p1 (2, 3); point
我是 ARKit 的新手,在检查了一些示例代码后,如 https://developer.apple.com/sample-code/wwdc/2017/PlacingObjects.zip我想知道是
社区。 我正在编写一些机器学习代码,将一些数据分类。 我尝试了不同的方法,但是当我使用SVM时,我遇到了这个问题。 我有一组简单的数据(3 个类别,6 个特征),当我使用具有固定参数(C=10、gam
我只是在查看不同问题的答案以了解更多信息。我看到一个answer这表示在 php 中编写 是不好的做法 for($i=0;$i
我正在编写一个界面,我必须在其中启动 4 个 http 请求才能获取一些信息。 我用两种方式实现了接口(interface): 使用顺序 file_get_contents。 使用多 curl 。 我
我想用随机数来愚弄一下,如果 haskell 中的随机生成器是否均匀分布,因此我在几次尝试后写了下面的程序(生成的列表导致堆栈溢出)。 module Main where import System.
我在 Tensorflow 中构建了一个 LSTM 分类器(使用 Python),现在我正在做一系列基准测试来衡量执行性能。基准测试代码加载在训练期间保存的模型并针对大量输入执行它。我有一个 Pyth
不久前,我重构了单元格渲染器组件以实现性能提升(我有一个巨大的表格)。我从功能性无状态组件重构为 PureComponent。例如: import React from 'react'; import
当我改变缓冲区的大小时,我得到了无法从 BufferedReader 解释的奇怪结果。 我曾强烈期望性能会随着缓冲区大小的增加而逐渐增加, yield 递减设置相当快,此后性能或多或少会持平。但看起来
我正在尝试为 1000 个正面+负面标签的 IMDB 评论 (txt_sentoken) 和 Java 的 weka API 构建一个基于朴素贝叶斯的分类器。 由于我不知道 StringToWordV
我是一名优秀的程序员,十分优秀!