Learn R Programming

cocoreg (version 0.1.1)

df_scale_ols: Scales variables in data.frame dfx using ordinary least squares such

Description

Scales variables in data.frame dfx using ordinary least squares such that the scaled result explains as much of the variance in dfy as possible. Scaling is done separately for each variable (i.e. no linear mixing of variables). Assumes data.frames dfx and dfy to be of identical structure. Intended use: to scale up cocoreg projections to account for the lost variance.

Usage

df_scale_ols(dfx, dfy)

Arguments

dfx
data.frame, Data frame to use as independent variable
dfy
data.frame, Data frames to use as dependent variable

Value

data.frame, A rescaled version of dfx with dimnames from dfy.

Examples

Run this code
## Not run: ------------------------------------
# dc <- create_syn_data_toy()
# ccr <- cocoreg(dc$data)
# dfLst <- mapply(df_scale_ols, ccr$data, dc$data , SIMPLIFY=F)
## ---------------------------------------------

Run the code above in your browser using DataLab