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. html5-垂直定位

    *{    padding: 0px;    margin: 0px; }#div2{    background: green;    padding: 15px;    width: 200px; ...

  2. webservice 生成客户端代码

    使用 jdk 自带工具 wsimport wsimport -keep http://webservice/url?wsdl

  3. Jmeter分布式压力测试

    有时候,一台机器无法支持很多个虚拟用户并发,这时就会使用分布式测试来实现这个功能,jmeter是有提供这个功能的.要实现分布式测试,得在主从(agent和controler)机器的jmeter安装目录 ...

  4. Thread(26)

    1.进程:进程指正在运行的程序.确切的来说,当一个程序进入内存运行,即变成一个进程,进程是处于运行过程中的程序,并且具有一定独立功能. 2.线程:线程是进程中的一个执行单元,负责当前进程中程序的执行, ...

  5. Google自动广告,将广告代码放置在 HTML 中的什么位置?

    Google自动广告,将广告代码放置在 HTML 中的什么位置? 为自动广告生成广告代码后,您需要将此代码放置在要展示广告的每个网页中.您应将广告代码放置在网页的 <head> 标记(或正 ...

  6. Codeforce 296A - Yaroslav and Permutations

    Yaroslav has an array that consists of n integers. In one second Yaroslav can swap two neighboring a ...

  7. LNMP的并发配置和资源分配

    PHP程序性能如何?程序的并发可以达到多少?程序的瓶颈在哪儿?为了满足业务需求应该购买多少台服务器?负载均衡中php应用服务器需要多少台? LNMP中的N是nginx充当Web Server 内容的分 ...

  8. nvidia-docker

    参考资料 https://github.com/NVIDIA/nvidia-docker/wiki/Installation#prerequisites https://github.com/NVID ...

  9. Python基础二_操作字符串常用方法、字典、文件读取

    一.字符串常用方法: name.captitalize()                       #字符串首字母大写 name.center(50,'*')                   ...

  10. GoldenGate 12.3 MA架构介绍系列(3) - 各功能模块介绍

    在新版的ogg 12.3 microservice architect中,提供了4个不同的服务模块和命令行模块. Admin Server: 负责连接用户.trandata, checkpoint的添 ...