目录​​​​​​​

Basic knowledge

Estimated standard error of βˆi

Hypothesis test for the slope parameter βi

R语言例子

Ex1:海湾捕鱼 Gulf Menhaden catch data

Using the pairs( ) function to informally judge the appropriateness of fitting linear relationships.

R outputs relevant to testing βi

T test: slope parameter β1 for vessels

Special case:Testing H0 : β1 = a in simple regression

Lab


  • Basic knowledge

Using the ANOVA table we can test the hypothesis : H0 :β1 =β2 =...=βp =0, but this F-test is of limited use.

多元线性回归中,回归方程显著并不意味着每个自变量x对y影响都显著,所以要对每个自变量进行显著性检验。

When we consider hypothesis testing for specific slope parameters. In particular, how to test H0 : βj = 0. We will use the t-test for regression estimates.

  • Estimated standard error of βˆi

The values βˆ are estimates of the true (and unknown) β.

The denominator 分母   is usually denoted , and is called the

estimated standard error of   and is easily obtained using R.

  • Hypothesis test for the slope parameter βi

    vs          Where a is a constant value.

The associated test statistic is

As with all hypothesis tests, we never accept anything. We only reject/do no reject the null H0
The most commonly, we test H0 : a = 0.

Rejection region for two-sided (most common) test α = 0.05

Rejection region for one-sided test (much less common) α = 0.05

  • R语言例子

  • Ex1:海湾捕鱼 Gulf Menhaden catch data

# Gulf Menhaden fish data
year     <- 1964:1979
# 1964到1979的16年的数据
catch    <- c(409.4, 463.1, 359.1, 317.3, 373.5, 523.7, 548.1, 728.2,501.7, 486.1, 578.6, 542.6, 561.2, 447.1, 820.0, 777.9)
vessels  <- c(76, 82, 80, 76, 69, 72, 73, 82, 75, 65,71, 78, 81, 80, 80, 77)
pressure <- c(282.9, 335.6, 381.3, 404.7, 382.3, 411.0, 400.0, 472.9,447.5, 426.2, 485.5, 536.9, 575.9, 532.7, 574.3, 533.9)
fish.dat <- data.frame(year, catch, vessels, pressure)# 使用head函数获取dataframe的前几行数据
head(fish.dat)
##   year catch vessels pressure
## 1 1964 409.4  76    282.9
## 2 1965 463.1  82    335.6
## 3 1966 359.1  80    381.3
## 4 1967 317.3  76    404.7
## 5 1968 373.5  69    382.3
## 6 1969 523.7  72    411.0

First step in a multiple regression analysis should always be to plot the data. We should first satisfy data that a linear model is appropriate at all.(画图分析模型是否正确)
In multiple regression it makes sense to plot all pairs of scatter plots, ie. plotting each variable against every other variable.(画成对的散点图)

  • Using the pairs( ) function to informally judge the appropriateness of fitting linear relationships.

This has the added benefit of showing us whether certain independent variables are correlated with each other.

?pairs
## Scatterplot Matrices 散点图矩阵
## Description: A matrix of scatterplots is produced.产生了一个散点矩阵。pairs(fish.dat)
# matrix of scatterplots for informally checking linear associations
# 用于非正式检查线性关联的散点矩阵

在此图中:你可以看到所有指定变量间的二元关系。例如year和catch的散点图可在两变量的行列交叉处找到。值得注意的是,主对角线的上方和下方的六幅散点图是相同的。

From the plots:
The relationships look plausibly linear, or at least there is nothing to suggest otherwise.
Fit a linear regression model:
We can proceed to fit a linear model for the total catch, in terms of the independent variables vessels and pressure. We are estimating  catch = β0 + β1vessels + β2pressure + ε

# fit a linear model for catch in terms of vessels and pressure
fish.lm <- lm(catch ~ vessels + pressure, data = fish.dat)
summary(fish.lm)
  • R outputs relevant to testing βi

  • T test: slope parameter β1 for vessels

   vs   

The test statistic for this null hypothesis is

Compare with critical value  

To obtain    in R, use the command qt( )

qt(p = 1 - 0.025, df = 13)
# p= 1 − α/2
## [1] 2.160369

Assume this is a two-sided test, and set α = 0.05
Since |t∗| = 0.357 < 2.16 = t13,0.025, do not reject H0.

We can also Testing H0 : βi = 0 using the p-value : 

At the α level, Reject H0 if p<α. Do not reject H0 if p≥α.

Use of the p-value is completely equivalent to using a critical level and comparing it with the observed t∗ statistic.

① Summarise the derived regression equation

catch = −119.09 + 2.278 × vessels + 1.054 × pressure + ε

The positive estimates for β1,β2 indicate that catch increases with number of vessels and fishing intensity. By 2278 tons for every extra vessel, and 1054 tons for each extra unit of intensity.

②​​​​​​​ Obtain likely catch when vessels = 80 and pressure = 400 catch80

400 = −119.09 + (2.278 × 80) + (1.054 × 400) = 484.8

So the estimated annual catch would be 484,800 tons under this scenario.

  • Special case:Testing H0 : β1 = a in simple regression

In simple regression, e.s.e(βˆ1) is easier to calculate

