Ref:https://onlinecourses.science.psu.edu/stat464/print/book/export/html/12


前面我们考虑的情况是:response是连续的,variable是离散的。举例:如果打算检查GPA的中位数是否与学生坐在教室的位置有关,

那么GPA的中位数是连续的,是响应变量;学生坐的位置(前中后)是离散的,是解释变量。

现在考虑解释变量也是连续的情况,即检查两个连续变量之间的因果关系。其中,我们最关心的是关系的强弱和方向。

首先,我们考虑线性相关的情况,计算Pearson's correlation coefficient

计算Pearson's Correlation Coefficient

cor.test(x, y)

结果将给出系数cor,置信区间,p-value

计算斜率(最小二乘法拟合时)

> h=c(67, 62, 64, 65)
> w=c(120, 172, 167, 145)
> lm(w~h)

注意:这里使用的是y~x来拟合,应该是可以选用不同的公式的。结果里,斜率是-10.85


Spearman's Rank Correlation

使用两个变量的rank值,置换计算Pearson's,就是Spearman's

Kendall's Tau Rank Correlation

measuring association by counting the number of concordant and disconcordant pairs

concordant pairs


Bootstrap

The sample we get from sampling from the data with replacement is called the bootstrap sample

sample=sample(data, 10, replace=T)

Steps for Creating a Bootstrap Estimate of Correlation

1. Gather a bootstrap sample of size n (Think carefully how to do this).

2. Calculate the sample correlation, ri , from the bootstrap sample.

3. Repeat steps (1)-(2) B times. Typically want B to be larger than 100. I would say B = 1000 is a good number.

4. To find the (1-α)100\%CI for ρ, you would order the data and find the α/2 and 1-α/2 percentiles as the lower and upper bounds.

 

Applied Nonparametric Statistics-lec9的更多相关文章

  1. Applied Nonparametric Statistics-lec10

    Ref:https://onlinecourses.science.psu.edu/stat464/print/book/export/html/14 估计CDF The Empirical CDF ...

  2. Applied Nonparametric Statistics-lec8

    Ref:https://onlinecourses.science.psu.edu/stat464/print/book/export/html/11 additive model value = t ...

  3. Applied Nonparametric Statistics-lec7

    Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/9 经过前面的步骤,我们已经可以判断几个样本之间是否 ...

  4. Applied Nonparametric Statistics-lec6

    Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/8 前面都是对一两个样本的检查,现在考虑k个样本的情 ...

  5. Applied Nonparametric Statistics-lec5

    今天继续two-sample test Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/6 Mann ...

  6. Applied Nonparametric Statistics-lec4

    Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/5 Two sample test 直接使用R的t- ...

  7. Applied Nonparametric Statistics-lec3

    Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/4 使用非参数方法的优势: 1. 对总体分布做的假设 ...

  8. Applied Nonparametric Statistics-lec2

    Ref: https://onlinecourses.science.psu.edu/stat464/print/book/export/html/3 The Binomial Distributio ...

  9. Applied Nonparametric Statistics-lec1

    参考网址: https://onlinecourses.science.psu.edu/stat464/node/2 Binomial Distribution Normal Distribution ...

随机推荐

  1. CellSet 遍历

    CellSet 结构: 查询MDX: SELECT NON EMPTY {{ {{ {{ {{ {{ AddCalculatedMembers([店铺.店铺ID].[店铺ID].Members)}} ...

  2. 关于eclipse安装maven之后,maven找不到JDK问题

    问题: 最近在Eclipse里面装了maven之后,启动或者在运行项目时存在如下的警告: Eclipse is rinning in a JRE,but a JDK is require, Some ...

  3. ruby 正则表达式 ruby-doc原文

    原文链接:http://www.ruby-doc.org/core-1.9.3/Regexp.html Regexp A Regexp holds a regular expression, used ...

  4. Spring 计划任务

    计划任务在Spring 中实现变得非常简单: 1. 首先通过在配置类中注解 @EnableScheduling 来开启对计划任务的支持 2. 然后在你执行任务的方法上注解 @Scheduled 来声明 ...

  5. Mysql有什么办法批量去掉某个字段字符中的空格

    Mysql有什么办法批量去掉某个字段字符中的空格?不仅是字符串前后的空格,还包含字符串中间的空格,答案是 replace,使用mysql自带的 replace 函数,另外还有个 trim 函数.   ...

  6. 移动端rem单位和px单位换算

    rem单位是根据html元素的单位在页面根据不同的手机屏幕分辨率动态整体的按比例缩小或放大字体. 假如html{font-size: 14px;},那么1rem=14px; 一个div宽度48px,那 ...

  7. 【Unity3D】3D游戏学习

    1.理解游戏元素,简单回答以下问题: 1.1简单介绍一款上世纪(19XX)出品的计算机游戏,然后按课件的方法描述游戏的五个基本元素.(讲目标.玩法.规则) 1.1.1仙剑奇侠传 <仙剑奇侠传&g ...

  8. Android端WebRTC点对点互连

    项目准备 信令服务器代码:https://github.com/matthewYang92/WebRtcServer(代码改自ProjectRTC) 安装Node.js 进入项目根目录,命令行:npm ...

  9. 关于学习Lisp的一点思考

    以前读<黑客与画家>,其中对Lisp语言的赞美和推崇,让我燃起学习Lisp语言的强烈冲动,但很快发现在实际工作中应用的场景很少,出于功利心最终放弃了.直到上周未在家里读完了<大教堂与 ...

  10. 使用PM2搭建在线vue.js开发环境(以守护进程方式热启动)

    项目以vue.js+layUI的作为前端开发技术栈,需要有一个在线的环境供项目成员实时查看效果,总不能每次都webpack打包发布后才能看到效果吧!刚开始就简单使用npm run dev命令热启动,但 ...