R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) 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(1,0,0,0,2.23,0,36,30,34,47,27,6,5,16,2,0,0,NA,2.62,0,20,79,1,44,7,29,15,5,3,0,0,NA,2.56,0,36,36,27,32,27,23,14,5,4,0,1,1,1,1,34,58,8,14,10,2,26,48,5,0,0,0,1,1,17,50,33,4,38,0,50,8,6,0,1,1,5,1,26,39,35,17,26,0,48,9,7,0,1,NA,4.28,1,28,44,28,0,0,0,100,0,8,1,2,1,1,0,43,24,33,11,19,0,58,11,9,1,2,0,3.16,0,0,100,0,34,29,1,29,8,10,1,1,0,NA,0,45,30,24,27,30,9,6,27,11,1,2,NA,1.8,0,17,81,3,16,31,10,38,6,12,1,2,0,2.12,0,86,14,0,14,86,0,0,0,13,1,2,NA,2.48,0,32,55,13,35,25,3,23,15,14,1,2,NA,2.37,0,22,61,17,44,20,10,26,0),dim=c(14,14),dimnames=list(c('Indicator_System_Number','Sample_Scale','Type_Organizer','Absolute_Relative','Variables2Indicator','Level_Synthesis','%P','%S','%R','%C','%N','%H','%E','%G'),1:14)) > y <- array(NA,dim=c(14,14),dimnames=list(c('Indicator_System_Number','Sample_Scale','Type_Organizer','Absolute_Relative','Variables2Indicator','Level_Synthesis','%P','%S','%R','%C','%N','%H','%E','%G'),1:14)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par1 = '2' > par1 <- '2' > #'GNU S' R Code compiled by R2WASP v. 1.2.327 () > #Author: root > #To cite this work: Wessa P., 2014, Factor Analysis (v1.0.3) 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: > # > 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 Sample_Scale Type_Organizer Absolute_Relative Variables2Indicator 1 0 0 0 2.23 2 0 0 NA 2.62 3 0 0 NA 2.56 4 0 1 1 1.00 5 0 0 0 1.00 6 0 1 1 5.00 7 0 1 NA 4.28 8 1 2 1 1.00 9 1 2 0 3.16 10 1 1 0 NA 11 1 2 NA 1.80 12 1 2 0 2.12 13 1 2 NA 2.48 14 1 2 NA 2.37 Level_Synthesis %P %S %R %C %N %H %E %G 1 0 36 30 34 47 27 6 5 16 2 0 20 79 1 44 7 29 15 5 3 0 36 36 27 32 27 23 14 5 4 1 34 58 8 14 10 2 26 48 5 1 17 50 33 4 38 0 50 8 6 1 26 39 35 17 26 0 48 9 7 1 28 44 28 0 0 0 100 0 8 0 43 24 33 11 19 0 58 11 9 0 0 100 0 34 29 1 29 8 10 0 45 30 24 27 30 9 6 27 11 0 17 81 3 16 31 10 38 6 12 0 86 14 0 14 86 0 0 0 13 0 32 55 13 35 25 3 23 15 14 0 22 61 17 44 20 10 26 0 > fit <- principal(y, nfactors=par1, rotate='varimax') Warning message: In cor.smooth(r) : Matrix was not positive definite, smoothing was done > fit Principal Components Analysis Call: principal(r = y, nfactors = par1, rotate = "varimax") Standardized loadings (pattern matrix) based upon correlation matrix PC1 PC2 h2 u2 com Sample_Scale -0.42 0.63 0.576 0.42 1.7 Type_Organizer -0.07 0.58 0.344 0.66 1.0 Absolute_Relative 0.71 -0.12 0.520 0.48 1.1 Variables2Indicator 0.18 -0.30 0.122 0.88 1.6 Level_Synthesis 0.84 -0.26 0.768 0.23 1.2 %P 0.03 0.78 0.612 0.39 1.0 %S -0.36 -0.56 0.442 0.56 1.7 %R 0.58 -0.12 0.356 0.64 1.1 %C -0.79 -0.30 0.713 0.29 1.3 %N -0.27 0.80 0.708 0.29 1.2 %H -0.63 -0.51 0.662 0.34 1.9 %E 0.78 -0.24 0.666 0.33 1.2 %G 0.18 -0.04 0.035 0.97 1.1 PC1 PC2 SS loadings 3.62 2.90 Proportion Var 0.28 0.22 Cumulative Var 0.28 0.50 Proportion Explained 0.55 0.45 Cumulative Proportion 0.55 1.00 Mean item complexity = 1.3 Test of the hypothesis that 2 components are sufficient. The root mean square of the residuals (RMSR) is 0.19 with the empirical chi square 76.32 with prob < 0.02 Fit based upon off diagonal values = 0.7> fs <- factor.scores(y,fit) Warning message: In cor.smooth(r) : Matrix was not positive definite, smoothing was done > fs $scores PC1 PC2 1 -0.3878616 -0.3561150 2 NA NA 3 NA NA 4 0.3319352 0.2837323 5 0.4076341 0.3532539 6 0.5495057 0.4722043 7 NA NA 8 0.9474821 0.8784765 9 -0.6870722 -0.6239914 10 NA NA 11 NA NA 12 1.0587534 1.0410833 13 NA NA 14 NA NA $weights PC1 PC2 Sample_Scale 0.04898074 0.05106641 Type_Organizer 0.09765379 0.09448202 Absolute_Relative 0.09973144 0.08777268 Variables2Indicator -0.02715057 -0.02786763 Level_Synthesis 0.09297672 0.08006723 %P 0.15267764 0.14589447 %S -0.16653978 -0.15570311 %R 0.07569861 0.06632753 %C -0.19111862 -0.17466318 %N 0.10577587 0.10403070 %H -0.20408729 -0.18870835 %E 0.08738369 0.07546223 %G 0.02394508 0.02106500 $r.scores PC1 PC2 PC1 1.0000000 0.9991316 PC2 0.9991316 1.0000000 $R2 PC1 PC2 0.5494787 0.4707929 > postscript(file="/var/wessaorg/rcomp/tmp/1wbm51483537651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(fs$scores,pch=20) > text(fs$scores,labels=rownames(y),pos=3) > dev.off() null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/2214v1483537651.tab") > > try(system("convert tmp/1wbm51483537651.ps tmp/1wbm51483537651.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.568 0.042 0.616