Skip to content
Prev 43903 / 398526 Next

Subset function of lm(); "rolling regressions"

You need brackets in i:(i+25)

3:3+25

is not want you

3:(3+25)

is what you want.

to explicitly print out values in a for loop you need to use print

for (i in 1:10) {
  print(i)
}


Ole