I am quite new to R and I am having trouble figuring out how to select
variables in a multivariate linear regression in R. My google-fu also
did not find anything.

Pretend I have the following formulas:

P = aX + bY
Q = cZ + bY

I have a data frame with column P, Q, X, Y, Z and I need to find a, b and c.

If I do a simple multivariate regression:

result <- lm( cbind( P, Q ) ~ X + Y + Z - 1 )

It calculates a coefficient for "c" on P's regression and for "a" on
Q's regression.

If I calculate the regressions individually then "b" will be different
in each regression.

How can I select the variables to consider in a multivariate
regression? I.e., how do I tell R to ignore cZ when calculating P, and
ignore aX when calculating Q?

Thank you,
Edson

______________________________________________
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.

Reply via email to