R语言EG(Engle

您所在的位置:网站首页 eg协整检验原理 R语言EG(Engle

R语言EG(Engle

2023-12-14 14:09| 来源: 网络整理| 查看: 265

0 分享至

用微信扫码二维码

分享至好友和朋友圈

全文链接:http://tecdat.cn/?p=31108

作为衡量通货膨胀的基本指标,消费者价格指数CPI和生产者价格指数PPI的作用关系与传导机制一直是宏观经济研究的核心问题。(点击文末“阅读原文”获取完整代码数据)。

对此问题的研究显然具有重要的学术价值与现实意义:当PPI先行地引导着CPI的变动,则意味着上游价格对下游价格具有正向传导效应,物价可能因供给因素的冲击而上升,并由此引发“成本推动型通胀”的风险,此时,通胀治理应以“供给调控”为主;反之,当CPI引导着PPI的变动,则意味着存在下游价格对上游价格的反向倒逼机制,物价可能因需求因素的冲击而上升,并由此引发“需求拉动型通胀”的风险,此时的通胀治理则应以“需求调控”为主。

相关视频

我们围绕因果关系检验技术进行一些咨询,帮助客户解决独特的业务问题。

数据:CPI与PPI 月度同比数据

读取数据head(data)

## 当月同比 CPI PPI## 1 36556 -0.2 0.03## 2 36585 0.7 1.20## 3 36616 -0.2 1.87## 4 36646 -0.3 2.59## 5 36677 0.1 0.67## 6 36707 0.5 2.95

CPI数据

## Residuals:## Min 1Q Median 3Q Max## -4.3232 -1.2663 -0.5472 0.9925 6.3941## Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 1.05348 0.30673 3.435 0.000731 ***## t 0.01278 0.00280 4.564 9.05e-06 ***## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1## Residual standard error: 2.1 on 187 degrees of freedom## Multiple R-squared: 0.1002, Adjusted R-squared: 0.09543## F-statistic: 20.83 on 1 and 187 DF, p-value: 9.055e-061、 单位根检验

查看数据后发现需要进行季节调整

给出输出结果:

点击标题查阅往期内容

01

02

03

04

## Augmented Dickey-Fuller Test## data: x## Dickey-Fuller = -2.0274, Lag order = 0, p-value = 0.4353## alternative hypothesis: explosive## # Augmented Dickey-Fuller Test Unit Root Test #

## Test regression trend

## Call:## lm(formula = z.diff ~ z.lag.1 + 1 + tt)## Residuals:## Min 1Q Median 3Q Max## -2.66698 -0.36462 0.02973 0.39311 1.97552## Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) 1.063e-01 9.513e-02 1.117 0.2653## z.lag.1 -4.463e-02 2.201e-02 -2.027 0.0441 *## tt 4.876e-05 8.954e-04 0.054 0.9566## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1## Residual standard error: 0.6307 on 185 degrees of freedom## Multiple R-squared: 0.0238, Adjusted R-squared: 0.01324## F-statistic: 2.255 on 2 and 185 DF, p-value: 0.1077

## Value of test-statistic is: -2.0274 1.5177 2.255## Critical values for test statistics:## 1pct 5pct 10pct## tau3 -3.99 -3.43 -3.13## phi2 6.22 4.75 4.07## phi3 8.43 6.49 5.47PPI数据

## Augmented Dickey-Fuller Test## data: x## Dickey-Fuller = -1.3853, Lag order = 0, p-value = 0.1667## alternative hypothesis: explosive

(1)若存在单位根,用差分后序列进行2、3、4 步;

(2)若不存在单位根,就用原序列。

因此,对两个数据都进行差分。

data$CPI=c(0,diff(data$CPI))2、 检验协整关系——EG两步法

给出输出结果

(1)若存在长期协整,用VECM法线性过滤,利用利用过滤后的“残差成分”再进行3,4 步;

(2)若不存在长期协整,就不用过滤,直接进行3、4步。

建立长期均衡模型## Call:## lm(formula = PPI ~ CPI, data = data)## Residuals:## Min 1Q Median 3Q Max## -3.6930 -0.5071 -0.0322 0.4637 3.2085## Coefficients:## Estimate Std. Error t value Pr(>|t|)## (Intercept) -0.03678 0.06428 -0.572 0.568## CPI 0.54389 0.10176 5.345 2.61e-07 ***## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1## Residual standard error: 0.8836 on 187 degrees of freedom## Multiple R-squared: 0.1325, Adjusted R-squared: 0.1279## F-statistic: 28.57 on 1 and 187 DF, p-value: 2.615e-07绘制残差ts.plot( residual

不存在长期协整,就不用过滤,直接进行3、4步

3、 非线性检验——RESET检验方法

给出输出结果

## RESET test## data: data$PPI ~ data$CPI## RESET = 0.28396, df1 = 1, df2 = 186, p-value = 0.59484、 建立VAR模型、格兰杰因果检验

建立VAR模型给出输出结果

## $Granger## Granger causality H0: CPI do not Granger-cause PPI## data: VAR object var.2c## F-Test = 5.1234, df1 = 2, df2 = 364, p-value = 0.006392

## $Instant## H0: No instantaneous causality between: CPI and PPI## data: VAR object var.2c## Chi-squared = 15.015, df = 1, p-value = 0.0001067

p值小于给定的显著性水平拒绝,一般p值小于0.05,特殊情况下可以放宽到0.1。f统计量大于分位点即可。一般看p值。

格兰杰检验主要看P值即可。例如,若P值小于0.1,则拒绝原假设,变量间存在格兰杰因果关系。

本文中分析的数据会员群,扫描下面二维码即可加群!

获取全文完整代码数据资料。

本文选自《R语言EG(Engle-Granger)两步法协整检验、RESET、格兰杰因果检验、VAR模型分析CPI和PPI关系》。

点击标题查阅往期内容

特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。

Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.

/阅读下一篇/ 返回网易首页 下载网易新闻客户端


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3