R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list('A.rat' + ,0 + ,0.81954393554187 + ,6.3 + ,0.30102999566398 + ,0.65321251377534 + ,1.6232492903979 + ,3 + ,1 + ,3 + ,'Elephant' + ,3.40602894496362 + ,3.66304097489397 + ,2.1 + ,0.25527250510331 + ,1.83884909073726 + ,2.79518458968242 + ,3 + ,5 + ,4 + ,'Baboon' + ,1.02325245963371 + ,2.25406445291434 + ,9.1 + ,-0.15490195998574 + ,1.43136376415899 + ,2.25527250510331 + ,4 + ,4 + ,4 + ,'B.bat' + ,-1.69897000433602 + ,-0.52287874528034 + ,15.8 + ,0.5910646070265 + ,1.27875360095283 + ,1.54406804435028 + ,1 + ,1 + ,1 + ,'Tapir' + ,2.20411998265592 + ,2.22788670461367 + ,5.2 + ,0 + ,1.48287358360875 + ,2.59328606702046 + ,4 + ,5 + ,4 + ,'Cat' + ,0.51851393987789 + ,1.40823996531185 + ,10.9 + ,0.55630250076729 + ,1.44715803134222 + ,1.79934054945358 + ,1 + ,2 + ,1 + ,'Chimp' + ,1.71733758272386 + ,2.64345267648619 + ,8.3 + ,0.14612803567824 + ,1.69897000433602 + ,2.36172783601759 + ,1 + ,1 + ,1 + ,'Chinchilla' + ,-0.36653154442041 + ,0.80617997398389 + ,11 + ,0.17609125905568 + ,0.84509804001426 + ,2.04921802267018 + ,5 + ,4 + ,4 + ,'Cow' + ,2.66745295288995 + ,2.62634036737504 + ,3.2 + ,-0.15490195998574 + ,1.47712125471966 + ,2.44870631990508 + ,5 + ,5 + ,5 + ,'Mole' + ,-1.09691001300806 + ,0.079181246047625 + ,6.3 + ,0.32221929473392 + ,0.54406804435028 + ,1.6232492903979 + ,1 + ,1 + ,1 + ,'Hedgehog' + ,-0.10237290870956 + ,0.54406804435028 + ,6.6 + ,0.61278385671974 + ,0.77815125038364 + ,1.6232492903979 + ,2 + ,2 + ,2 + ,'Galago' + ,-0.69897000433602 + ,0.69897000433602 + ,9.5 + ,0.079181246047625 + ,1.01703333929878 + ,2.07918124604762 + ,2 + ,2 + ,2 + ,'Goat' + ,1.44185217577329 + ,2.06069784035361 + ,3.3 + ,-0.30102999566398 + ,1.30102999566398 + ,2.17026171539496 + ,5 + ,5 + ,5 + ,'Hamster' + ,-0.92081875395238 + ,0 + ,11 + ,0.53147891704226 + ,0.5910646070265 + ,1.20411998265592 + ,3 + ,1 + ,2 + ,'Seal' + ,1.92941892571429 + ,2.51188336097887 + ,4.7 + ,0.17609125905568 + ,1.61278385671974 + ,2.49136169383427 + ,1 + ,3 + ,1 + ,'Squirrel' + ,-1 + ,0.60205999132796 + ,10.4 + ,0.53147891704226 + ,0.95424250943932 + ,1.44715803134222 + ,5 + ,1 + ,3 + ,'Guinea_pig' + ,0.01703333929878 + ,0.74036268949424 + ,7.4 + ,-0.096910013008056 + ,0.88081359228079 + ,1.83250891270624 + ,5 + ,3 + ,4 + ,'Horse' + ,2.71683772329952 + ,2.81624129999178 + ,2.1 + ,-0.096910013008056 + ,1.66275783168157 + ,2.52633927738984 + ,5 + ,5 + ,5 + ,'L.bat' + ,-2 + ,-0.60205999132796 + ,17.9 + ,0.30102999566398 + ,1.38021124171161 + ,1.69897000433602 + ,1 + ,1 + ,1 + ,'Man' + ,1.79239168949825 + ,3.12057393120585 + ,6.1 + ,0.27875360095283 + ,2 + ,2.42651126136458 + ,1 + ,1 + ,1 + ,'Mouse' + ,-1.69897000433602 + ,-0.39794000867204 + ,11.9 + ,0.11394335230684 + ,0.50514997831991 + ,1.27875360095283 + ,4 + ,1 + ,3 + ,'N.opossum' + ,0.23044892137827 + ,0.79934054945358 + ,13.8 + ,0.7481880270062 + ,0.69897000433602 + ,1.07918124604762 + ,2 + ,1 + ,1 + ,'Armadillo' + ,0.54406804435028 + ,1.03342375548695 + ,14.3 + ,0.49136169383427 + ,0.81291335664286 + ,2.07918124604762 + ,2 + ,1 + ,1 + ,'O.monkey' + ,-0.31875876262441 + ,1.19033169817029 + ,15.2 + ,0.25527250510331 + ,1.07918124604762 + ,2.14612803567824 + ,2 + ,2 + ,2 + ,'Patas' + ,1 + ,2.06069784035361 + ,10 + ,-0.045757490560675 + ,1.30535136944662 + ,2.23044892137827 + ,4 + ,4 + ,4 + ,'Phalanger' + ,0.20951501454263 + ,1.05690485133647 + ,11.9 + ,0.25527250510331 + ,1.11394335230684 + ,1.23044892137827 + ,2 + ,1 + ,2 + ,'Pig' + ,2.28330122870355 + ,2.25527250510331 + ,6.5 + ,0.27875360095283 + ,1.43136376415899 + ,2.06069784035361 + ,4 + ,4 + ,4 + ,'Rabbit' + ,0.39794000867204 + ,1.08278537031645 + ,7.5 + ,-0.045757490560675 + ,1.25527250510331 + ,1.49136169383427 + ,5 + ,5 + ,5 + ,'Rat' + ,-0.55284196865778 + ,0.27875360095283 + ,10.6 + ,0.41497334797082 + ,0.67209785793572 + ,1.32221929473392 + ,3 + ,1 + ,3 + ,'Fox' + ,0.62736585659273 + ,1.70243053644553 + ,7.4 + ,0.38021124171161 + ,0.99122607569249 + ,1.7160033436348 + ,1 + ,1 + ,1 + ,'Rhesus' + ,0.83250891270624 + ,2.25285303097989 + ,8.4 + ,0.079181246047625 + ,1.46239799789896 + ,2.2148438480477 + ,2 + ,3 + ,2 + ,'G.hyrax' + ,-0.1249387366083 + ,1.0899051114394 + ,5.7 + ,-0.045757490560675 + ,0.84509804001426 + ,2.35218251811136 + ,2 + ,2 + ,2 + ,'R.hyrax' + ,0.55630250076729 + ,1.32221929473392 + ,4.9 + ,-0.30102999566398 + ,0.77815125038364 + ,2.35218251811136 + ,3 + ,2 + ,3 + ,'Sheep' + ,1.74429298312268 + ,2.24303804868629 + ,3.2 + ,-0.22184874961636 + ,1.30102999566398 + ,2.17897694729317 + ,5 + ,5 + ,5 + ,'Tenrec' + ,-0.045757490560675 + ,0.41497334797082 + ,11 + ,0.36172783601759 + ,0.65321251377534 + ,1.77815125038364 + ,2 + ,1 + ,2 + ,'T.hyrax' + ,0.30102999566398 + ,1.0899051114394 + ,4.9 + ,-0.30102999566398 + ,0.8750612633917 + ,2.30102999566398 + ,3 + ,1 + ,3 + ,'Tree_shrew' + ,-1 + ,0.39794000867204 + ,13.2 + ,0.41497334797082 + ,0.36172783601759 + ,1.66275783168157 + ,3 + ,2 + ,2 + ,'Vervet' + ,0.6222140229663 + ,1.76342799356294 + ,9.7 + ,-0.22184874961636 + ,1.38021124171161 + ,2.32221929473392 + ,4 + ,3 + ,4 + ,'L.opossum' + ,0.54406804435028 + ,0.5910646070265 + ,12.8 + ,0.81954393554187 + ,0.47712125471966 + ,1.14612803567824 + ,2 + ,1 + ,1) + ,dim=c(10 + ,39) + ,dimnames=list(c('label' + ,'logWb' + ,'logWbr' + ,'SWS' + ,'logPS' + ,'logL' + ,'logtg' + ,'P' + ,'S' + ,'D') + ,1:39)) > y <- array(NA,dim=c(10,39),dimnames=list(c('label','logWb','logWbr','SWS','logPS','logL','logtg','P','S','D'),1:39)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } There were 39 warnings (use warnings() to see them) > par1 = '2' > par1 <- '2' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Patrick Wessa > #To cite this work: Wessa P., 2010, Factor Analysis (v1.0.0) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_factor_analysis.wasp/ > #Source of accompanying publication: > #Technical description: > library(psych) > par1 <- as.numeric(par1) > x <- t(x) > nrows <- length(x[,1]) > ncols <- length(x[1,]) > y <- array(as.double(x[1:nrows,2:ncols]),dim=c(nrows,ncols-1)) > colnames(y) <- colnames(x)[2:ncols] > rownames(y) <- x[,1] > y logWb logWbr SWS logPS logL logtg P S D A.rat 0.00000000 0.81954394 6.3 0.30103000 0.6532125 1.623249 3 1 3 Elephant 3.40602894 3.66304097 2.1 0.25527251 1.8388491 2.795185 3 5 4 Baboon 1.02325246 2.25406445 9.1 -0.15490196 1.4313638 2.255273 4 4 4 B.bat -1.69897000 -0.52287875 15.8 0.59106461 1.2787536 1.544068 1 1 1 Tapir 2.20411998 2.22788670 5.2 0.00000000 1.4828736 2.593286 4 5 4 Cat 0.51851394 1.40823997 10.9 0.55630250 1.4471580 1.799341 1 2 1 Chimp 1.71733758 2.64345268 8.3 0.14612804 1.6989700 2.361728 1 1 1 Chinchilla -0.36653154 0.80617997 11.0 0.17609126 0.8450980 2.049218 5 4 4 Cow 2.66745295 2.62634037 3.2 -0.15490196 1.4771213 2.448706 5 5 5 Mole -1.09691001 0.07918125 6.3 0.32221929 0.5440680 1.623249 1 1 1 Hedgehog -0.10237291 0.54406804 6.6 0.61278386 0.7781513 1.623249 2 2 2 Galago -0.69897000 0.69897000 9.5 0.07918125 1.0170333 2.079181 2 2 2 Goat 1.44185218 2.06069784 3.3 -0.30103000 1.3010300 2.170262 5 5 5 Hamster -0.92081875 0.00000000 11.0 0.53147892 0.5910646 1.204120 3 1 2 Seal 1.92941893 2.51188336 4.7 0.17609126 1.6127839 2.491362 1 3 1 Squirrel -1.00000000 0.60205999 10.4 0.53147892 0.9542425 1.447158 5 1 3 Guinea_pig 0.01703334 0.74036269 7.4 -0.09691001 0.8808136 1.832509 5 3 4 Horse 2.71683772 2.81624130 2.1 -0.09691001 1.6627578 2.526339 5 5 5 L.bat -2.00000000 -0.60205999 17.9 0.30103000 1.3802112 1.698970 1 1 1 Man 1.79239169 3.12057393 6.1 0.27875360 2.0000000 2.426511 1 1 1 Mouse -1.69897000 -0.39794001 11.9 0.11394335 0.5051500 1.278754 4 1 3 N.opossum 0.23044892 0.79934055 13.8 0.74818803 0.6989700 1.079181 2 1 1 Armadillo 0.54406804 1.03342376 14.3 0.49136169 0.8129134 2.079181 2 1 1 O.monkey -0.31875876 1.19033170 15.2 0.25527251 1.0791812 2.146128 2 2 2 Patas 1.00000000 2.06069784 10.0 -0.04575749 1.3053514 2.230449 4 4 4 Phalanger 0.20951501 1.05690485 11.9 0.25527251 1.1139434 1.230449 2 1 2 Pig 2.28330123 2.25527251 6.5 0.27875360 1.4313638 2.060698 4 4 4 Rabbit 0.39794001 1.08278537 7.5 -0.04575749 1.2552725 1.491362 5 5 5 Rat -0.55284197 0.27875360 10.6 0.41497335 0.6720979 1.322219 3 1 3 Fox 0.62736586 1.70243054 7.4 0.38021124 0.9912261 1.716003 1 1 1 Rhesus 0.83250891 2.25285303 8.4 0.07918125 1.4623980 2.214844 2 3 2 G.hyrax -0.12493874 1.08990511 5.7 -0.04575749 0.8450980 2.352183 2 2 2 R.hyrax 0.55630250 1.32221929 4.9 -0.30103000 0.7781513 2.352183 3 2 3 Sheep 1.74429298 2.24303805 3.2 -0.22184875 1.3010300 2.178977 5 5 5 Tenrec -0.04575749 0.41497335 11.0 0.36172784 0.6532125 1.778151 2 1 2 T.hyrax 0.30103000 1.08990511 4.9 -0.30103000 0.8750613 2.301030 3 1 3 Tree_shrew -1.00000000 0.39794001 13.2 0.41497335 0.3617278 1.662758 3 2 2 Vervet 0.62221402 1.76342799 9.7 -0.22184875 1.3802112 2.322219 4 3 4 L.opossum 0.54406804 0.59106461 12.8 0.81954394 0.4771213 1.146128 2 1 1 > fit <- principal(y, nfactors=par1, rotate='varimax') > fit Principal Components Analysis Call: principal(r = y, nfactors = par1, rotate = "varimax") item RC1 RC2 h2 u2 logWb 1 0.88 0.84 0.16 logWbr 2 0.94 0.92 0.08 SWS 3 -0.63 -0.48 0.63 0.37 logPS 4 -0.40 -0.69 0.63 0.37 logL 5 0.86 0.74 0.26 logtg 6 0.85 0.77 0.23 P 7 0.96 0.92 0.08 S 8 0.52 0.74 0.82 0.18 D 9 0.96 0.97 0.03 RC1 RC2 SS loadings 3.98 3.25 Proportion Var 0.44 0.36 Cumulative Var 0.44 0.80 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 36 and the objective function was 11.19 The degrees of freedom for the model are 19 and the objective function was 2.14 The number of observations was 39 with Chi Square = 70.14 with prob < 8.7e-08 Fit based upon off diagonal values = 0.99> fs <- factor.scores(y,fit) > fs RC1 RC2 A.rat -0.67333412 0.14430791 Elephant 2.27195211 0.13577555 Baboon 0.54722538 0.81740962 B.bat -0.87752649 -1.31250154 Tapir 1.11503374 0.82177474 Cat 0.47115336 -1.38509192 Chimp 1.54628278 -1.47853951 Chinchilla -0.78649138 1.21491197 Cow 1.09697959 1.45498884 Mole -0.74835419 -0.76792559 Hedgehog -0.47518895 -0.47814383 Galago -0.22624044 -0.29629280 Goat 0.45910187 1.73678501 Hamster -1.39921415 -0.18592978 Seal 1.72646978 -1.14806693 Squirrel -1.19537030 0.41799514 Guinea_pig -0.72353315 1.34686071 Horse 1.35216258 1.34881334 L.bat -0.86369879 -1.19176621 Man 1.98372192 -1.67485751 Mouse -1.88251200 0.68079595 N.opossum -0.86089718 -1.03896124 Armadillo -0.15725699 -1.05886992 O.monkey -0.13487541 -0.61472110 Patas 0.36353005 0.78668537 Phalanger -0.44108361 -0.59411190 Pig 0.75189386 0.54846034 Rabbit -0.51369283 1.68980627 Rat -1.20005054 0.07225323 Fox 0.31089681 -1.18822762 Rhesus 0.89710111 -0.49318534 G.hyrax 0.13352292 -0.16060969 R.hyrax 0.11244367 0.52563110 Sheep 0.56877200 1.65761291 Tenrec -0.65810209 -0.49430045 T.hyrax 0.01504164 0.39648269 Tree_shrew -1.26532417 -0.02454352 Vervet 0.30023560 0.78454344 L.opossum -0.94077399 -0.99524773 > postscript(file="/var/www/html/rcomp/tmp/1eny01269171591.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > fa.diagram(fit) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/20uq91269171591.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(fs,pch=20) > text(fs,labels=rownames(y),pos=3) > dev.off() null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Rotated Factor Loadings',par1+1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variables',1,TRUE) > for (i in 1:par1) { + a<-table.element(a,paste('Factor',i,sep=''),1,TRUE) + } > a<-table.row.end(a) > for (j in 1:length(fit$loadings[,1])) { + a<-table.row.start(a) + a<-table.element(a,rownames(fit$loadings)[j],header=TRUE) + for (i in 1:par1) { + a<-table.element(a,round(fit$loadings[j,i],3)) + } + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/38f6o1269171591.tab") > > try(system("convert tmp/1eny01269171591.ps tmp/1eny01269171591.png",intern=TRUE)) character(0) > try(system("convert tmp/20uq91269171591.ps tmp/20uq91269171591.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.617 0.326 0.753