rrr: Fit Reduced-Rank Regression Model

Description Usage Arguments Value References Examples

Description

rrr fits a reduced-rank regression model.

Usage

1
rrr(x, y, type = "identity", rank = "full", k = 0)

Arguments

x

data frame or matrix of predictor variables

y

data frame or matrix of response variables

type

type of reduced-rank regression model to fit. type = "identity", the default, uses \mathbf{Γ} = \mathbf{I} to fit a reduced-rank regression. type = "pca" fits a principal component analysis model as a special case of reduced-rank regression. type = "cva" fits a canonical variate analysis model as a special case of reduced-rank regression. type = "lda" fits a linear discriminant analysis model as a special case of reduced-rank regression.

rank

rank of coefficient matrix.

k

small constant added to diagonal of covariance matrices to make inversion easier.

Value

list containing estimates of coefficients and means, and eigenvalue-based diagnostics.

References

Izenman, A.J. (2008) Modern Multivariate Statistical Techniques. Springer.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
data(tobacco)
tobacco_x <- tobacco[,4:9]
tobacco_y <- tobacco[,1:3]
rrr(tobacco_x, tobacco_y, rank = 1)

data(pendigits)
digits_features <- pendigits[, -35:-36]
rrr(digits_features, digits_features, type = "pca", rank = 3)

library(dplyr)
data(COMBO17)
galaxy <- as_data_frame(COMBO17)
galaxy <- select(galaxy, -starts_with("e."), -Nr, -UFS:-IFD)
galaxy <- na.omit(galaxy)
galaxy_x <- select(galaxy, -Rmag:-chi2red)
galaxy_y <- select(galaxy, Rmag:chi2red)
rrr(galaxy_x, galaxy_y, type = "cva", rank = 2)

data(iris)
iris_x <- iris[,1:4]
iris_y <- iris[5]
rrr(iris_x, iris_y, type = "lda")

rrr documentation built on May 1, 2019, 9:16 p.m.