0

Can I ask please:

Using ols in lm. I found "surprise", when x is vector (mean is 0) and y is vector of 1 1 1 ...or vector of 0 0 0...(constant)

When "forcing" lm without intercept (y~x-1), i get model where residuals "dont oscilate around 1". When I did calculate coefficient manualy and its exactly same. Example in r:

x=c(-0.0021,0.0042,0.0047,0.0083-0.0001,0.0010,0.0038,0.0034,0.0034,0.0066,0.0056,0.0043,0.0082-0.0129-0.0094,0.0048,0.0050-0.0133)
y=rep(1,14)

m=lm(y~x-1)
plot(m$fitted)
plot(x*47.74)

(Can I ask, whats wrong when y="constant vector" in ols ? :-)

Thanks alot

user2120
  • 48
  • 1
  • 10
  • Here's a good site search for (much) more about this topic: https://stats.stackexchange.com/search?q=regression+origin+score%3A2 – whuber Jan 14 '21 at 21:17
  • @whuber thank for answer :) (btw q became closed, i am reading all suggestions :-) – user2120 Jan 14 '21 at 21:25

0 Answers0