Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Combination of Factorial Methods and Cluster Analysis | LATIN 1, Exams of Latin language

Material Type: Exam; Class: Elementary Latin; Subject: Latin; University: University of California - Los Angeles; Term: Unknown 2009;

Typology: Exams

Pre 2010

Uploaded on 08/31/2009

koofers-user-kmt
koofers-user-kmt 🇺🇸

10 documents

1 / 21

Toggle sidebar

Related documents


Partial preview of the text

Download Combination of Factorial Methods and Cluster Analysis | LATIN 1 and more Exams Latin language in PDF only on Docsity! Package ‘FactoClass’ July 21, 2009 Version 1.0.1 Date 2009-07-21 Title Combination of Factorial Methods and Cluster Analysis Author Campo Elias Pardo <cepardot@unal.edu.co> and Pedro Cesar del Campo <pcdelcampon@unal.edu.co>, with the contributions from Ivan Diaz <ildiazm@unal.edu.co>,Mauricio Sadinle <msadinleg@unal.edu.co>. Maintainer Campo Elias Pardo <cepardot@unal.edu.co> Depends R (>= 2.7.0), ade4, xtable Description Multivariate exploration of a data table with factorial analysis and cluster methods. License GPL (>= 2) Encoding latin1 Repository CRAN Date/Publication 2009-07-21 16:14:03 R topics documented: Bogota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 BreedsDogs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 centroids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 cluster.carac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 ColorAdjective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 dudi.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Fac.Num . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 FactoClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 FactoClass.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 kmeansW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 list.to.data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 planfac . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 plotFactoClass . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 1 2 BreedsDogs stableclus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Vietnam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 ward.cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Index 21 Bogota Localities by Stratums in Bogota City Description Contingency Table that indicates the number of blocks of Bogota, in localities by stratums (DAPD 1997, p.77). Usage data(Bogota) Format Object whit class data.frame of 19 rows and 7 columns. Source DAPD (1997), Population, stratification and socioeconomic aspects of Bogota References C.E. Pardo y J.E. Ortiz (2004). Analisis multivariado de datos en R. Simposio de Estadistica, Carta- gena Colombia. http://www.docentes.unal.edu.co/cepardot/analmultir.pdf BreedsDogs Breeds of Dog Description Table that describes 27 breeds of dog considering their size, weight, speed, intelligence, affectivity, aggressiveness and function. Usage data(BreedsDogs) ColorAdjective 5 References Lebart, L. and Morineau, A. and Piron, M. (1995) Statisitique exploratoire multidimensionnelle, Paris. Examples data(BreedsDogs) BD.act <- BreedsDogs[-7] # active variables BD.function <- subset(BreedsDogs,select=7) cluster.carac(BD.act,BD.function,"ca",2.0) # nominal variables data(iris) iris.act <- Fac.Num(iris)$numeric clase <- Fac.Num(iris)$factor cluster.carac(iris.act,clase,"co",2.0) # continuous variables # frequency variables data(BreedsDogs) attach(BreedsDogs) weig<-table(FUNc,WEIG) weig<-data.frame(weig[,1],weig[,2],weig[,3]) cluster.carac(weig, row.names(weig), "fr", 2) # frequency variables detach(BreedsDogs) ColorAdjective Associations between colors and adjectives. Description A group of students from Nanterre University (Paris X) were presented with a list of eleve colours: blue, yellow, red, white, pink, brown, purple, grey, black, green and orange. Each person in the group was asked to describe each color with one ore more adjectives. A final list of 89 adjectives were associates with eleven colors. Usage data(ColorAdjective) Format Object of class data.frame with 89 rows and 11 columns. Source Jambu, M. and Lebeaux M.O. Cluster Analysis and Data Analysis. North-Holland. Amsterdam 1983. 6 dudi.tex References Fine, J. (1996), ’Iniciacion a los analisis de datos multidimensionales a partir de ejemplos’, Notas de curso, Montevideo. dudi.tex LaTeX Tables of Coordinates and Aids to Interpretation of Principal Axis Methods Description Coordinates and aids of interpretation are wrote in tabular environment of LaTeX inside a Table Usage dudi.tex(dudi,job="",aidsC=TRUE,aidsR=TRUE,append=TRUE) latex(obj,job="latex",tit="",lab="",append=TRUE,dec=1) Arguments dudi an object of class dudi job a name to identify files and outputs aidsC if it is TRUE the coordinates and aids of interpretation of the columns are printed aidsR if it is TRUE the coordinates and aids of interpretation of the rows are printed append if it is TRUE LaTeX outputs are appended on the file ... obj object to export to LaTeX tit title of the table lab label for crossed references of LaTeX table dec number of decimal digits Details latex function is used to builp up a table. The aids of interpretation are obtained with inertia.dudi of ade4. A file is wrote in the work directory (job.txt) with the following tables: tvalp eigenvalues c1 eigenvectors co column coordinates col.abs column contributions in percentage col.rel quality of the representation of columns in percentage col.cum accumulated quality of the representation of columns in percentage/100 li row coordinates row.abs row contributions in percent row.rel quality of the representation of rows in percentage row.cum accumulated quality of the representation of rows in percentage/100 Fac.Num 7 Author(s) Campo Elías PARDO 〈cepardot@unal.edu.co〉 Examples data(ardeche) coa1 <- dudi.coa(ardeche$tab, scann = FALSE, nf = 4) dudi.tex(coa1,job="Ardeche") Fac.Num Division of qualitative and quantitative variables. Description An object of class data.frame is divided into a list with two tables, one with quantitative variables and the other with qualitative variables. Usage Fac.Num(tabla) Arguments tabla object of class ’data.frame’ Value It returns one list with one or two objects of class data.frame with the following characteristics: factor table with the qualitative variables numeric table with the quantitative variables Author(s) Pedro Cesar Del Campo 〈pcdelcampon@unal.edu.co〉 Examples data(BreedsDogs) Fac.Num(BreedsDogs) data(iris) Fac.Num(iris) 10 FactoClass.tex Examples # Cluster analysis with Correspondence Analysis data(ColorAdjective) FC.col <-FactoClass(ColorAdjective, dudi.coa) 6 10 5 FC.col FC.col$dudi # Cluster analysis with Multiple Correspondence Analysis data(BreedsDogs) BD.act <- BreedsDogs[-7] # active variables BD.ilu <- BreedsDogs[7] # ilustrative variables FC.bd <-FactoClass( BD.act, dudi.acm, k.clust = 4, scanFC = FALSE, dfilu = BD.ilu, nfcl = 10) FC.bd FC.bd$clus.summ FC.bd$indices FactoClass.tex Table of Coordinates, Aids of Interpretation of the Principal Axes and Cluster Analysis in LaTeX format. Description The coordinates, aids of interpretation and results of cluster analysis of an object of class FactoClass are written in tables for edition in LaTeX format and written in a file. Usage FactoClass.tex(FC,job="",append=TRUE, dir = getwd(), p.clust = FALSE ) ## S3 method for class 'FactoClass.tex': print(x, ...) latexDF(obj, job="latex" ,tit="" ,lab="" ,append=TRUE ,dec=1, dir = getwd() , to.print = TRUE ) roundDF(tabla,dec=1) FactoClass.tex 11 Arguments FC object of class FactoClass. job A name to identify the exit. append if is ’TRUE’ the exit in LaTeX format is added to the file. dir name of the directory in which the file is kept. p.clust the value of this parameter is ’TRUE’ or ’FALSE’ to print or not the cluster of each element. tabla object of class ’data frame’. dec number of decimal. x object of class FactoClass.tex obj object of class data.frame. tit title of the table in LaTeX format. lab label of the table in LaTeX format. to.print if it is ’TRUE’ the table is also printed in the console. ... Details This function helps with the construction of tables in LaTeX format. Besides, it allows a easy reading of the generated results by FactoClass. The function latexDF is an entrance to xtable and turns an object of class data.frame a table in LaTeX format. Value object of class FactoClass.tex with the following characteristics: tvalp eigenvalues * 1000. c1 eigenvectors. co coordinates of the columns. col.abs contribution of each column to the inertia of the axis (percentage). col.rel quality of representation of each column (percentage). col.cum quality of representation of each column accumulated in the subspace (percent- age). li coordinates of the rows. row.abs contribution of each rows to the inertia of the axis (percentage). row.rel quality of representation of each rows (percentage). row.cum quality of representation of each rows accumulated in the subspace (percentage). indices table of indices of level generated by the Ward cluster analysis. cor.clus coordinates of the center of gravity of each cluster. clus.summ summary of the cluster. carac.cate cluster characterization by qualitative variables. carac.cont cluster characterization by quantitative variables. cluster vector indicating the cluster of each element. 12 kmeansW Author(s) Pedro Cesar del Campo 〈pcdelcampon@unal.edu.co〉, Campo Elias Pardo 〈cepardot@unal.edu.co〉 Examples data(BreedsDogs) BD.act <- BreedsDogs[-7] # active variables BD.ilu <- BreedsDogs[7] # illustrative variables # MCA FaCl <- FactoClass( BD.act, dudi.acm, scanFC = FALSE, dfilu = BD.ilu, nfcl = 10, k.clust = 4 ) FactoClass.tex(FaCl,job="BreedsDogs1", append=TRUE) FactoClass.tex(FaCl,job="BreedsDogs", append=TRUE , p.clust = TRUE) kmeansW K-means with Weights of the Elements Description It is a modification of kmeans Hartigan-Wong algorithm to consider the weight of the elements to classify. Usage kmeansW(x, centers, weight = rep(1/nrow(x),nrow(x)), iter.max = 10, nstart = 1) Arguments x A numeric vector, matrix or data frame. centers Either the number of clusters or a set of initial (distinct) cluster centres. If a number, a random set of (distinct) rows in x is chosen as the initial centres. weight weight of the elements of x. by default the same. iter.max The maximum number of iterations allowed. nstart If centers is a number, how many random sets should be chosen? Details With the ’Hartigan-Wong’ algorithm, this function performs the K-means clustering diminishing inertia intra classes. planfac 15 col.col color for column points and column labels. Default "blue" cex global scale for the labels. Default cex=0.8 cex.row scale for row points and row labels. Default cex.row=0.8 cex.col scale for column points and column labels. Default cex.col=0.8 all.point If if is TRUE, all points are outlined. Default all.point=TRUE Trow if it is TRUE the row points are outlined. Default TRUE Tcol if it is TRUE the column points are outlined. Default TRUE cframe scale for graphic limits ucal quality representation threshold (percentage) in the plane . Default ucal=0 cex.global scale for the label sizes infaxes place to put the axes information: "out","in","no". Default infaxes="out". If infaxes="out" the graphic is similar to FactoMineR graphics, otherwise the style is similar to the one in ade4, without axes information when infaxes="no" ... cgrid scale Details Plot the selected factorial plane. sutil.grid is used by planfac Value It graphs the factorial plane x,y using co,li of a "dudi" "coa" object. If ucal > 0, the function inertia.dudi is used to calculate the quality of representation on the plane Author(s) Campo Elias Pardo 〈cepardot@unal.edu.co〉 http://www.docentes.unal.edu.co/cepardot Examples data(ardeche) ca <- dudi.coa(ardeche$tab,scannf=FALSE,nf=4) # FactoMineR style planfac(ca,ucal=40,all.point=FALSE,titre="SCA of Ardeche, First Factorial Plane") dev.new() # ade4 style planfac(ca,x=3,y=4,ucal=20,all.point=FALSE,infaxes="in",titre="SCA of Ardeche, Plane 3-4") 16 plotFactoClass plotFactoClass Factorial Planes Showing the Classes Description For objects of class FactoClass it graphs a factorial plane showing the center of gravity of the cluster, and identifying with colors the cluster to which each element belongs. Usage plotFactoClass(FC , x=1, y=2,xlim=NULL,ylim=NULL, rotx=FALSE, roty=FALSE, roweti=row.names(dudi$li), coleti=row.names(dudi$co),titre=NULL, axislabel=TRUE, col.row=1:FC$k, col.col="blue", cex=0.8, cex.row=0.8, cex.col=0.8, all.point=TRUE, Trow=TRUE, Tcol=TRUE, cframe=1.2, ucal=0, cex.global=1, infaxes="out",nclus=paste("cl", 1:FC$k, sep=""),cex.clu=cex.row,cstar=1 ) Arguments FC object of class FactoClass. x number indentifying the factor to be used as horizontal axis. Default x=1 y number indentifying the factor to be used as vertical axis. Default y=2 xlim the x limits (x1, x2) of the plot ylim the y limits of the plot rotx TRUE if you want change the sign of the horizontal coordinates (default FALSE). roty TRUE if you want change the sign of the vertical coordinates (default FALSE). roweti selected row points for the graphic. Default all points. coleti selected column points for the graphic. Default all points. titre graphics title. axislabel if it is TRUE the axis information is written. col.row color for row points and row labels. Default 1:FC$k. col.col color for row points and row labels. Default "grey55". cex global scale for the labels. Default cex=0.8. cex.row scale for row points and row labels. Default cex.row=0.8. cex.col scale for column points and column labels. Default cex.col=0.8. cex.clu scale for cluster points and cluster labels. (default cex.row). all.point if if is TRUE, all points are outlined. Default all.point=TRUE. Trow if it is TRUE the row points are outlined. Default TRUE. Tcol if it is TRUE the column points are outlined. Default TRUE. stableclus 17 nclus labels for the clusters (default cl1, cl2, ... cframe scale for graphics limits ucal quality Representation Threshold in the plane. Default ucal=0 cex.global scale for the label sizes infaxes place to put the axes information: "out","in","no". Default infaxes="out". If infaxes="out" the graphic is similar to FactoMineR graphics, otherwise the style is similar to the one in ade4, without axes information when infaxes="no" cstar length of the rays between the centroids of the classes and their points Details It draws the factorial plane with the clusters. Only for objects FactoClass see FactoClass. The factorial plane is drawn with planfac and the classes are projected with s.class of ade4 Value It draws the factorial plane x, y using co,li of the object of class FactoClass. If ucal > 0, the function inertia.dudi is used to calculate the quality of representation in the plane. Author(s) Campo Elías Pardo 〈cepardot@unal.edu.co〉 Pedro Cesar del Campo 〈pcdelcampon@unal.edu.co〉, Examples data(Bogota) Bog.act <- Bogota[-1] Bog.ilu <- Bogota[ 1] FC.Bogota<-FactoClass(Bog.act, dudi.coa,Bog.ilu,nf=2,nfcl=5,k.clust=5,scanFC=FALSE) plotFactoClass(FC.Bogota,titre="Primer plano factorial del ACS de la TC de manzanas de Bogota", col.row=c("maroon2","orchid4","darkgoldenrod2","dark red","aquamarine4")) stableclus Stable Clusters from K-means Description It performs stable clusters from several partitions from K-means changing the initial points. It uses the coordinates of an previous principal axes method Usage stableclus(dudi,part=2,k.clust=2,ff.clus=NULL,bplot=TRUE,kmns=FALSE) 20 ward.cluster Value It returns an object of class hclust and a table of level indices (depending of h.clust). If plots = TRUE it draws the indices of level and the dendrogram. Author(s) Pedro Cesar del Campo 〈pcdelcampon@unal.edu.co〉, Campo Elias Pardo 〈cepardot@unal.edu.co〉 http://www.docentes.unal.edu.co/cepardot References Lebart, L. and Morineau, A. and Piron, M. (1995) Statisitique exploratoire multidimensionnelle, Paris. Examples data(ardeche) ca <- dudi.coa(ardeche$tab,scannf=FALSE,nf=4) ward.cluster( dista= dist(ca$li), peso=ca$lw ) dev.new() HW <- ward.cluster( dista= dist(ca$li), peso=ca$lw ,h.clust = 1) plot(HW) rect.hclust(HW, k=4, border="red") Index ∗Topic cluster FactoClass, 7 plotFactoClass, 16 ∗Topic datasets Bogota, 1 BreedsDogs, 2 ColorAdjective, 5 Vietnam, 18 ∗Topic hplot cluster.carac, 3 planfac, 14 plotFactoClass, 16 ward.cluster, 19 ∗Topic multivariate centroids, 3 cluster.carac, 3 dudi.tex, 5 Fac.Num, 7 FactoClass, 7 FactoClass.tex, 10 kmeansW, 12 list.to.data, 13 planfac, 14 plotFactoClass, 16 stableclus, 17 ward.cluster, 19 analisis.clus (FactoClass), 7 Bogota, 1 BreedsDogs, 2 centroids, 3 cluster.carac, 3 ColorAdjective, 5 dudi.tex, 5 Fac.Num, 7 FactoClass, 7, 10, 11, 16, 17 FactoClass.tex, 9, 10 kmeansW, 12 latex (dudi.tex), 5 latexDF (FactoClass.tex), 10 list.to.data, 13 planfac, 14 plotFactoClass, 9, 16 print.FactoClass (FactoClass), 7 print.FactoClass.tex (FactoClass.tex), 10 roundDF (FactoClass.tex), 10 stableclus, 17 sutil.grid (planfac), 14 Vietnam, 18 ward.cluster, 19 21
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved