gOLS: Groupwise OLS (gOLS)

Description Usage Arguments Details Value References Examples

View source: R/sSDR.R

Description

Groupwise OLS (gOLS)

Usage

1
gOLS(X, Y, groups, dims)

Arguments

X

A covariate matrix of n observations and p predictors.

Y

A univariate response.

groups

A vector with the number of predictors in each group.

dims

A vector with the dimension (at most 1) for each predictor group.

Details

This function estimates directions for each predictor group using gOLS. Predictors need to be organized in groups within the "X" matrix, as the same order saved in "groups". We only allow continuous covariates in the "X" matrix; while categorical covariates can be handled outside of gOLS, e.g. structured OLS.

Value

gOLS returns a list containning at least the following components: "b_est", the estimated directions for each group with its own dimension using gOLS AFTER normalization; "B", the estimated directions for each group using gOLS BEFORE normalization.

References

Liu, Y., Chiaromonte, F., and Li, B. (2015). Structured Ordinary Least Squares: a sufficient dimension reduction approach for regressions with partitioned predictors and heterogeneous units. Submitted.

Examples

1
2
3
4
5
6
7
data <- gen.data(n=1000, binary=FALSE) # generate data
dim(data$X) # covariate matrix of 1000 observations and 15 predictors
dim(data$y) # univariate response
groups <- c(5, 10) # two predictor groups and their numbers of predictors
dims <- c(1,1) # dimension of each predictor group
est_gOLS <- gOLS(data$X,data$y,groups,dims)
names(est_gOLS)

sSDR documentation built on May 1, 2019, 8:23 p.m.

Related to gOLS in sSDR...