ISMとCLI(composite leading indicator )の関連について
データの用意
cliとismのxtsデータをマージしてデータセットwを用意する。
それぞれの列名の適切に変更する。
TERM <- "2014-10::2023-10"
merge(cli_g20[TERM],cli_usa[TERM],ism_mfg[TERM],ism_svc[TERM]) -> w
colnames(w)
colnames(w) <- c("g20","usa","ismmfg","ismsvc")
完成したデータセット
w
g20 usa ismmfg ismsvc
2014-10-01 100.22750 100.90270 56.6 58.6
2014-11-01 100.22250 100.85760 59.0 57.1
2014-12-01 100.21390 100.78940 58.7 59.3
2015-01-01 100.19840 100.69890 55.5 56.2
2015-02-01 100.18450 100.59270 53.5 56.7
2015-03-01 100.17940 100.48130 52.9 56.9
2015-04-01 100.16710 100.37000 51.5 56.5
2015-05-01 100.12700 100.25220 51.5 57.8
2015-06-01 100.04920 100.12390 52.8 55.7
2015-07-01 99.93338 99.96368 53.5 56.0
...
2023-01-01 99.05477 98.84855 48.4 49.6
2023-02-01 99.19228 98.84138 47.4 55.2
2023-03-01 99.33978 98.85299 47.7 55.1
2023-04-01 99.48746 98.90076 46.3 51.2
2023-05-01 99.63204 98.98556 47.1 51.9
2023-06-01 99.77857 99.10077 46.9 50.3
2023-07-01 99.92024 99.21838 46.0 53.9
2023-08-01 100.05250 99.32928 46.4 52.7
2023-09-01 100.17240 99.43206 47.6 54.5
2023-10-01 NA NA 49.0 53.6
重回帰分析
「summary(lm(w$usa ~ w$ismmfg+w$ismsvc))」を実施。結果は以下のとおり。ISMとCLIでデータ日付と実際のデータの参照先が違うので、配列のインデックスで調整する。
dim(w)
[1] 109 4
summary(lm(w$usa[1:108,] ~ w$ismmfg[2:109,]+w$ismsvc[2:109,]))
Call:
lm(formula = w$usa[1:108, ] ~ w$ismmfg[2:109, ] + w$ismsvc[2:109,
])
Residuals:
Min 1Q Median 3Q Max
-3.5275 -0.2382 0.0672 0.4412 1.1163
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 85.75022 1.19021 72.046 < 2e-16 ***
w$ismmfg[2:109, ] 0.09724 0.02387 4.073 9.03e-05 ***
w$ismsvc[2:109, ] 0.15234 0.03186 4.782 5.69e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7867 on 105 degrees of freedom
Multiple R-squared: 0.6041, Adjusted R-squared: 0.5965
F-statistic: 80.1 on 2 and 105 DF, p-value: < 2.2e-16
決定係数は低め(0.5965)だが、p値は十分以上に低い(p-value: < 2.2e-16)。統計学的に有意である。
参考
dim(w)[1]
# [1] 109
summary(lm(w$usa[1:(dim(w)[1]-1),] ~ w$ismmfg[2:(dim(w)[1]),]+w$ismsvc[2:(dim(w)[1]),]))
Call:
lm(formula = w$usa[1:(dim(w)[1] - 1), ] ~ w$ismmfg[2:(dim(w)[1]),
] + w$ismsvc[2:(dim(w)[1]), ])
Residuals:
Min 1Q Median 3Q Max
-3.5275 -0.2382 0.0672 0.4412 1.1163
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 85.75022 1.19021 72.046 < 2e-16 ***
w$ismmfg[2:(dim(w)[1]), ] 0.09724 0.02387 4.073 9.03e-05 ***
w$ismsvc[2:(dim(w)[1]), ] 0.15234 0.03186 4.782 5.69e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7867 on 105 degrees of freedom
Multiple R-squared: 0.6041, Adjusted R-squared: 0.5965
F-statistic: 80.1 on 2 and 105 DF, p-value: < 2.2e-16