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: cartsplit

Quantlet: cartregr
Description: applies the the tree to a user given data set.

Reference(s):

Link:
Usage: y = cartregr (tree, x {, stri})
Input:
tree list, result of cartsplit
x nxp, X-variables
stri text, which values should be returned
Output:
y nx1, result

Note:

Example:

; load library xclust and plot

library("xclust")             

library("plot")

; set random seed               

randomize(1)

; read swiss banknote data

dendat=read("bank2")

; select the last three variables

dendat=dendat[,4:6]

; choose 9 bins in each dimension

binlkm=9

; compute density estimate

regdat=dentoreg(dendat,binlkm)

; compute CART and tree

type=#(1,1,1)

opt=cartsplitopt("minsize",80,"mindev",0,"mincut",1)

tr=cartsplit(regdat.ind,regdat.dep,type,opt)

; compute cuts and show with colored datapoints

g=cartregr(tr, dendat, "node")

{gcat,gind}=groupcol(g, rows(g))

setmaskp(dendat, gind)

plotcart2(dendat, tr)

Result:

shows the cuts and the datapoints of the original data

colored after the node they fall in. Choose X2 and X3 as

projection plane.


Library: xclust
See also: cartsplit

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

Author: 2000-04-16, Sigbert Klinke
(C) MD*TECH Method and Data Technologies, 21.9.2000