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.

 

最新文章

  1. Uboot+Linux启动时间优化
  2. 云计算P2V的迁移过程
  3. CentOS 安装 chrome 浏览器
  4. webform(内置对象)
  5. iOS 秒数转换成时间,时,分,秒
  6. linux配置ant
  7. jquery仿天猫商城左侧导航菜单
  8. 自动化:Appium运行成功,取得一个小的胜利
  9. [九度OJ]1008.最短路径问题
  10. make clean与make distclean的区别
  11. spoj TSUM - Triple Sums fft+容斥
  12. Eclipse用法和技巧二十八:Eclipse插件Easy Explore的今世
  13. SugarSync网盘之XML解析
  14. scala写算法-List、Stream、以及剑指Offer里部分题目基于scala解法
  15. 网站HTTP升级HTTPS完全配置手册
  16. C#6.0新语法
  17. Toggle组件切换开关,控制开关图片显示与隐藏
  18. 045 RDD与DataFrame互相转换
  19. 关于WEB前端开发的工具
  20. [No0000169]Potplayer倍速播放快捷键修改速率步长

热门文章

  1. CentOS7.5安装JDK1.8
  2. nodejs 实践:express 最佳实践(七) 改造模块 connect2 解析
  3. spring中自动装配bean
  4. pageContext.setAttribute的使用场合
  5. java类及编写public类的基础点
  6. javaweb-servlet生成简单的验证码
  7. CMSG_COMPAT_ALIGN函数
  8. basic ,fundamental ,extreme ,utmost和radical.区别
  9. 51nod 1572 宝岛地图
  10. Berkeley DB (VC6.0 编译环境配置)