Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

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

Example:
; 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)

Result:
Content of object u

[1,]       46
[2,]       43
[3,]       28



Author: H.-J. Mucha, S. Klinke, 20010912
(C) MD*TECH Method and Data Technologies, 05.02.2006