R的t-test检验
2024-09-01 17:47:52
1.t-test的功能:单因素二水平的假设检验。
H0:与我们想过要的结果相反的假设,比如我们想要的是两组数据的差异性,那么这个假设是:两组数据没有差异性。
H1或Ha:备择假设,与H0假设相反。
2.t-test的前提:正态性和方差齐性
3.R中的t-test的使用。
t.test(x, y = NULL,alternative = c("two.sided", "less", "greater"),mu = 0, paired = FALSE, var.equal = FALSE,conf.level = 0.95, ...)
或 t.test(formula, data, subset, na.action, ...)
> data
druga drugb > t.test(data$druga,data$drugb) Welch Two Sample t-test data: data$druga and data$drugb
t = -8.1742, df = 5.5846, p-value = 0.0002598
alternative hypothesis: true difference in means is not equal to
percent confidence interval:
-11.417221 -6.082779
sample estimates:
mean of x mean of y
10.75 19.50
> df
drug effect > t.test(effect~drug,data=df) Welch Two Sample t-test data: effect by drug
t = -8.1742, df = 5.5846, p-value = 0.0002598
alternative hypothesis: true difference in means is not equal to
percent confidence interval:
-11.417221 -6.082779
sample estimates:
mean in group mean in group
10.75 19.50
结果解读:
t:t统计值。
df:自由度。
p:H0假设成立的概率。
最新文章
- js精简写倒计时函数
- poj 1269 线段相交/平行
- php 加密解密方法2
- ul ol dl
- MYSQL 体系结构图-LRU
- Linux企业级项目实践之网络爬虫(16)——使用base64传输二进制数据
- python图片小爬虫
- 通过IP或socket获取对方的MAC地址
- 使用Spring Boot快速构建基于SQLite数据源的应用
- [Swift]LeetCode529. 扫雷游戏 | Minesweeper
- Python变量之白首如新,倾盖如故
- Debian 系linux切换登录管理器(display manager)
- 吴恩达机器学习笔记31-梯度检验(Gradient Checking)
- keras用vgg16做图像分类
- 使用fabric2打包部署文件
- PHP获取文件大小的方法详解
- git fail to push some refs....
- HTML5中的Canvas详解
- servlet3.0
- 配置Gitlab使用LDAP认证