Skip to content
Prev 109067 / 398500 Next

loop issues (r.squared)

The most straight forward way that I can think of is just:
columns

That will give you all the R^2 values for regressing 1 column on 1
column (it is called R-squared for a reason).

If you want the R^2 values for regressing one column on all other
columns in the matrix, then a short-cut is:
Both should be much faster than looping, the 2nd may give problems in
trying to invert a very large matrix.

Hope this helps,