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

标签 r time-series regression

我正在尝试通过对月度虚拟变量进行回归来调整时间序列(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/

相关文章:

从列表中删除重复的元素

用于非零值计算的python pandas dataframe等效函数逻辑

R - 在 ggplot 中使用面板层创建图例和单独的月份图

r - 在 R 中将 LASSO 与分类变量结合使用

R:我怎样才能拟合一个对系数有约束的回归?

r - R 中数字的逗号分隔符?

使用 UTF-8 编码的 read.csv()

r - 在 R 中的同一个图表上绘制多列

python - 是否可以使用 Jupyter Notebook 创建 Rest API?,如果可以,如何为以下 json 格式的代码创建 Rest API

python - 如何确定哪条回归曲线拟合得更好? PYTHON