Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

r - 如何估计避免多重共线性的lm虚拟回归?(How to estimate a lm dummy regression avoiding multicollinearity?)

I have a problem regression with lm on dummy variables.

(我在虚拟变量上使用lm进行问题回归。)

I want to figure out of the seasonal influence (seasonalities) change as time passes by.

(我想弄清楚随着时间的流逝季节性变化(季节性)的变化。)

I established the following regression to do so:

(为此,我建立了以下回归:)

AT.trendinseason.lm <- lm(DTR.detrended~0+dum.jan+dum.feb+dum.mar+dum.apr+dum.may+dum.jun+dum.jul+dum.aug+dum.sep+dum.oct+dum.nov+dum.dec+dum.jan*t+dum.feb*t+dum.mar*t+dum.apr*t+dum.may*t+dum.jun*t+dum.jul*t+dum.aug*t+dum.sep*t+dum.oct*t+dum.nov*t+dum.dec*t)

The output I get is the following:

(我得到的输出如下:)

summary(AT.trendinseason.lm)

Call:
lm(formula = DTR.detrended ~ 0 + dum.jan + dum.feb + dum.mar + 
    dum.apr + dum.may + dum.jun + dum.jul + dum.aug + dum.sep + 
    dum.oct + dum.nov + dum.dec + dum.jan * t + dum.feb * t + 
    dum.mar * t + dum.apr * t + dum.may * t + dum.jun * t + dum.jul * 
    t + dum.aug * t + dum.sep * t + dum.oct * t + dum.nov * t + 
    dum.dec * t)

Residuals:
    Min      1Q  Median      3Q     Max 
-9.4047 -2.2737 -0.3229  2.0987 18.9906 

Coefficients: (1 not defined because of singularities)
            Estimate Std. Error t value Pr(>|t|)    
dum.jan   -2.495e+00  1.121e-01 -22.262  < 2e-16 ***
dum.feb   -1.527e+00  1.176e-01 -12.983  < 2e-16 ***
dum.mar    2.493e-01  1.124e-01   2.218 0.026552 *  
dum.apr    1.266e+00  1.144e-01  11.073  < 2e-16 ***
dum.may    1.785e+00  1.127e-01  15.844  < 2e-16 ***
dum.jun    1.597e+00  1.147e-01  13.926  < 2e-16 ***
dum.jul    1.882e+00  1.131e-01  16.640  < 2e-16 ***
dum.aug    1.544e+00  1.126e-01  13.721  < 2e-16 ***
dum.sep    1.335e+00  1.134e-01  11.780  < 2e-16 ***
dum.oct    8.306e-02  1.117e-01   0.744 0.456961    
dum.nov   -2.545e+00  1.137e-01 -22.390  < 2e-16 ***
dum.dec   -3.101e+00  1.119e-01 -27.703  < 2e-16 ***
t         -1.343e-05  5.431e-06  -2.473 0.013389 *  
dum.jan:t -8.571e-06  7.681e-06  -1.116 0.264444    
dum.feb:t -3.094e-06  7.866e-06  -0.393 0.694090    
dum.mar:t  5.346e-06  7.681e-06   0.696 0.486406    
dum.apr:t  3.850e-05  7.744e-06   4.971 6.69e-07 ***
dum.may:t  2.748e-05  7.681e-06   3.578 0.000346 ***
dum.jun:t  2.959e-05  7.744e-06   3.821 0.000133 ***
dum.jul:t  3.384e-05  7.698e-06   4.396 1.10e-05 ***
dum.aug:t  4.494e-05  7.711e-06   5.828 5.67e-09 ***
dum.sep:t -1.921e-06  7.744e-06  -0.248 0.804105    
dum.oct:t -1.526e-05  7.681e-06  -1.987 0.046943 *  
dum.nov:t  8.864e-07  7.744e-06   0.114 0.908876    
dum.dec:t         NA         NA      NA       NA    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.093 on 35745 degrees of freedom
Multiple R-squared:  0.3145,    Adjusted R-squared:  0.314 
F-statistic: 683.2 on 24 and 35745 DF,  p-value: < 2.2e-16

But the case is that I know that there shouldn't be a problem with multicollinearity.

(但是这种情况是,我知道多重共线性应该不会有问题。)

Still R does omit my variable.

(R仍然忽略了我的变量。)

Is there a way I can prevent R from doing so?

(有什么方法可以阻止R这样做吗?)

The model I want to follow is from a paper I read and there it seemed to work out:

(我要遵循的模型来自我读过的一篇论文,似乎可以解决:)

在此处输入图片说明

This is the approach I want to take but it doesn't seem to work.

(这是我要采用的方法,但似乎没有用。)

Please help.

(请帮忙。)

  ask by Leon translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...