Hi, everyone, This is a little silly, but I cant figure out the algorithm behind lm.fit function used in the context of promax rotation algorithm:
The promax function is: promax <- function(x, m = 4) { if(ncol(x) < 2) return(x) dn <- dimnames(x) xx <- varimax(x) x <- xx$loadings Q <- x * abs(x)^(m-1) U <- lm.fit(x, Q)$coefficients d <- diag(solve(t(U) %*% U)) U <- U %*% diag(sqrt(d)) dimnames(U) <- NULL z <- x %*% U U <- xx$rotmat %*% U dimnames(z) <- dn class(z) <- "loadings" list(loadings = z, rotmat = U, crap = x, coeff = Q) } And the line I'm having trouble with is: U <- lm.fit(x, Q)$coefficients I'm trying to rewrite this routine in Java and got stuck on the lm.fit part. Thanks, ~Pavlo ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.