<pnick <at> virgilio.it> writes: > > i need to know how to estimate a linear regression whose coefficients sum > to zero >
Transform the model: y = Xb + error to y = XPb + error where P is the projection onto the orthogonal complement of the vector 1. Solve this regression for b and then Pb will be your desired coefficients. In R this would be: n <- ncol(X) P <- diag(n)-matrix(1,n,n)/n z <- lm(y ~.-1, data=(X%*%P)) b <- coef(z) b[is.na(b)] <- 0 P %*% b ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
