Title: | An R Package for Data Reduction by Battery Reduction |
---|---|
Description: | Battery reduction is a method used in data reduction. It uses Gram-Schmidt orthogonal rotations to find out a subset of variables best representing the original set of variables. |
Authors: | Chunqiao Luo [aut, cre], Ralph D'Agostino [aut] (This package is derived from Battery Reduction Macro at http://www.lexjansen.com/nesug/nesug92/NESUG92090.pdf) |
Maintainer: | Chunqiao Luo <[email protected]> |
License: | GPL |
Version: | 0.1.1 |
Built: | 2025-03-12 02:42:28 UTC |
Source: | https://github.com/cran/batteryreduction |
Battery reduction is a method used in data reduction. It uses Gram-Schmidt orthogonal rotations to find out a subset of variables best representing the original set of variables.
batteryreduction(vars, numfact, data)
batteryreduction(vars, numfact, data)
vars |
a vector of variable names |
numfact |
numeric, number of variables to be selected |
data |
a dataframe |
If numfact=1, reda matrix and selected variable are returned. If numfact>=2, reda matrix, rota matrix, and selected variables are returned.
D'Agostino, R. B., & Zhang, Z. (1992). Data/variable reduction by principal components, battery reduction and variable clustering. MATRIX, 7(60), 06.
Hans Werner Borchers (2015). pracma: Practical Numerical Math Functions. R package version 1.8.6. http://CRAN.R-project.org/package=pracma
## Generate an example dataset set.seed(1234) data<-data.frame(x1=rnorm(n=100, mean=14, sd=7), x2=rnorm(n=100, mean=3, sd=1), x3=rpois(n=100, lambda=1), x4=rpois(n=100, lambda=10), x5=rgamma(n=100, shape=1), x6=rgamma(n=100, shape=10)) ## Demonstrate batteryreduction vars<-c('x1','x2','x3','x4','x5','x6') numfact<-3 batteryreduction(vars, numfact, data)
## Generate an example dataset set.seed(1234) data<-data.frame(x1=rnorm(n=100, mean=14, sd=7), x2=rnorm(n=100, mean=3, sd=1), x3=rpois(n=100, lambda=1), x4=rpois(n=100, lambda=10), x5=rgamma(n=100, shape=1), x6=rgamma(n=100, shape=10)) ## Demonstrate batteryreduction vars<-c('x1','x2','x3','x4','x5','x6') numfact<-3 batteryreduction(vars, numfact, data)