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. Rpgmakermv(24 )yep_coreengine

    ==左部为原文,右边我做了简要翻译=================================== Introduction and Instructions ================= ...

  2. SiteCore Experience Analytics-体验分析

    体验分析   Sitecore Experience Analytics为营销人员和营销分析师提供仪表板和报告,以识别从其网站和可能的其他外部数据源收集的体验数据的模式和趋势. 体验分析报告示例:   ...

  3. EasyUI表格DataGrid获取数据的方式

       第一种方式:直接返回JSON数据 package com.easyuijson.util; import java.text.SimpleDateFormat; import net.sf.js ...

  4. navicat远程连接阿里云ECS上的MYSQL报Lost connection to MySQL server at 'reading initial communication packet'

    问题现象 MySQL 远程连接报错:Lost connection to MySQL server at 'reading initial communication packet' 解决方案 1.检 ...

  5. ASP.NET Core Web API 索引 (更新Redis in .NET Core)

    https://www.cnblogs.com/cgzl/p/9178672.html

  6. MyBatis中的if写法

    <if test="latn_id !=null and latn_id !='' and latn_id !='100'"> and latnid=#{latn_id ...

  7. 同行span标签设置display:inline-block;overflow:hidden垂直对齐问题

    1 问题描述:一个div包含 三个span 当span2 类样式设置如下图时,将导致垂直方向不对齐的情况 2解决方案: 将前面的也设置同样的样式 overflow:hidden; display:in ...

  8. 每日linux命令学习-sed

    Linux的文本处理实用工具主要由sed和awk命令,二者虽然略有差异,但都使用正则表达式,默认使用标准I/O,并且使用管道命令可以将前一个命令的输出作为下一个命令的输入.笔者将在本节学习sed命令. ...

  9. hibernate文档头的不同版本

    <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "h ...

  10. Linux学习笔记之Linux环境变量总结

    0x00 概述 Linux是一个多用户多任务的操作系统,可以在Linux中为不同的用户设置不同的运行环境,具体做法是设置不同用户的环境变量. 0x01 Linux环境变量分类 按照生命周期来分,Lin ...