Skip to content
Prev 301569 / 398503 Next

lm without intercept

I've just picked up R (been using Matlab, Eviews etc) and I'm having the same
issue. Running reg=lm(ticker1~ticker2)  gives R^2=50% while running
reg=lm(ticker1~0+ticker2) gives R^2=99%!! The charts suggest the fit is
worse not better and indeed Eviews/Excel/Matlab all say R^2=15% with
intercept=0. How come R calculates a totally different value?!

Call:
lm(formula = ticker1 ~ ticker2)

Residuals:
     Min       1Q   Median       3Q      Max 
-0.22441 -0.03380  0.01099  0.04891  0.16688 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  1.57062    0.08187   19.18   <2e-16 ***
ticker2      0.61722    0.02699   22.87   <2e-16 ***
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 

Residual standard error: 0.07754 on 530 degrees of freedom
Multiple R-squared: 0.4967,	Adjusted R-squared: 0.4958 
F-statistic: 523.1 on 1 and 530 DF,  p-value: < 2.2e-16

Call:
lm(formula = ticker1 ~ 0 + ticker2)

Residuals:
      Min        1Q    Median        3Q       Max 
-0.270785 -0.069280 -0.007945  0.087340  0.268786 

Coefficients:
        Estimate Std. Error t value Pr(>|t|)    
ticker2 1.134508   0.001441   787.2   <2e-16 ***
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 

Residual standard error: 0.1008 on 531 degrees of freedom
Multiple R-squared: 0.9991,	Adjusted R-squared: 0.9991 
F-statistic: 6.197e+05 on 1 and 531 DF,  p-value: < 2.2e-16  


Jan private wrote
--
View this message in context: http://r.789695.n4.nabble.com/lm-without-intercept-tp3312429p4638204.html
Sent from the R help mailing list archive at Nabble.com.