# utild1bin: Vector Binarizer In stheoreme: Klimontovich's S-Theorem Algorithm Implementation and Data Preparation Tools

## Description

Function `utild1bin` is applied to a pair of vectors and convert them to the pair of binary arrays with a rule specified by user

## Usage

 `1` ```utild1bin(arr0, arr1, method = "mean", trsh = 0, inverted = FALSE, d2=FALSE) ```

## Arguments

 `arr0` vector of values/outcomes to be binarized `arr1` vector of values/outcomes to be binarized `method` method of setting a threshold: `method='mean'` threshold is `mean(c(arr0, arr1))` for both arrays (used as default) `method='imean'` setting individual thresholds as mean values `method='imed'` setting individual thresholds as median values `method='i1stQ'` setting individual thresholds as 1st quartile values `method='i3rdQ'` setting individual thresholds as 3rd quartile values `method='isubsd'` setting individual thresholds as (`mean(arrN)-sd(arrN)`) `method='iaddsd'` setting individual thresholds as (`mean(arrN)+sd(arrN)`) `method='med'` threshold is `median(c(arr0, arr1))` for both arrays `method='med0'` threshold is `median(c(arr0))` for both arrays `method='med1'` threshold is `median(c(arr1))` for both arrays `method='mean0'` threshold is `mean(c(arr0))` for both arrays `method='mean1'` threshold is `mean(c(arr1))` for both arrays `method='spec'` threshold is specified by the 2 numbers of argument `trsh` individually for arrays `trsh` specifies the individual threshold values for array binarizations when `method='spec'` is chosen. If it contains one number it will be interpreted as one threshold for both the arrays `inverted` logical item specifying if the result will be inverted (zeros replaced by ones and ones replaced by zeros) after bianrization `d2` works exactly as `utild2bin` when TRUE

## Value

 `bin0 ` result of arr0 binarization `bin1 ` result of arr1 binarization `counts ` summary/report of how the arrays were binarized

## Author(s)

Vitaly Efremov <[email protected]>

`utild2bin`
 ```1 2 3 4 5 6``` ```s0<-rep(c(-1,1,3,7,10),2) s1<-c(1:7) s0; s1 a<-utild1bin(arr0=s0, arr1=s1); a a<-utild1bin(s0, s1, method='spec', trsh=c(2,5), inverted=TRUE); a ```