Re: [R] lm without intercept

2012-08-15 Thread citynorman
The cor(mtcars$mpg, fitted(m0))^2 method works great - thanks so much Josh! I've had another instance (also ex intercept) where it actually gave the correct number, odd behavior. Thanks for the other posts also. As an aside, in my application a zero intercept makes economic sense and I'm using

Re: [R] lm without intercept

2012-07-29 Thread peter dalgaard
On Feb 18, 2011, at 14:20 , Jan wrote: Hello Achim, Not quite. Consult your statistics textbook for the correct interpretation of p-values. Under the null hypothesis of a true intercept of zero, it is very likely to observe an intercept as large as 13.52 or larger. thank you for that

Re: [R] lm without intercept

2012-07-29 Thread peter dalgaard
On Feb 18, 2011, at 14:20 , Jan wrote: One of the references you googled suggests that intercepts should never be omitted. Is this true even if I know that the physical reality behind the numbers suggests an intercept of zero? No. That'll be a piece of pragmatic advice caused by the

Re: [R] lm without intercept

2012-07-28 Thread citynorman
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

Re: [R] lm without intercept

2012-07-28 Thread Joshua Wiley
Hi, R actually uses a different formula for calculating the R square depending on whether the intercept is in the model or not. You may also find this discussion helpful: http://stats.stackexchange.com/questions/7948/when-is-it-ok-to-remove-the-intercept-in-lm/ If you conceptualize R^2 as the

[R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) Greetings Chrsitof __ R-help@r-project.org mailing list

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Uwe Ligges
On 27.06.2012 09:33, Christof Kluß wrote: Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) Then we need your definition of your version of correct - we know the definition of your

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Mikko Korpela
On 06/27/2012 10:33 AM, Christof Kluß wrote: Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) Hi! This answer in R-FAQ might help you:

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread peter dalgaard
On Jun 27, 2012, at 09:33 , Christof Kluß wrote: Hi is there a command that calculates the correct adjusted R-squared, when I work without intercept? (The R-squared from lm without intercept is false.) When people say that, they are usually implying that a correct R-squared can be

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not show the R² of the regression line. When I

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Uwe Ligges
On 27.06.2012 10:36, Christof Kluß wrote: for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread peter dalgaard
On Jun 27, 2012, at 13:15 , Uwe Ligges wrote: 1 - crossprod(residuals(model)) / crossprod(y - mean(y)) And the reason why that is not used in R: y- rnorm(100,10,1) x - 1:100 model - lm(y~x-1) 1 - crossprod(residuals(model)) / crossprod(y - mean(y)) [,1] [1,] -27.60012 --

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Gabor Grothendieck
On Wed, Jun 27, 2012 at 4:36 AM, Christof Kluß ckl...@email.uni-kiel.de wrote: for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the

Re: [R] lm without intercept, false R-squared

2012-06-27 Thread Christof Kluß
for example the same model with intercept R² = 0.6, without intercept R² = 0.9 and higher. In my definition of R², R² has to be equal or less without intercept I do not know what R shows, but in the summary of the model without intercept it does not show the R² of the regression line. When I

[R] lm without intercept

2011-02-18 Thread Jan
Hi, I am not a statistics expert, so I have this question. A linear model gives me the following summary: Call: lm(formula = N ~ N_alt) Residuals: Min 1Q Median 3Q Max -110.30 -35.80 -22.77 38.07 122.76 Coefficients: Estimate Std. Error t value Pr(|t|)

Re: [R] lm without intercept

2011-02-18 Thread Achim Zeileis
On Fri, 18 Feb 2011, Jan wrote: Hi, I am not a statistics expert, so I have this question. A linear model gives me the following summary: Call: lm(formula = N ~ N_alt) Residuals: Min 1Q Median 3Q Max -110.30 -35.80 -22.77 38.07 122.76 Coefficients:

Re: [R] lm without intercept

2011-02-18 Thread Dennis Murphy
Hi: On Fri, Feb 18, 2011 at 2:49 AM, Jan jrheinlaen...@gmx.de wrote: Hi, I am not a statistics expert, so I have this question. A linear model gives me the following summary: Call: lm(formula = N ~ N_alt) Residuals: Min 1Q Median 3Q Max -110.30 -35.80 -22.77

Re: [R] lm without intercept

2011-02-18 Thread Mike Marchywka
Date: Fri, 18 Feb 2011 12:25:36 +0100 From: achim.zeil...@uibk.ac.at To: jrheinlaen...@gmx.de CC: r-help@r-project.org Subject: Re: [R] lm without intercept On Fri, 18 Feb 2011, Jan wrote: Hi, I am not a statistics expert, so I have

Re: [R] lm without intercept

2011-02-18 Thread Jay Emerson
Date: Fri, 18 Feb 2011 11:49:41 +0100 From: Jan jrheinlaen...@gmx.de To: R-help@r-project.org list r-help@r-project.org Subject: [R] lm without intercept Message-ID: 1298026181.2847.19.camel@jan-laptop Content-Type: text/plain; charset=UTF-8 Hi, I am not a statistics expert, so I have this question

Re: [R] lm without intercept

2011-02-18 Thread Jan
Hello Achim, Not quite. Consult your statistics textbook for the correct interpretation of p-values. Under the null hypothesis of a true intercept of zero, it is very likely to observe an intercept as large as 13.52 or larger. thank you for that help. I suppose the net doesn't have a

Re: [R] lm without intercept

2011-02-18 Thread Jan
Hi, thanks for your help. I'm beginning to understand things better. If you plotted your data, you would realize that whether you fit the 'best' least squares model or one with a zero intercept, the fit is not going to be very good Do the data cluster tightly around the dashed line? No, and