Alex Rivera | Logout

How to write R formula for multivariate response?

Asked 2012-05-29T20:55:52.690
10

In R I want to do some regression on multivariate response on all predictors, for univariate response, I know the formula is like

y~., this is to use all predictors to regress y, what if now I face 100 response, I can not type 100 yi like y1+y2+y3...+y4~x, so how to use all predictors to regress multivariate response?

Edit
Report

1 Answer

14

In R, the multivariate formula is to use cbind() for your Y variable. Thus, the formula would be:

model <- lm(cbind(y1, y2, y3, y4)~x)
answered 2012-07-29T02:18:06.953

Your Answer