normalize.covariates: Normalize the covariates of a data set to lie in the unit...

View source: R/BoundingCovariateEffects.R

normalize.covariatesR Documentation

Normalize the covariates of a data set to lie in the unit interval by scaling based on the ranges of the covariates.

Description

This function normalized the covariates in the data to lie in the unit interval based on either the empirical or known ranges of the covariates. It is useful to perform this step when defining the instrumental functions later on. This function is used in G.box.R, G.spline.R and by extension in G.cd.R.

Usage

normalize.covariates(
  data = NULL,
  x = NULL,
  cov.ranges = NULL,
  idxs.c = "all",
  norm.cov.out = NULL,
  ...
)

Arguments

data

(optional) Data set to be used to construct the normalizing transformation. Default is data = NULL.

x

(optional) Vector of covariates to be normalized alongside the data. Default is x = NULL.

cov.ranges

(optional) Matrix that specifies the range of each of the covariates in the data set. Each column corresponds to a covariate. The first row contains the lower bound, the second row contains the upper bound. If not supplied, the data will be normalized based on the minimum and maximum detected values. If supplied, the non data-dependent transformation function listed in the appendix of Andrews, Shi 2013 will be used. Default is cov.ranges = NULL.

idxs.c

(optional) Vector of indices of covariates that are continuous. Note that that indices are relative to the covariate vector, not the full data set. Default value is idxs.c = "all", which indicates that all elements should be regarded as continuous. If idxs.c = NULL, all elements are regarded as discrete.

norm.cov.out

(optional) The output of a previous call to this function. Can be used to speed up computation. If both data and norm.cov.out are supplied to the function, this method will throw an error. Default is norm.cov.out = NULL.

...

Allows easier interchangeability between covariate normalization functions. All arguments specified under ... will be ignored.

References

Andrews, D.W.K. and Shi, X. (2013). Inference based on confitional moment inequalities. Econometrica. 81(2):609-666.


depCensoring documentation built on April 4, 2025, 1:52 a.m.