r - 比较具有多个变量的两组
问题描述
我试图从多个变量(行为)中比较两组(高密度与低密度)之间的平均值。我试图检验这样一个假设,即当密度变化时,活动的总持续时间不会改变。
我已经尝试了几个 t.tests 和ANOVAS
R,但我认为我的统计知识与 Rstudio 中的编码混合在一起,使我无法准确地看到我应该在每一行代码中添加什么。
Who Activity Duration Visitor_Density
1 Ch Stationary 14 High
2 Co Stationary 18 Low
3 Co Interaction 2 Low
4 R Stationary 6 High
5 Ch Interaction 1 High
6 J Display 10 High
7 Ch Interaction 6 High
t.test(chimp2$Visitor_Density == "High", chimp2$Visitor_Density == "Low", mu=0, paired = TRUE, conf.level = 0.95)
输出:
Paired t-test
data: chimp2$Visitor_Density == "High" and chimp2$Visitor_Density == "Low"
t = 3.9875, df = 1177, p-value = 7.09e-05
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
0.05864408 0.17225575
sample estimates:
mean of the differences
0.1154499
在我看来,上面的代码是错误的,至少我根本没有考虑到不同的活动。我应该为此使用ANOVA
吗?任何帮助都感激不尽!
解决方案
推荐阅读
- prompt - 鱼壳暂时禁用所有提示
- django - 如何将数据从一个输入字段提供给 Django 生成表单的两个输入字段?
- python - 无法修复python中的文件处理问题
- laravel - 将应用程序从宅基地移动到 docker
- android - 以编程方式将我的应用程序添加到自动启动应用程序列表和运行状态
- html - 如何垂直对齐1顶部2底部图片
- go - Go 1.12 模块:非本地导入中的本地导入
- firebase - 如何在 Node Express 上发送 PUT 请求
- javascript - jquery datatable 使用表单编辑表格行数据
- javascript - 如何知道动态组件何时已完全加载