Displaying 1 result from an estimated 1 matches for "myr2fun".
Did you mean:
myfun
2007 Feb 12
3
processing a large matrix
I would like to compare every column in my matrix with every other column and
get the r-squared.
I tried using the following formula and looping through every column:
> summary(lm(matrix[,x]~matrix[,y]))$r.squared
If I have 10,000 columns, the loops (10,000 * 10,000) take forever even if
there is no formula inside.
Then, I attempted to vectorize my code:
> cor(matrix)^2
With 10,000