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. 微服务的.NET Core示例框架

    eShopOnContainers 是一个基于微服务的.NET Core示例框架 https://www.cnblogs.com/fengqingyangNo1/p/9438428.html 找到一个 ...

  2. 定时任务crontab 详解

    cron 是一个可以用来根据时间.日期.月份.星期的组合来调度对重复任务的执行的守护进程. cron 假定系统持续运行.如果当某任务被调度时系统不在运行,该任务就不会被执行. 要使用 cron 服务, ...

  3. logback整合Logstash

    1.依赖 <dependency> <groupId>net.logstash.logback</groupId> <artifactId>logsta ...

  4. Reset CSS 页面初始化css

    CSS 初始化样式(Reset CSS 官网提供): /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: non ...

  5. 从零开始利用vue-cli搭建简单音乐网站(一)

    最近在学习vue框架,练习了一些例子之后,想着搭建一个vue项目,了解到官方有提供一个vue-cli工具来搭建项目脚手架,尝试了一下,写下博客来记录一下. 一.工具环境 1.node.js 6.10. ...

  6. 设置Cookie最大存活时间

    Cookie和Session都是由Tomcat自动创建的对象,Cookie的默认最大存活时间是 -1 ,即当浏览器关闭时Cookie就消失了:Session的默认最大存活时间是30分钟. 使用Sess ...

  7. WebView全面学习(二)-- Native与js双方通信

    WebView全面学习(二)-- Native与js双方通信 Native与js通信的本质 Native与js通信的核心在于WebView. 两端的通信主要还是单向的.假如要完成js->Nati ...

  8. connect() to 192.168.30.71:8082 failed (99: Cannot assign requested address) while connecting to upstream, client: 114.80.182.136, server: localhost, request: "GET /home/senior HTTP/1.1", upstream: "

    connect() to 192.168.30.71:8082 failed (99: Cannot assign requested address) while connecting to ups ...

  9. vue中的修饰符

    Vue2.0学习笔记:Vue事件修饰符的使用   事件处理 如果需要在内联语句处理器中访问原生DOM事件.可以使用特殊变量$event,把它传入到methods中的方法中. 在Vue中,事件修饰符处理 ...

  10. springboot(二十一)-集成memcached

    Memcached 介绍 Memcached 是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载.它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态.数据库驱动网站 ...