NFCI vs. CLI delta

データの準備

TERM <- "2003::2023-09"
(to.monthly(NFCI)[,4] %>% diff())[TERM]
diff(cli_usa)[TERM]

cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM],diff(cli_usa)[TERM])
length(diff(cli_usa)[TERM])
cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM][-249],diff(cli_usa)[TERM][-1])
cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM][c(-248,-249)],diff(cli_usa)[TERM][c(-1,-2)])

当月同士の比較

cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM],diff(cli_usa)[TERM])

	Pearson's product-moment correlation

data:  (to.monthly(NFCI)[, 4] %>% diff())[TERM] and diff(cli_usa)[TERM]
t = -4.2252, df = 247, p-value = 3.361e-05
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.3719342 -0.1398186
sample estimates:
       cor 
-0.2596222 

NFCI 2カ月前と当月のCLI delta の比較

それぞれの配列の先頭と最後を外すことで相関の対象を操作する。

diff(cli_usa)[TERM] %>%  length
# [1] 249
cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM][c(-248,-249)],diff(cli_usa)[TERM][c(-1,-2)])

	Pearson's product-moment correlation

data:  (to.monthly(NFCI)[, 4] %>% diff())[TERM][c(-248, -249)] and diff(cli_usa)[TERM][c(-1, -2)]
t = -4.6021, df = 245, p-value = 6.715e-06
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.3930601 -0.1629995
sample estimates:
       cor 
-0.2820799 

前月NFCIと当月のCLI delta の比較


cor.test((to.monthly(NFCI)[,4] %>% diff())[TERM][-249],diff(cli_usa)[TERM][-1])

	Pearson's product-moment correlation

data:  (to.monthly(NFCI)[, 4] %>% diff())[TERM][-249] and diff(cli_usa)[TERM][-1]
t = -9.2021, df = 246, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.5932117 -0.4071349
sample estimates:
      cor 
-0.506038 


結論

CLIのdeltaはひと月前のNFCI変化値と最もよく相関する

重回帰分析


summary(lm(diff(cli_usa)[TERM][-1] ~ (to.monthly(NFCI)[,4] %>% diff())[TERM][-249] +  (to.monthly(NFCI)[,4])[TERM][-249] ))

Call:
lm(formula = diff(cli_usa)[TERM][-1] ~ (to.monthly(NFCI)[, 4] %>% 
    diff())[TERM][-249] + (to.monthly(NFCI)[, 4])[TERM][-249])

Residuals:
    Min      1Q  Median      3Q     Max 
-4.0240 -0.1077 -0.0117  0.0844  1.5999 

Coefficients:
                                               Estimate Std. Error t value Pr(>|t|)    
(Intercept)                                    -0.04077    0.02824  -1.444  0.15013    
(to.monthly(NFCI)[, 4] %>% diff())[TERM][-249] -1.38774    0.15683  -8.849  < 2e-16 ***
(to.monthly(NFCI)[, 4])[TERM][-249]            -0.13426    0.04302  -3.121  0.00202 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.3729 on 245 degrees of freedom
Multiple R-squared:  0.2845,	Adjusted R-squared:  0.2787 
F-statistic: 48.71 on 2 and 245 DF,  p-value: < 2.2e-16


この記事が気に入ったらサポートをしてみませんか?