Learn R Programming

Compositional (version 1.0)

multivreg: Multivariate linear regression

Description

Multivariate linear regression.

Usage

multivreg(y, x, plot = TRUE, xnew = NULL)

Arguments

y
A matrix with the Eucldidean (continuous) data.
x
The predictor variable(s), they have to be continuous.
plot
Should a plot appear or not?
xnew
If you have new data use it, otherwise leave it NULL.

Value

  • A list including:
  • sumaA summary as produced by lm, which inlcudes the coefficients, their standard error, t-values, p-values.
  • r.squaredThe value of the $R^2$ for each univariate regression.
  • resid.outliersA vector with number indicating which vectors are potential residual outliers.
  • x.leverageA vector with number indicating which vectors are potential outliers in the predicto variables space.
  • x.leverageA vector with number indicating which vectors are potential outliers in the residuals and in the predictor variables space.
  • estThe fitted values if xnew is NULL, or the predicted values otherwise.

Details

The classical multivariate linear regression model is obtained.

References

K.V. Mardia, J.T. Kent and J.M. Bibby (1979). Multivariate Analysis. Academic Press.

See Also

diri.reg, esov.compreg, kl.compreg, ols.compreg, comp.reg

Examples

Run this code
library(MASS)
x <- iris[, 1:2]
y<- iris[, 3:4]
multivreg(y, x, plot = TRUE)

Run the code above in your browser using DataLab