@@ -3,19 +3,17 @@ const SCALES = [:quantile, :linear]
33"""
44 Indicator(col; k=10, scale=:quantile, categ=false)
55
6- Transforms continuous variable into `k` indicator variables defined by
7- half-intervals of `col` values in a given `scale`. Optionally, specify the `categ `
8- option to return binary categorical values as opposed to raw 1s and 0s .
6+ Given a sequence of `k` increasing threshold values `t1 < t2 < ... < tk`,
7+ the transform converts a continuous variable `z` into a sequence of `k `
8+ variables `z <= t1`, `z <= t2`, ..., `z <= tk` .
99
10- Given a sequence of increasing threshold values `t1 < t2 < ... < tk`, the indicator
11- transform converts a continuous variable `Z` into a sequence of `k` variables
12- `Z_1 = Z <= t1`, `Z_2 = Z <= t2`, ..., `Z_k = Z <= tk`.
10+ The threshold values are a function of the `scale` option, which can be:
1311
14- ## Scales:
12+ * `:quantile` - thresholds are calculated using `quantile`s
13+ * `:linear` - thresholds are calculated using direct values
1514
16- * `:quantile` - threshold values are calculated using the `quantile(Z, p)` function
17- with a linear range of probabilities.
18- * `:linear` - threshold values are calculated using a linear range.
15+ The `categ` option can be used to enforce binary categorical values
16+ instead of raw `1` and `0` integer values.
1917
2018## Examples
2119
0 commit comments