The test statistic t∗ therefore has the following simplified form

  • Lab

参考书籍:

Montgomery, D.C., Peck, E.A., Vining, G.G. (2012). Introduction to Linear Regression Analysis (5th Edition). Wiley. (ILRA)

何晓群 刘文卿. 应用回归分析 第五版. 中国人民大学出版社.

John O. Rawlings, Sastry G. Pantula, David A. Dickey. Applied Regression Analysis: A Research Tool.

Robert I. Kabacoff. R语言实战 第二版. (图灵程序设计丛书)

课堂笔记(3) 假设检验 Hypothesis testing相关推荐

  1. 统计学 假设检验(Hypothesis Testing)

    什么是假设检验: 通过设定一个假设, 然后通过收集数据.计算等操作来判断这个假设是否成立. 假设检验的步骤: 1. 设定 null hypothesis 和  alternative hypothes ...

  2. 假设检验 Hypothesis testing

    Hypothesis H0{H_0}H0​:零假设 Null Hypothesis H1{H_1}H1​:备择假设 Alternert Hypothesis t-test 单样本 单组和总体比(ind ...

  3. 假设检验(hypothesis testing)及P值(p-value)

    前一篇t检验的文末提到了P值的概念,P值实际上是医学统计中很常用的一个概念,那么这篇文章继续讲解什么是P值.说到P值,就得先从假设检验说起. 首先声明,此篇的内容是来自"马同学高等数学&qu ...

  4. Chapter 9 (Classical Statistical Inference): Binary Hypothesis Testing

    本文为 IntroductionIntroductionIntroduction tototo ProbabilityProbabilityProbability 的读书笔记 目录 Binary Hy ...

  5. Hypothesis Testing

    Refer to R Tutorial andExercise Solution Researchers retain or reject hypothesis based on measuremen ...

  6. Linux_01_课堂笔记

    Linux-v01天-课堂笔记 学习目标 能够知道什么是Linux系统以及它的应用场景 能够独立完成安装VMware虚拟机和网络配置 能够独立完成安装CentOS以及远程终端SecureCRT 能够熟 ...

  7. CDA level 2级课堂笔记

    CDA level 2级课堂笔记 0.1.0引言 1.感知型企业与数据应用系统的演进 敏捷分析平台(BI)–>行为数据平台(数据挖掘)–>协同思维平台(数据驱动业务)–>分析应用平台 ...

  8. 机器学习-吴恩达网易云课堂笔记

    机器学习-吴恩达网易云课堂笔记 Machine Learning: A computer program is said to learn from experience E with respect ...

  9. 管理系统中计算机应用第四章重点,管理系统中计算机应用课堂笔记第四章(4)...

    管理系统中计算机应用课堂笔记第四章(4) 分类:自考 | 更新时间:2016-07-08| 来源:转载 这个分析和抽象工作可分以下三步进行: 5.2.1数据流程图的绘制 数据流程图既是对原系统进行分析 ...

最新文章

  1. python 调用 C语言函数
  2. 普通平键的主要尺寸有_艾创米:解密指纹锁锁体尺寸测量方法
  3. WPF 绘制对齐像素的清晰显示的线条
  4. 赵雅智_Swift(2)_swift常量和变量
  5. html5自动生成图片,HTML5拖放API如何实现自动生成相框功能 HTML5拖放API实现自动生成相框功能代码...
  6. 关于iframe跨域实践(转载)
  7. MS17010漏洞利用姿势
  8. python3 爬虫 urlretrieve
  9. 公众号引流进阶教程(公众号对接电影,影视资源)
  10. 腾讯云直播生成 推流地址 拉流地址
  11. 【Java程序员面试】直接被SpringBoot干趴?NONONO!拒绝做冤大头!!
  12. System.Net.WebException: 基础连接已经关闭: 未能为 SSL/TLS 安全通道建立信任关系。 ---> System.Security.Authentication.Authe
  13. 小米游戏本 七代 deepin 网卡ac 8265 wifi 驱动 安装
  14. Pboot插件-包含所有Pboot插件功能
  15. Layer Tree 绘制
  16. ArcGIS 中的标准分类方法(相等、分位、自然断裂、标准差)
  17. edge浏览器 您的flash可能被禁用或者版本过低
  18. Python 元组() (元素不能修改),元组的定义,元组与列表的转换,元组的应用场景
  19. Qt编写地图综合应用57-跨平台(win、linux、mac、uos、kylin等)
  20. 禾川HCQ+X3E ModBUS 电机远程启动

热门文章

  1. 那些年让人迷惑的同步、异步、阻塞、非阻塞
  2. EasyPoi word导出教程
  3. EXCEL数值变为文本型
  4. MATLAB水箱液位模糊控制仿真程序
  5. ionic 环境搭建,运行项目到浏览器,android手机,模拟器
  6. IT人的架构书单:如何赋予软件以灵魂
  7. python乘法函数_乘积(python乘法函数)
  8. 关于Docker以及安装方法
  9. 行业寒冬下,简历发了几千次已读不回,功能测试的出路在哪里?
  10. d3.js 旋转图形_苏教版三年级数学上册第六单元平移、旋转和轴对称(6.1~6.2)微课视频 | 练习...