Home » date » 2008 » Nov » 11 »

Various EDA topics: Q2 - Hierarchical Clustering

*The author of this computation has been verified*
R Software Module: rwasp_hierarchicalclustering.wasp (opens new window with default values)
Title produced by software: Hierarchical Clustering
Date of computation: Tue, 11 Nov 2008 07:17:41 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m.htm/, Retrieved Tue, 11 Nov 2008 14:20:10 +0000
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m.htm/},
    year = {2008},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2008},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
 
Feedback Forum:

Post a new message
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
19 10 500857 3431 14 12 506971 3874 11 12 569323 2617 13 13 579714 3580 21 17 577992 5267 10 12 565464 3832 23 15 547344 3441 23 12 554788 3228 27 14 562325 3397 30 19 560854 3971 28 16 555332 4625 25 17 543599 4486 21 16 536662 4131 29 19 542722 4686 20 17 593530 3174 24 17 610763 4282 23 20 612613 4209 16 18 611324 4159 17 16 594167 3936 19 19 595454 3153 19 18 590865 3620 21 23 589379 4227 25 20 584428 4441 18 20 573100 4808 8 15 567456 4850 7 17 569028 5040 5 16 620735 3546 10 15 628884 4669 0 10 628232 5410 13 13 612117 5134 13 10 595404 4864 17 19 597141 3999 20 21 593408 4459 19 17 590072 4622 16 16 579799 5360 16 17 574205 4658 16 14 572775 5173 20 18 572942 4845 23 17 619567 3325 18 14 625809 4720 20 15 619916 4895 26 16 587625 5071 25 11 565742 4895 16 15 557274 3805 22 13 560576 4187 23 17 548854 4435 20 16 531673 4475 27 9 525919 4774 25 17 511038 5161 26 15 498662 4529 23 12 555362 3284 13 12 564591 4303 13 12 541657 4610 14 12 527070 4691 1 4 509846 4200 7 7 514258 3471 5 4 516922 3132 9 3 507561 4226 11 3 492622 3723 6 0 490243 3576 0 5 469357 3397
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Summary of Dendrogram
LabelHeight
1162.299106590271
2352.193128837006
3517.149487473929
4574.382276885351
5576.725237873287
6687.102612424083
7797.6929233734
8899.527097979822
9921.76135740223
10987.071425986995
11991.957156332873
121049.66185031180
131154.06585600649
141188.86079925280
151215.39484450863
161264.83414195639
171531.38172902774
181583.44213661251
191656.12497571994
201701.45554008891
211709.39051044378
221711.76458661815
231728.07940745406
241782.03338913725
251786.05189254132
261807.7997676734
271981.23251604139
282186.98602122778
292214.72382289698
302219.36850279006
312383.54441955672
322454.32332833309
332685.48505860673
342751.39442265342
353039.89914608524
363258.48523090101
373400.86419448281
384553.08170992789
395000.84572847433
405413.26029045633
417093.83625638218
427137.27342430782
4311100.6533915921
4412292.7485138658
4513975.6100894354
4614291.8457596770
4715579.2933443598
4817127.17108901
4919374.0716627875
5023471.3359332478
5138166.4365890079
5239431.507023291
5345548.2852153164
5447364.3304340991
5571004.9194482464
5682515.4041534364
57221440.723909685
58241733.336558712
59650126.939935581
601039084.96545092


Summary of Cut Dendrogram
LabelHeight
125020.4048728163
236725.7257123583
345845.7230723615
4114442.133936008
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m/1g2b41226413055.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m/1g2b41226413055.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m/2ulyf1226413055.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Nov/11/t12264132108xeurmo8esbsr9m/2ulyf1226413055.ps (open in new window)


 
Parameters (Session):
par1 = ward ; par2 = 5 ; par3 = FALSE ; par4 = FALSE ;
 
Parameters (R input):
par1 = ward ; par2 = 5 ; par3 = FALSE ; par4 = FALSE ;
 
R code (references can be found in the software module):
par3 <- as.logical(par3)
par4 <- as.logical(par4)
if (par3 == 'TRUE'){
dum = xlab
xlab = ylab
ylab = dum
}
x <- t(y)
hc <- hclust(dist(x),method=par1)
d <- as.dendrogram(hc)
str(d)
mysub <- paste('Method: ',par1)
bitmap(file='test1.png')
if (par4 == 'TRUE'){
plot(d,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8),type='t',center=T, sub=mysub)
} else {
plot(d,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8), sub=mysub)
}
dev.off()
if (par2 != 'ALL'){
if (par3 == 'TRUE'){
ylab = 'cluster'
} else {
xlab = 'cluster'
}
par2 <- as.numeric(par2)
memb <- cutree(hc, k = par2)
cent <- NULL
for(k in 1:par2){
cent <- rbind(cent, colMeans(x[memb == k, , drop = FALSE]))
}
hc1 <- hclust(dist(cent),method=par1, members = table(memb))
de <- as.dendrogram(hc1)
bitmap(file='test2.png')
if (par4 == 'TRUE'){
plot(de,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8),type='t',center=T, sub=mysub)
} else {
plot(de,main=main,ylab=ylab,xlab=xlab,horiz=par3, nodePar=list(pch = c(1,NA), cex=0.8, lab.cex = 0.8), sub=mysub)
}
dev.off()
str(de)
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Summary of Dendrogram',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Label',header=TRUE)
a<-table.element(a,'Height',header=TRUE)
a<-table.row.end(a)
num <- length(x[,1])-1
for (i in 1:num)
{
a<-table.row.start(a)
a<-table.element(a,hc$labels[i])
a<-table.element(a,hc$height[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')
if (par2 != 'ALL'){
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Summary of Cut Dendrogram',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Label',header=TRUE)
a<-table.element(a,'Height',header=TRUE)
a<-table.row.end(a)
num <- par2-1
for (i in 1:num)
{
a<-table.row.start(a)
a<-table.element(a,i)
a<-table.element(a,hc1$height[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by