Library: | xclust |
See also: | conting measure contmax pswap agglom |
Quantlet: | recode | |
Description: | allocates categories 1,2,...,L to intervals of categories. The upper bounds of the intervals have to be specified. It is an useful tool to join classes and hence to collaps contingency tables. |
Usage: | u = recode(c, p) | |
Input: | ||
c | l x 1 matrix of upper bounds (cutpoints) of intervals according to p | |
p | n x 1 matrix of categories (positive integers 1,2,...,K) which have to be recoded into a smaller number of integers 1,2,...,l | |
Output: | ||
u | n x 1 matrix, containing the new categories of p |
; load the library xclust library("xclust") p = #(2, 1, 3, 4, 3, 2, 1, 4, 5, 4, 3, 2, 4, 1, 1, 2, 1, 4, 5) c = #(2, 4, 5) recode(p,c)
Content of object u [1,] 46 [2,] 43 [3,] 28