R version 2.13.0 (2011-04-13) Copyright (C) 2011 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 = 'Learning Activities' > par4 = 'all' > par3 = 'all' > par2 = 'female' > par1 = '2' > par5 <- 'Learning Activities' > par4 <- 'all' > par3 <- 'all' > par2 <- 'female' > 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 BC 0.42 0.47 0.399 0.60 NNZFG 0.30 0.01 0.089 0.91 MRT 0.33 0.00 0.109 0.89 AFL 0.87 0.13 0.781 0.22 LPM 0.89 0.24 0.855 0.14 LPC 0.86 0.11 0.758 0.24 W 0.02 0.85 0.725 0.27 WPA 0.04 0.84 0.715 0.28 RC1 RC2 SS loadings 2.68 1.75 Proportion Var 0.34 0.22 Cumulative Var 0.34 0.55 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 28 and the objective function was 3.76 The degrees of freedom for the model are 13 and the objective function was 1.28 The number of observations was 254 with Chi Square = 317.74 with prob < 4.6e-60 Fit based upon off diagonal values = 0.86> fs <- factor.scores(y,fit) > fs RC1 RC2 1 0.071431618 0.69523945 2 0.602393576 0.38963269 3 -0.825221961 0.66952609 4 0.854187036 -0.21943909 5 -0.330743430 -0.21949942 6 -0.425008078 -0.08300954 7 -0.590390930 -0.08184179 8 1.149902815 -0.67590150 9 0.794990698 -0.41535242 10 -0.412727811 -0.45425790 11 -0.360694407 0.36905639 12 0.506463743 -0.06213539 13 0.342071290 1.16626278 14 1.341453318 -0.12397459 15 0.386235803 0.25893519 16 0.402446148 0.71023328 17 0.462087825 0.89056791 18 0.376870719 0.83369912 19 -0.025343293 0.17418921 20 1.300105889 1.16692617 21 4.606910889 0.80375013 22 1.029529071 0.79605860 23 -0.012677248 0.97448970 24 -0.033540378 0.50236515 25 0.907772912 -0.09301547 26 0.323514836 -0.11237833 27 1.727229068 -0.45709189 28 -0.507869961 1.07361048 29 0.107914253 0.88118132 30 1.439778472 0.40482354 31 0.610274920 1.25093628 32 -0.305320619 -0.33058791 33 1.732180772 0.90099259 34 -0.053305234 1.12893289 35 0.597101314 -0.44819359 36 -0.316922788 1.08479707 37 0.067968187 -1.55351579 38 0.274627484 -0.09710814 39 1.375292712 -0.54967015 40 -0.642759724 0.60875819 41 0.283568002 -0.18244630 42 1.530367416 -0.39293251 43 2.434332226 0.59157823 44 0.014586864 -0.33928977 45 1.701077155 -0.30991484 46 0.881502819 0.55186376 47 -0.080172988 -0.18858066 48 0.126384444 -0.97549497 49 -0.875027785 0.26354249 50 -0.351638720 -0.26240990 51 1.087685048 -0.18590863 52 0.434616485 0.33515455 53 0.452714016 -0.18616181 54 4.045183269 -1.45021690 55 2.611130023 -0.34461028 56 -0.276931530 -1.37138144 57 -0.302928009 -1.16388914 58 1.525295387 -0.16023131 59 -0.905532430 -0.56768864 60 0.863382520 -0.28127664 61 0.607068511 0.41867941 62 0.318605199 -0.87082778 63 0.549199475 -0.33845645 64 4.210468429 -1.48531490 65 -0.893271108 -0.31984010 66 3.649655343 -0.34435229 67 0.045377057 -0.55998235 68 1.897529640 -1.54694438 69 -0.675491729 -0.64197554 70 -0.326394541 -1.07708904 71 -0.364576179 -0.04552505 72 -0.597405237 0.26518767 73 1.104181887 -1.03893258 74 -0.924251010 -0.55198349 75 1.305238894 -1.49809248 76 -0.339383391 -0.69919251 77 -0.322677597 -0.28047570 78 -0.812967198 -1.05804429 79 0.408288651 -1.52977884 80 -0.039445289 0.98293948 81 0.033519636 -0.30147694 82 -0.006821025 -0.62348582 83 0.281194728 -0.82625046 84 -0.067941775 -0.46021740 85 -0.202349225 -0.33455611 86 -0.226208259 -1.15476264 87 -0.912717941 -0.68108786 88 1.449418624 -0.86329161 89 -0.457439347 0.87836913 90 -0.609894891 -0.98447218 91 -0.707951638 -1.03032290 92 0.493239175 -0.26392058 93 -0.106237508 -0.99369794 94 -0.510716501 -1.16100064 95 0.982238240 -0.44071028 96 -0.415864176 -1.38109057 97 -0.921250367 -0.26668050 98 -0.006411195 -0.31887774 99 -0.498102741 -0.33340287 100 -0.818914356 0.76972448 101 -0.180018067 -1.19860173 102 -0.658776283 -0.07834806 103 -0.013200145 -1.19175867 104 -0.354125197 0.27602456 105 -0.770858411 0.10778469 106 -0.682005193 -0.82656872 107 0.072786068 -1.22138738 108 0.204300522 -1.00902584 109 0.431770081 -1.31224062 110 1.714481703 -0.08961786 111 -0.416856698 -0.21316530 112 1.693292017 0.05039088 113 -0.445826441 -0.86202204 114 -0.517498647 0.75473621 115 1.341989657 -1.66287098 116 -0.769424045 0.46948907 117 0.572404968 -1.00977378 118 1.235845431 -1.19306775 119 -0.171506102 -0.79200788 120 -0.715747545 -0.02266598 121 -0.604238149 -0.51649217 122 -0.318553068 -0.13529890 123 -0.088531692 0.27069148 124 -0.643218094 0.71657065 125 0.115531710 -0.27748043 126 -0.789588838 -0.76908127 127 -0.009167460 -0.34991919 128 0.015450840 -0.39910529 129 -0.307023651 -1.49711181 130 -0.089340194 -0.33208227 131 -0.648701594 -0.35635796 132 -0.162437541 -0.49094397 133 0.126734133 0.70224266 134 -0.049691174 -0.77548341 135 0.617752641 -0.72897396 136 -0.403529665 -0.47209230 137 -0.745774718 1.20922980 138 -0.495189006 0.36259449 139 -0.224362154 0.14495665 140 -0.424085253 0.73214219 141 1.800395887 2.23059734 142 -0.344160879 0.59140736 143 -0.094573341 0.14824983 144 1.712619317 0.84764464 145 2.856996324 -0.09940168 146 -0.034451784 0.53093496 147 -1.268854061 2.73089764 148 -0.096767579 1.90814412 149 0.378936980 0.15491217 150 0.256093205 1.71081717 151 -0.657398509 0.02918458 152 -1.283506889 -0.50129023 153 -0.325414484 0.85875024 154 -0.457710138 -0.87680551 155 -0.571153287 0.75084930 156 -0.858102147 -2.49969100 157 -1.197130522 -1.33448651 158 4.334810642 0.78358666 159 0.123976328 0.07163454 160 0.012405916 -0.84762219 161 -0.230895897 3.52578541 162 0.201702775 -0.36323378 163 -0.110206194 0.99408331 164 -0.723705195 0.92529155 165 0.430889735 -1.00802569 166 0.242300744 0.57973931 167 0.876376232 2.40441489 168 -0.447898261 0.47552154 169 1.875892700 0.31583394 170 -0.456881996 -0.71478889 171 -0.276763563 0.97757232 172 1.718207881 0.90781792 173 -0.531101835 -0.05442532 174 -0.844865664 -1.10969934 175 -1.343428781 -0.35040484 176 -0.450796043 1.08967541 177 0.254654610 0.96243157 178 -0.021717152 2.12311364 179 0.129962529 2.08504022 180 -0.438994973 0.92160777 181 -0.279021063 4.19442755 182 -0.112037021 -0.54541611 183 -0.285863273 0.74295108 184 1.166030564 0.01860098 185 -0.283165756 0.37648914 186 1.062952710 1.70931356 187 1.190356629 0.70785105 188 -0.658020941 0.55746159 189 -0.495722217 -0.61691853 190 -0.356924344 0.41722374 191 0.247581150 -0.69192266 192 0.954357180 0.21067962 193 -0.422323562 -0.45001475 194 -0.408549774 -1.06557390 195 -0.741669632 1.65965524 196 -0.902745769 0.01430562 197 -0.873896308 -0.25372200 198 0.251439520 1.63485527 199 0.632466853 0.87199148 200 -0.677177392 -2.59803531 201 -0.196690163 -1.35985170 202 -0.082252169 -0.63807971 203 -1.960926852 -2.44827838 204 -1.000041487 1.92148371 205 -0.391098318 -0.36751996 206 -1.263271690 1.74149291 207 -1.280392079 -0.30875982 208 -0.594361128 0.23274393 209 -1.439950242 -0.35959021 210 -1.044675726 -0.18241542 211 -1.168205122 1.45605126 212 0.403796959 -0.44002789 213 -0.638154752 0.59979803 214 -0.747423901 -0.09917498 215 -1.339455955 1.10521767 216 -0.225621591 -0.19501684 217 -0.614175143 -0.18527744 218 0.859030505 1.10406764 219 -0.501860162 0.36506836 220 -0.889662351 -0.31529742 221 -0.790901469 1.78795919 222 -0.163308691 -0.84739391 223 -0.707111901 -0.63282104 224 -0.424567346 -0.49684727 225 -0.129582665 -0.26033092 226 -0.719955289 1.87215567 227 -0.796431042 -1.15755909 228 -0.459354193 -0.32165964 229 -0.844875831 0.48281279 230 -1.048740705 -1.55108434 231 -0.206700274 2.53105819 232 -0.696588711 -0.91575002 233 -0.597427788 -0.05997346 234 -0.642530118 0.93198252 235 -0.780499677 -2.53925765 236 -1.057789377 -1.44934953 237 -1.208175491 0.81589545 238 -0.859199799 -1.20758273 239 -1.125957030 1.11882523 240 -0.957676889 -0.26854353 241 -1.018727428 0.70711286 242 -0.838000801 -0.96800580 243 -1.321724395 -0.60754259 244 -0.452390366 2.23230070 245 -0.697807292 0.82903912 246 -0.164830688 -0.79823605 247 -0.891055817 -0.21580572 248 -0.576274212 1.43185543 249 -0.526523280 0.88129429 250 -0.691884428 0.05898383 251 -0.698438069 -0.10726550 252 -0.820453980 0.60450482 253 -1.293041303 0.23733263 254 -0.585300206 -0.67439651 > postscript(file="/var/wessaorg/rcomp/tmp/1ztul1335787299.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/wessaorg/rcomp/tmp/20r8t1335787299.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/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/3mxtx1335787299.tab") > > try(system("convert tmp/1ztul1335787299.ps tmp/1ztul1335787299.png",intern=TRUE)) character(0) > try(system("convert tmp/20r8t1335787299.ps tmp/20r8t1335787299.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.911 0.207 1.114