gpt4 book ai didi

r - 带有虚拟变量的时间序列变量的多元回归

转载 作者:行者123 更新时间:2023-12-05 07:39:47 26 4
gpt4 key购买 nike

我正在尝试通过对月度虚拟变量进行回归来调整时间序列(8 年)自变量(197 个变量)的季节性。我将我的假人编码如下:

dummy1 <- model.matrix( ~ intraMonth, data = AnovaDataAll)

之后,我使用虚拟变量对每个变量的因变量进行回归:

MultReg <- lapply(CorData[c(-1, -c(195:293))], function(x) summary(lm(formula = ReturnIndex ~ x + dummy1, data = CorData))) 

回归分析为我提供了以下结果(例如第一个变量 = 股权):

$equity

Call:
lm(formula = ReturnIndex ~ x + dummy1, data = CorData)

Residuals:
Min 1Q Median 3Q Max
-49.273 -5.263 0.640 5.560 45.373

Coefficients: (1 not defined because of singularities)
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.7610 1.9749 -0.385 0.7002
x -0.3586 0.6165 -0.582 0.5611
dummy1(Intercept) NA NA NA NA
dummy1intraMonth2 4.8220 2.8404 1.698 0.0903 .
dummy1intraMonth3 2.5903 2.7683 0.936 0.3500
dummy1intraMonth4 1.7586 2.8082 0.626 0.5315
dummy1intraMonth5 1.6997 2.7823 0.611 0.5416
dummy1intraMonth6 3.1196 2.8143 1.108 0.2683
dummy1intraMonth7 2.5446 2.7546 0.924 0.3562
dummy1intraMonth8 -1.7986 2.7646 -0.651 0.5157
dummy1intraMonth9 2.5249 2.7768 0.909 0.3637
dummy1intraMonth10 1.9284 2.7982 0.689 0.4911
dummy1intraMonth11 3.9216 2.7773 1.412 0.1587
dummy1intraMonth12 0.9890 2.9464 0.336 0.7373
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 11.55 on 406 degrees of freedom
Multiple R-squared: 0.02259, Adjusted R-squared: -0.006298
F-statistic: 0.782 on 12 and 406 DF, p-value: 0.6692

我想知道我是否成功地对我的回归模型进行了季节性调整。此外,我想通过查看它们的 t 统计量来对所有变量进行统计显着性排名。根据上面的输出,我是否只需查看“x”行并取 -0.582 的 t 值?我如何解释第一个虚拟人(在本例中为 January Dummy)的截距?如果我将截距设置在 12 月虚拟机而不是 1 月,这有关系吗?

最佳答案

Based on the upper Output, do I simply have to look at the "x" row and take the t value of -0.582?

是的。

How do I interpret the intercept of the first dummy (in this case January Dummy)? Does it matter, if I set the intercept on the December dummy rather on January?

您只会得到 11 个虚拟变量(例如,两个分类 - 一个变量,等等)。您可以将月份中的任何一个作为截距。

关于r - 带有虚拟变量的时间序列变量的多元回归,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46879044/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com