Re: [R] Simple lm/regression question

2012-02-06 Thread James Annan
On 6/2/12 19:36 , peter dalgaard wrote: Actually, I think the issue is slightly different: IDL assumes that the errors _are_ something (notice that setting measure_errors to 1 is not equvalent to omitting them), R assumes that they are _proportional_ to the inverse weights Yes, I think this i

Re: [R] Simple lm/regression question

2012-02-06 Thread peter dalgaard
On Feb 6, 2012, at 10:57 , Achim Zeileis wrote: > On Mon, 6 Feb 2012, James Annan wrote: > > > The summary() shows under "Residuals" the contributions to the objective > function, i.e. sqrt(1/w) (y - x'b) in the notation above. > > However, by using the residuals extractor function you can ge

Re: [R] Simple lm/regression question

2012-02-06 Thread Achim Zeileis
On Mon, 6 Feb 2012, James Annan wrote: I am trying to use lm for a simple linear fit with weights. The results I get from IDL (which I am more familiar with) seem correct and intuitive, but the "lm" function in R gives outputs that seem strange to me. Unweighted case: x<-1:4 y<-(1:4)^2 sum

[R] Simple lm/regression question

2012-02-05 Thread James Annan
I am trying to use lm for a simple linear fit with weights. The results I get from IDL (which I am more familiar with) seem correct and intuitive, but the "lm" function in R gives outputs that seem strange to me. Unweighted case: > x<-1:4 > y<-(1:4)^2 > summary(lm(y~x)) Call: lm(formula = y ~