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: xplore
See also: bindatatocl

Quantlet: cltobindata
Description: Bins a classified data set cl with frequencies fr

Usage: {xb,yb,d,orig} = cltobin (gr, fr)
Input:
gr m x 1 vector of interval bounds
fr (m-1) x 1 vector of frequencies corresponding to each interval of cl
Output:
xb n x 1 vector, the indices of the nonempty bin
yb n x 1 vector of frequencies corresponding bins of xb
d scalar - the binwidth of this equidistant grid
orig scalar - the origin

Note:

Example:
library("xplore")
x=aseq(2,10,3)
y=#(1,6,4,3,15,10,9,4,5)
cltobindata(x,y)

Result:
Contents of _tmp.xb
[ 1,]        0
[ 2,]        1
[ 3,]        1
[ 4,]        1
[ 5,]        1
[ 6,]        1
[ 7,]        1
[ 8,]        2
[ 9,]        2
[10,]        2
[11,]        2
[12,]        3
[13,]        3
[14,]        3
[15,]        4
[16,]        4
[17,]        4
[18,]        4
[19,]        4
[20,]        4
[21,]        4
[22,]        4
[23,]        4
[24,]        4
[25,]        4
[26,]        4
[27,]        4
[28,]        4
[29,]        4
[30,]        5
[31,]        5
[32,]        5
[33,]        5
[34,]        5
[35,]        5
[36,]        5
[37,]        5
[38,]        5
[39,]        5
[40,]        6
[41,]        6
[42,]        6
[43,]        6
[44,]        6
[45,]        6
[46,]        6
[47,]        6
[48,]        6
[49,]        7
[50,]        7
[51,]        7
[52,]        7
[53,]        8
[54,]        8
[55,]        8
[56,]        8
[57,]        8

Contents of _tmp.yb
[ 1,]        1
[ 2,]        6
[ 3,]        0
[ 4,]        0
[ 5,]        0
[ 6,]        0
[ 7,]        0
[ 8,]        4
[ 9,]        0
[10,]        0
[11,]        0
[12,]        3
[13,]        0
[14,]        0
[15,]       15
[16,]        0
[17,]        0
[18,]        0
[19,]        0
[20,]        0
[21,]        0
[22,]        0
[23,]        0
[24,]        0
[25,]        0
[26,]        0
[27,]        0
[28,]        0
[29,]        0
[30,]       10
[31,]        0
[32,]        0
[33,]        0
[34,]        0
[35,]        0
[36,]        0
[37,]        0
[38,]        0
[39,]        0
[40,]        9
[41,]        0
[42,]        0
[43,]        0
[44,]        0
[45,]        0
[46,]        0
[47,]        0
[48,]        0
[49,]        4
[50,]        0
[51,]        0
[52,]        0
[53,]        5
[54,]        0
[55,]        0
[56,]        0
[57,]        0

Contents of _tmp.d
[1,]        3

Contents of _tmp.orig
[1,]      3.5



Author: J. Budek, W. Haerdle, 20010716 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006