y <- matrix( rnorm(100 * 10000), ncol = 10000 )
x <- rnorm(100)
a <- mvbetas(y, x, pvalue = FALSE)
b <- matrix(nrow = 10000, ncol = 2)
z <- cbind(1, x)
for (i in 1:10000) b[i, ] = coef( lm.fit( z, y[, i] ) )
system.time( mvbetas(y, x) )
system.time( for (i in 1:10000) b[i, ] = coef( lm.fit( z, y[, i] ) ) )
Run the code above in your browser using DataLab