a = c(175, 168, 168, 190, 156, 181, 182, 175, 174, 179)
b = c(185, 169, 173, 173, 188, 186, 175, 174, 179, 180)
x<-t.test(a,b)
str(x)
class(x)

> str(x)
List of 9
 $ statistic  : Named num -0.947
  ..- attr(*, "names")= chr "t"
 $ parameter  : Named num 16
  ..- attr(*, "names")= chr "df"
 $ p.value    : num 0.358
 $ conf.int   : num [1:2] -11.01 4.21
  ..- attr(*, "conf.level")= num 0.95
 $ estimate   : Named num [1:2] 175 178
  ..- attr(*, "names")= chr [1:2] "mean of x" "mean of y"
 $ null.value : Named num 0
  ..- attr(*, "names")= chr "difference in means"
 $ alternative: chr "two.sided"
 $ method     : chr "Welch Two Sample t-test"
 $ data.name  : chr "a and b"
 - attr(*, "class")= chr "htest"
> class(x)
[1] "htest"
> x$p.value
[1] 0.3575549
> x$estimate
mean of x mean of y
    174.8     178.2
> x$estimate[1]
mean of x
    174.8
> x$estimate[2]
mean of y
    178.2
>
========================

> x<-cor.test(a,b)
> str(x)
List of 9
 $ statistic  : Named num -0.714
  ..- attr(*, "names")= chr "t"
 $ parameter  : Named int 8
  ..- attr(*, "names")= chr "df"
 $ p.value    : num 0.496
 $ estimate   : Named num -0.245
  ..- attr(*, "names")= chr "cor"
 $ null.value : Named num 0
  ..- attr(*, "names")= chr "correlation"
 $ alternative: chr "two.sided"
 $ method     : chr "Pearson's product-moment correlation"
 $ data.name  : chr "a and b"
 $ conf.int   : num [1:2] -0.758 0.455
  ..- attr(*, "conf.level")= num 0.95
 - attr(*, "class")= chr "htest"
> x$p.value
[1] 0.4955273
> x$estimate
       cor
-0.2447594
>

R t-test cor.test的更多相关文章

  1. R语言矩阵相关性计算及其可视化?

    目录 1. 矩阵相关性计算方法 base::cor/cor.test psych::corr.test Hmisc::rcorr 其他工具 2. 相关性矩阵转化为两两相关 3. 可视化 corrplo ...

  2. AT2364 Colorful Balls

    AT2364 Colorful Balls 题意翻译 N个球排成一排,第i个球有颜色ci和重量wi. Snuke每次可以选择两个颜色相同,且重量之和不超过X的球,交换他们的位置. Snuke每次可以选 ...

  3. codeforces631B

    Print Check CodeForces - 631B Kris works in a large company "Blake Technologies". As a bes ...

  4. HDU 1542 矩形面积并【离散化+线段树+扫描线】

    <题目链接> 题目大意: 给你n个矩形,求出它们面积的并. 解题分析: 此题主要用到了扫描线的思想,现将各个矩形的横坐标离散化,然后用它们离散化后的横坐标(相当于将矩形的每条竖线投影在x轴 ...

  5. bzoj 4695: 最假女选手 && Gorgeous Sequence HDU - 5306 && (bzoj5312 冒险 || 小B的序列) && bzoj4355: Play with sequence

    算导: 核算法 给每种操作一个摊还代价(是手工定义的),给数据结构中某些东西一个“信用”值(不是手动定义的,是被动产生的),摊还代价等于实际代价+信用变化量. 当实际代价小于摊还代价时,增加等于差额的 ...

  6. 2015.03.12,外语,读书笔记-《Word Power Made Easy》 10 “如何讨论交谈习惯”学习笔记 SESSION 25

    1.about keeping one's mouth shut taciturn,名词形式taciturnity,沉默寡言. 美国第30任总统库里奇,以沉默寡言著称.他来自新英格兰,那里视tacit ...

  7. codeforces269B

    Greenhouse Effect CodeForces - 269B Emuskald is an avid horticulturist and owns the world's longest ...

  8. [原]CentOS7安装Rancher2.1并部署kubernetes (二)---部署kubernetes

    ##################    Rancher v2.1.7  +    Kubernetes 1.13.4  ################ ##################### ...

  9. 利用python进行数据分析2_数据采集与操作

    txt_filename = './files/python_baidu.txt' # 打开文件 file_obj = open(txt_filename, 'r', encoding='utf-8' ...

  10. Django项目:CRM(客户关系管理系统)--81--71PerfectCRM实现CRM项目首页

    {#portal.html#} {## ————————46PerfectCRM实现登陆后页面才能访问————————#} {#{% extends 'king_admin/table_index.h ...

随机推荐

  1. python ---多进程 Multiprocessing

    和 threading 的比较 多进程 Multiprocessing 和多线程 threading 类似, 他们都是在 python 中用来并行运算的. 不过既然有了 threading, 为什么 ...

  2. 【Hive学习之七】Hive 运行方式&权限管理

    环境 虚拟机:VMware 10 Linux版本:CentOS-6.5-x86_64 客户端:Xshell4 FTP:Xftp4 jdk8 hadoop-3.1.1 apache-hive-3.1.1 ...

  3. python urlopen

    Python urllib 库提供了一个从指定的 URL 地址获取网页数据,然后对其进行分析处理,获取想要的数据. urlopen返回 一个类文件对象(fd),它提供了如下方法:read() , re ...

  4. 20165305 苏振龙《Java程序设计》第三周学习总结

    面向对象和面向过程: 面向对象是相对面向过程而言的,面向过程强调的是功能行为,面向对象是将过程封装进对象,强调具备了功能的对象,面向对象是基于面向过程的. 面向对象的三个特征: 封装,继承,多态: 对 ...

  5. Spring整合Shiro

    apache shiro 是一个安全认证框架,和 spring security 相比,在于他使用了比较简洁易懂的 认证和授权方式.其提供的 native-session(即把用户认证后的授权信息保存 ...

  6. HTTP接口-跨域-callback

    1.客户端和正常调用非跨域接口一样2.服务端返回的时候用callback+(返回值)的方式返回结果. callback为客户端的隐藏参数.public String converJsonResultS ...

  7. UVALive 3295 Counting Triangles

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...

  8. 使用Holer外网SSH访问内网(局域网)Linux系统

    1. Holer工具简介 Holer exposes local servers behind NATs and firewalls to the public internet over secur ...

  9. ELK日志分析系统

    部署环境 192.168.1.147 kibana.logstash.Escluster-node-1 192.168.1.151 filebeat.Escluster-node-2.nginx 软件 ...

  10. mysql 虚拟列导入报错1906说明

    当表中有虚拟列,使用mysqldump导出后,执行source导入的时候,会出现下列错误: 对于mariadb 10.2,该错误忽略即可,不影响导入.对于mysql 5.7,截止5.7.9该错误没有解 ...