R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-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. > par5 = 'ATTLES separate' > par4 = '1' > par3 = 'all' > par2 = 'all' > par1 = '2' > par5 <- 'ATTLES separate' > par4 <- '1' > par3 <- 'all' > par2 <- 'all' > par1 <- '2' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: root > #To cite this work: Wessa P., 2012, Factor Analysis for Information Management 2 (v1.0.7) 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) > x <- as.data.frame(read.table(file='http://www.wessa.net/download/utaut.csv',sep=',',header=T)) > x$U25 <- 6-x$U25 > if(par2 == 'female') x <- x[x$Gender==0,] > if(par2 == 'male') x <- x[x$Gender==1,] > if(par3 == 'prep') x <- x[x$Pop==1,] > if(par3 == 'bachelor') x <- x[x$Pop==0,] > if(par4 != 'all') { + x <- x[x$Year==as.numeric(par4),] + } > cAc <- with(x,cbind( A1, A2, A3, A4, A5, A6, A7, A8, A9,A10)) > cAs <- with(x,cbind(A11,A12,A13,A14,A15,A16,A17,A18,A19,A20)) > cA <- cbind(cAc,cAs) > cCa <- with(x,cbind(C1,C3,C5,C7, C9,C11,C13,C15,C17,C19,C21,C23,C25,C27,C29,C31,C33,C35,C37,C39,C41,C43,C45,C47)) > cCp <- with(x,cbind(C2,C4,C6,C8,C10,C12,C14,C16,C18,C20,C22,C24,C26,C28,C30,C32,C34,C36,C38,C40,C42,C44,C46,C48)) > cC <- cbind(cCa,cCp) > cU <- with(x,cbind(U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33)) > cE <- with(x,cbind(BC,NNZFG,MRT,AFL,LPM,LPC,W,WPA)) > cX <- with(x,cbind(X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18)) > if (par5=='ATTLES connected') x <- cAc > if (par5=='ATTLES separate') x <- cAs > if (par5=='ATTLES all') x <- cA > if (par5=='COLLES actuals') x <- cCa > if (par5=='COLLES preferred') x <- cCp > if (par5=='COLLES all') x <- cC > if (par5=='CSUQ') x <- cU > if (par5=='Learning Activities') x <- cE > if (par5=='Exam Items') x <- cX > ncol <- length(x[1,]) > for (jjj in 1:ncol) { + x <- x[!is.na(x[,jjj]),] + } > par1 <- as.numeric(par1) > nrows <- length(x[,1]) > rownames(x) <- 1:nrows > y <- x > fit <- principal(y, nfactors=par1, rotate='varimax') > fit Principal Components Analysis Call: principal(r = y, nfactors = par1, rotate = "varimax") Standardized loadings based upon correlation matrix RC1 RC2 h2 u2 A11 0.52 0.02 0.27 0.73 A12 0.12 0.69 0.49 0.51 A13 -0.15 0.70 0.52 0.48 A14 0.29 0.57 0.41 0.59 A15 0.37 0.21 0.18 0.82 A16 0.63 -0.16 0.43 0.57 A17 0.43 0.15 0.21 0.79 A18 0.62 0.32 0.48 0.52 A19 0.20 0.61 0.41 0.59 A20 0.62 0.12 0.39 0.61 RC1 RC2 SS loadings 1.92 1.88 Proportion Var 0.19 0.19 Cumulative Var 0.19 0.38 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 45 and the objective function was 1.09 The degrees of freedom for the model are 26 and the objective function was 0.51 The number of observations was 228 with Chi Square = 113.49 with prob < 6.7e-13 Fit based upon off diagonal values = 0.62> fs <- factor.scores(y,fit) > fs RC1 RC2 1 1.809370169 0.016800582 2 0.430754580 -0.347866496 3 -0.470550226 0.291727417 4 -0.050715254 -2.568759286 5 -1.287103281 1.038309376 6 -1.508614744 -0.176190801 7 -0.195154378 -0.410377135 8 -0.035615905 1.561624292 9 1.053063964 -1.258416845 10 0.097556357 1.331666376 11 0.067944682 0.368879849 12 0.351479007 -0.223353667 13 -0.454016004 -0.535526073 14 1.260865256 -0.392979857 15 -0.705219952 -0.407065330 16 -1.784249951 0.483440416 17 1.157526030 -1.168023643 18 -1.104540627 -0.240750945 19 0.453513874 0.555404859 20 0.764553358 1.360001582 21 1.047393167 0.983150326 22 1.371395045 -0.197934492 23 -1.467849897 -1.141370258 24 1.394746880 -0.253907472 25 -0.660561458 0.245396133 26 -0.331661319 0.868655324 27 -1.486589515 0.433271797 28 -1.610205983 -0.463008787 29 2.523089039 0.900875663 30 -0.450932853 -0.285563407 31 -0.808241392 -0.225070186 32 0.548281412 -1.326699269 33 1.125742812 -2.905350413 34 0.478305625 0.553273171 35 -0.381247051 -0.514518989 36 -1.042118438 0.780303587 37 0.051128960 0.440151953 38 0.333499394 -1.510247531 39 0.822365033 1.353436848 40 1.190657110 -0.775655486 41 0.824037991 0.191497772 42 0.700038183 1.608249534 43 0.571813635 1.265564966 44 1.902018761 1.545954125 45 0.302371601 1.394906615 46 1.195385568 0.576074002 47 0.634400216 0.055010339 48 -0.092659297 -1.439931895 49 0.254142314 -1.495287114 50 0.223608783 0.320869853 51 -0.858918872 0.642944672 52 0.507871110 -0.420071337 53 -0.449471356 0.600456903 54 0.738017173 0.016779257 55 1.747235495 -1.279318909 56 -0.817419250 0.190121027 57 1.086443816 0.407697091 58 -0.685822962 -0.606285285 59 -1.045583831 1.140151432 60 0.047036042 -0.097146065 61 -0.600816770 -1.807680500 62 -0.776124088 1.219984366 63 1.778659563 -0.397322021 64 0.280227036 0.036947744 65 0.229803997 -0.403420660 66 0.030950460 0.881648499 67 0.688063093 -0.479359108 68 1.829506859 -0.199921839 69 0.196078361 1.056513884 70 0.794274388 1.894581799 71 -2.134881666 -0.457940125 72 0.109236599 0.469807063 73 -1.717627641 -0.055443996 74 -0.844915836 0.940912278 75 -0.061179525 -0.505483696 76 1.095965553 0.211770984 77 -1.334748266 0.152801600 78 -0.701592896 0.273318076 79 1.317975130 0.234925425 80 -0.423324195 0.170610015 81 0.330309268 -0.187133685 82 -1.215311764 0.081623225 83 -0.068588481 0.148760477 84 0.947712682 -0.125898058 85 0.604775577 -0.288581253 86 1.086443816 0.407697091 87 0.485978413 0.411151431 88 -0.105377805 -2.966258445 89 -1.437980223 0.006357251 90 -2.561441260 -0.294175685 91 0.233996837 -0.904798743 92 0.823087991 0.558434062 93 0.029632785 -0.982979244 94 1.136696343 0.176903920 95 0.400220121 0.571870099 96 -0.161775887 0.568638409 97 1.579271553 -0.956135359 98 0.158762940 0.478974611 99 -0.084867551 -0.113822240 100 0.930775382 0.027959030 101 -0.455768479 -0.043032278 102 -1.689447407 -0.419166243 103 0.599577385 -1.480734359 104 0.294731239 0.093689843 105 -0.177734803 0.239534384 106 2.300633523 0.640902086 107 -0.418425556 1.255218901 108 -0.793684489 -0.956172832 109 0.004606138 -0.248907070 110 0.852170779 0.363860872 111 1.256414001 1.146168714 112 0.346254098 0.141996760 113 -1.290946893 1.280746505 114 -0.503906118 0.602662701 115 -1.067697077 -0.559865423 116 -0.142484407 0.721571777 117 0.666461197 2.078708632 118 -1.839473784 -0.275577510 119 -0.676274581 1.710362419 120 -0.497922772 -1.050908796 121 0.757308275 0.889447747 122 0.491709366 0.272551222 123 0.571393971 0.040392734 124 -0.026285575 0.670137894 125 1.275732090 1.249031162 126 -0.812174258 0.778226416 127 0.118506258 -1.017246174 128 -0.470550226 0.291727417 129 -0.669615011 0.016420539 130 -0.445691973 -1.070665687 131 2.082228405 0.924453598 132 -1.508614744 -0.176190801 133 -0.195154378 -0.410377135 134 0.017898737 0.794018823 135 0.097556357 1.331666376 136 0.067944682 0.368879849 137 0.640838425 0.328856687 138 -0.454016004 -0.535526073 139 -0.807461400 -1.380169659 140 -0.521566664 -0.249564405 141 -1.784249951 0.483440416 142 1.157526030 -1.168023643 143 -2.280668996 0.499598906 144 0.112149455 0.726481471 145 -1.166585356 1.507968464 146 -1.467849897 -1.141370258 147 0.076240489 1.091234078 148 -0.660561458 0.245396133 149 0.254263686 0.682541144 150 -0.265618797 -0.322385073 151 -0.935862465 0.873163992 152 0.503312523 -0.195972642 153 1.855872750 1.150012228 154 -0.808241392 -0.225070186 155 -0.131347648 -0.217491918 156 -0.134154375 -1.457414702 157 1.125742812 -2.905350413 158 -0.929553394 0.460396619 159 -0.381247051 -0.514518989 160 -1.042118438 0.780303587 161 0.051128960 0.440151953 162 0.333499394 -1.510247531 163 0.822365033 1.353436848 164 0.241940676 0.664750849 165 -0.432804123 0.141761997 166 0.178517250 -1.338190368 167 0.227735758 -0.072144522 168 0.473769284 0.115651028 169 2.165793355 -1.520857648 170 0.302371601 1.394906615 171 1.195385568 0.576074002 172 0.634400216 0.055010339 173 -0.248263438 -1.014902114 174 0.981982460 0.535850944 175 -0.275899816 -2.869660759 176 0.041826740 -0.186264352 177 0.881910606 0.606427605 178 0.467614805 1.729156002 179 -0.633514638 0.347228222 180 0.708317793 -1.137659995 181 1.172348019 -0.154242614 182 -0.685822962 -0.606285285 183 1.845097029 -0.072648728 184 -0.580427023 -0.688801009 185 -0.600816770 -1.807680500 186 -0.061704366 -0.440220429 187 0.820492889 0.159152192 188 0.030950460 0.881648499 189 0.688063093 -0.479359108 190 -0.573648577 0.471979847 191 0.090175627 0.728416706 192 0.143919634 1.023334793 193 -1.274341707 -0.132354582 194 3.026339499 1.083581013 195 -0.936946646 -0.092808552 196 0.512131200 -2.566140128 197 -0.076732429 -0.387224479 198 0.792928226 -2.097591365 199 -1.114602620 0.433012847 200 -0.104138194 -0.752770035 201 -0.145300365 2.173076528 202 -1.272133390 1.347044251 203 -0.967951050 0.250366793 204 -0.993716282 0.166220674 205 1.117305806 0.846712577 206 -0.163005756 0.692619433 207 0.251399400 -0.858315273 208 -0.136246287 -1.302100804 209 -0.039938667 -0.901826785 210 -2.158078199 1.017317511 211 0.501453395 0.639449400 212 -2.081907691 -1.127619178 213 1.736361858 -0.046679837 214 -0.711168530 0.534740829 215 -0.105377805 -2.966258445 216 0.020194521 0.773807573 217 -0.076188819 -0.481788889 218 1.993146086 -0.120086617 219 -0.631012272 0.521362774 220 -2.813688436 0.435400294 221 -0.197913303 0.681030930 222 0.052999133 -1.392821840 223 -1.347331262 -0.453164115 224 -1.266904321 0.830533524 225 -2.044161587 -1.277584598 226 -0.753820937 0.718210048 227 0.460774525 -3.994366458 228 -1.683688024 1.059365826 > postscript(file="/var/www/rcomp/tmp/1yq0b1335793384.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > fa.diagram(fit) > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/25xmm1335793384.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/36efo1335793384.tab") > > try(system("convert tmp/1yq0b1335793384.ps tmp/1yq0b1335793384.png",intern=TRUE)) character(0) > try(system("convert tmp/25xmm1335793384.ps tmp/25xmm1335793384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.790 0.420 2.417