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 = 'ATTLES connected' > par4 = 'all' > par3 = 'bachelor' > par2 = 'all' > par1 = '2' > par5 <- 'ATTLES connected' > par4 <- 'all' > par3 <- 'bachelor' > 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 A1 0.54 -0.11 0.31 0.69 A2 -0.04 0.73 0.54 0.46 A3 0.63 -0.02 0.40 0.60 A4 0.36 0.33 0.24 0.76 A5 0.58 -0.05 0.33 0.67 A6 0.63 0.17 0.42 0.58 A7 0.33 0.45 0.31 0.69 A8 0.65 0.23 0.47 0.53 A9 -0.05 0.73 0.53 0.47 A10 0.49 0.19 0.27 0.73 RC1 RC2 SS loadings 2.32 1.51 Proportion Var 0.23 0.15 Cumulative Var 0.23 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.05 The degrees of freedom for the model are 26 and the objective function was 0.47 The number of observations was 452 with Chi Square = 209.08 with prob < 1.6e-30 Fit based upon off diagonal values = 0.65> fs <- factor.scores(y,fit) > fs RC1 RC2 1 -0.428762312 -1.920529463 2 0.298811133 -0.153618458 3 -0.096068601 0.492616065 4 0.417732645 -0.005671222 5 0.262645077 -2.316676814 6 0.522193601 -0.104974230 7 0.047949421 -1.073275731 8 -1.857601628 -1.147540486 9 0.231583424 -1.126373786 10 -4.267615518 0.883017550 11 -3.424159104 -1.977317566 12 -0.988008138 -0.243553861 13 0.063330710 1.533460032 14 0.216882465 -0.028679398 15 -0.765577130 0.272670753 16 -0.686144261 -1.081373099 17 -1.483279256 0.194244137 18 0.668253245 -0.016435379 19 0.749158647 -1.382748333 20 1.050336236 -1.752171064 21 -3.662549797 2.017604200 22 -2.578030581 -1.787528976 23 -0.163241701 0.315499347 24 1.267287882 -0.614023321 25 0.915842251 -1.177163655 26 1.148050327 -2.594811592 27 0.601325993 -0.586507237 28 0.451173457 -0.440436027 29 0.105193850 -0.452094487 30 -3.015704722 -1.319761774 31 0.518874340 -0.398167034 32 -1.082269837 -1.126512005 33 0.871678741 -1.655715881 34 -0.335967180 -0.091803455 35 -0.244943754 -0.721079322 36 0.252501325 0.266980565 37 -0.444098689 1.477586345 38 -0.932556218 0.576266113 39 0.785477168 -0.312727653 40 -1.445768968 0.269058914 41 -1.683204657 -1.798179299 42 -1.959642220 -2.181469770 43 -0.603286144 -0.990193880 44 1.018705439 -1.052636736 45 0.564011313 -0.662640440 46 -0.288370958 -1.625537463 47 -1.354495942 -1.007202419 48 -0.156918794 -0.556540803 49 0.947303289 -0.879656862 50 -0.821312001 -0.486424436 51 -0.061465328 -0.668788563 52 -0.425944170 1.534913693 53 -0.401922023 -0.470170357 54 0.707195452 -0.123015730 55 0.658463778 -1.008402031 56 -0.802117596 -0.331611566 57 0.458615915 -0.449321657 58 -1.376726508 -1.232067548 59 -1.370462849 -0.978414109 60 0.845475900 -0.211265141 61 0.853220578 -0.620045060 62 -1.071214942 -0.681682629 63 1.207845910 0.507603452 64 -0.123280473 -0.644395565 65 -0.665748802 0.016424210 66 -0.005986487 -0.313734775 67 -0.244652342 0.242020637 68 -0.414913613 -1.299526139 69 0.260541921 -0.325806314 70 0.429880532 -1.716319991 71 -0.547977581 -1.254142326 72 0.687008389 0.020972009 73 0.951504253 0.210215558 74 0.802969595 -1.514364050 75 0.182964520 -0.834359922 76 0.536160581 0.304892260 77 0.203885158 -1.251878761 78 0.457829166 0.527282712 79 0.086961691 -0.552903018 80 -0.197524608 -0.392201382 81 -0.261004422 1.032934694 82 0.152639918 -0.587982733 83 -0.189734981 -0.886231852 84 0.954562093 -0.360822744 85 0.627705510 -1.193196117 86 -0.328505516 -0.523404958 87 -1.089751448 1.403237940 88 0.234081135 -0.415981421 89 -0.399704344 -0.393793824 90 -1.446012945 -0.215310307 91 -0.434018146 -0.591152145 92 0.585084415 -2.173196954 93 -0.202696722 -0.434240084 94 0.218719402 -0.228676060 95 0.227241785 -1.053643858 96 0.444702139 -0.612443219 97 0.864892834 -0.522536883 98 0.041213212 0.027224738 99 0.418414799 0.305281241 100 -0.237099781 -0.053479619 101 0.659677419 -0.962309016 102 -3.061779452 -1.036855736 103 0.117084129 0.326435998 104 -3.028794750 0.714415304 105 1.662414629 -2.628415811 106 -2.815847200 -0.997952988 107 0.407333686 -0.767512879 108 0.565425622 1.534228832 109 0.554325900 1.666160311 110 -0.948382448 -0.557547925 111 0.165570243 -0.445739473 112 0.427750853 -1.961057112 113 -0.663510072 -2.089586570 114 -0.522115514 0.394790606 115 0.192856785 0.538899485 116 0.766292422 0.413348637 117 -1.670715659 -2.578406638 118 -0.197508891 -0.926878492 119 -1.274080606 -0.465131642 120 -0.049639126 -0.858906693 121 -1.379289290 -0.018234123 122 0.563421488 0.661220222 123 0.071443990 1.422526886 124 0.222990978 -0.928359052 125 -1.276599442 1.115471284 126 0.429880532 -1.716319991 127 -0.680646255 -0.491859602 128 0.837159767 -1.207446667 129 -0.380951687 -0.920367725 130 0.958850874 -2.204740358 131 -1.946929776 -0.378833195 132 -0.579839387 -1.771644052 133 0.339235361 -1.374652219 134 -0.040511612 0.024902440 135 0.489622671 -0.384746382 136 -0.385675493 0.394576620 137 -1.006121735 -0.581662599 138 0.056490447 -0.686806903 139 -1.552830194 0.800773310 140 0.959538601 -0.317465617 141 1.101023833 -0.570655135 142 -0.557270093 -0.596458530 143 0.006361251 0.068986485 144 -0.003113751 0.279187203 145 1.312485030 0.027120132 146 -0.336308292 -1.022224885 147 -0.156918794 -0.556540803 148 0.657839153 -0.243946178 149 1.750442271 -0.217506524 150 0.362604386 1.749421888 151 2.081283103 -1.743349220 152 0.614052836 0.332877509 153 -2.121213573 0.548826030 154 -0.789760939 1.998046765 155 1.225730869 -0.348095078 156 0.777455354 -0.233501731 157 0.875466706 1.270259733 158 1.683021021 -0.383878308 159 0.069980997 -2.000732014 160 1.783369878 0.174144618 161 0.524957998 -0.028015384 162 -0.010652460 0.474806925 163 0.985583706 -0.637558083 164 -0.077991004 -0.560254746 165 1.530104944 -0.840061353 166 -0.169477855 -0.403266528 167 2.225198081 0.333617580 168 1.845715744 -1.230894150 169 -1.145110888 -0.707357415 170 -0.936493752 -0.952209991 171 0.295379749 1.340301599 172 1.534359227 -1.635740900 173 1.108186668 -1.473076052 174 -0.579268893 -0.165435281 175 0.191946529 -0.882290645 176 0.626735688 -0.663728575 177 1.395395151 -0.466530461 178 0.430668633 0.071812584 179 1.318777945 -0.943788871 180 1.277286909 0.644525554 181 0.912160499 -1.801341325 182 0.574619682 0.081918109 183 1.288611965 -0.214473330 184 0.720156610 -0.574661247 185 0.417871992 -0.649907394 186 1.493907071 0.291489126 187 1.069557163 0.638249427 188 0.257965253 -1.428254580 189 -0.583272836 -1.082789113 190 -0.133293633 -0.195074780 191 -0.200816060 0.457136253 192 0.778808189 -2.155422433 193 0.940313019 -1.235259860 194 1.134824279 -0.870658413 195 -0.140475817 -1.211353613 196 -0.464069635 0.763758528 197 0.733937926 1.665759781 198 0.716769351 -0.689741997 199 1.418394949 -0.664039879 200 1.131807477 -0.039648999 201 0.659968832 0.000790943 202 0.468418892 0.060404635 203 1.231535750 -1.021717458 204 -0.188583675 -0.726786237 205 0.006939871 -1.324785101 206 1.122340354 1.194722714 207 -1.026894712 -0.068420519 208 1.354955205 1.289180408 209 -0.180267542 0.269395288 210 -1.631676867 0.177573696 211 1.107189924 -0.478842324 212 -0.436809614 -0.487210135 213 0.168766728 -0.568283016 214 1.181777354 -0.844276664 215 0.208891658 -1.109652780 216 1.167408278 -0.955771912 217 0.654102224 1.994743581 218 1.833060731 2.349894275 219 0.924287774 -0.147470336 220 -1.440752319 -0.233370465 221 1.616031282 -2.164375111 222 0.700072688 1.307489398 223 -0.895392609 -0.389318790 224 1.575313297 -0.129006976 225 -0.340518299 -1.551680815 226 -1.138684838 0.158765340 227 0.801132659 -1.314367388 228 -0.150455723 0.608350218 229 1.001342339 0.098965087 230 0.734678151 -1.556203675 231 -0.251045933 -0.295571069 232 1.362869489 -1.440418176 233 1.016965487 -0.690453195 234 -1.148808347 1.394957784 235 0.506756446 1.411350587 236 1.068939499 -0.622072250 237 -0.146394722 0.901153160 238 0.580660373 -0.380476287 239 -0.752177293 0.913287293 240 0.743033514 0.660819692 241 0.692977555 -0.234471473 242 0.597524090 -0.122223713 243 1.028938200 -0.190261549 244 1.302167770 -1.361981333 245 -1.419478036 -0.168923127 246 0.966828260 -2.282608347 247 -0.841105353 2.077073473 248 -0.897698963 -1.471817771 249 0.476293481 -0.398756109 250 0.731246767 -0.062283617 251 -1.562575078 -0.267697163 252 0.920671835 0.093901526 253 0.757277046 1.400586430 254 -1.323385623 0.554451932 255 -0.235900274 1.700483057 256 0.386964134 -1.071008218 257 1.232478803 0.237358730 258 -0.587363944 1.564875193 259 0.048681577 0.812641078 260 -0.126036375 1.134737575 261 0.243227334 0.129004458 262 0.914925198 -0.116739604 263 0.857975294 1.212827974 264 0.318852691 -1.229346054 265 0.627146862 0.893645918 266 -1.794868024 0.990982444 267 -0.369581906 0.485545192 268 -0.920558486 0.263463105 269 0.725247609 0.094291012 270 1.498026183 0.684843810 271 -2.108419614 -0.975824760 272 -0.150652648 0.261093924 273 0.161589495 1.217389729 274 -0.164316792 0.892638796 275 0.394153490 0.262178487 276 -0.114614487 -0.885851976 277 -0.288174033 -1.278281169 278 -0.774008770 -0.090037748 279 0.224888563 0.426771790 280 0.111925164 1.277247693 281 -0.697280296 -0.874596790 282 0.137716431 0.975796266 283 -0.169407791 0.223686536 284 0.966898626 -0.048012408 285 -0.796730528 -0.172185595 286 -0.253336205 0.387826744 287 0.139295437 0.023529735 288 -1.293100251 -0.912767098 289 0.503992050 1.334391742 290 -0.212016156 0.688209897 291 0.540462150 -0.295921879 292 -0.882066130 1.410871999 293 -0.141595034 0.974786643 294 -0.518585817 -1.455308750 295 0.581733338 0.828219076 296 0.707309207 -0.820851893 297 -0.292994693 0.863934749 298 0.842206641 1.070506400 299 0.249878957 1.792156315 300 0.623980370 1.115058314 301 -0.606006662 1.347997818 302 -0.600521445 0.694407841 303 -2.810988388 -0.743805277 304 0.030672562 1.687053585 305 0.056525248 -0.127402094 306 0.822929638 0.737195720 307 0.109979888 0.961281223 308 -0.487760361 0.685782813 309 -0.461108314 1.187973667 310 -0.411017611 0.534769732 311 0.368056525 -0.015377931 312 -2.387845267 0.005213361 313 0.075539651 0.143908987 314 0.357530007 -0.063418743 315 -0.120295311 -0.230943574 316 0.152353478 -0.639219186 317 0.310884964 -0.270588904 318 -0.386369002 -0.270152098 319 1.104225126 -0.232662723 320 2.051989990 2.125443007 321 -0.288929606 0.461304573 322 0.678263477 1.312024419 323 0.126111751 0.941259864 324 0.219843786 0.395535741 325 -0.819655876 1.564486644 326 -0.748745389 1.035410590 327 0.185973277 0.068585955 328 0.587072024 1.368898296 329 0.833212098 1.566892376 330 -0.110748181 0.990873890 331 1.514087577 1.271899166 332 1.079034230 1.233113827 333 0.850939018 0.227909244 334 0.326367278 0.193786498 335 -0.221784636 -0.869754462 336 0.314796682 1.029029858 337 -0.588791372 -0.183192576 338 0.713093565 0.228963754 339 0.892370637 0.874117822 340 -0.210094721 1.014939515 341 -0.266503915 1.052978709 342 -0.258469567 0.525297534 343 -0.125939543 -0.026853092 344 0.406407589 0.853327662 345 0.610048653 0.772740079 346 0.320975409 1.040168598 347 0.781823256 1.647277017 348 -2.709491464 0.518857639 349 -0.191021395 0.226903132 350 1.011625038 -0.428554658 351 1.365411660 0.710268157 352 -0.470165928 0.474280949 353 -1.346026881 -1.595915123 354 -0.311988087 0.360945054 355 -2.356936079 -0.092051992 356 -0.493990377 -0.090813283 357 -0.731635975 1.226227352 358 -0.083119977 0.489425801 359 0.922255230 0.053844752 360 -0.441667539 0.865938778 361 -0.323567597 -0.202720673 362 0.368397636 0.915043499 363 -1.203435647 0.721573288 364 0.938850969 0.572263999 365 0.569964770 1.808408947 366 -0.080258446 1.012436856 367 -0.054975336 0.031336272 368 1.212136172 -0.530902793 369 -0.138428541 0.753374247 370 0.182876848 0.916951415 371 0.930060927 0.832434387 372 0.629835341 0.375318548 373 0.524765462 0.536938080 374 -0.316861606 0.731973286 375 -0.894916603 0.601046315 376 -0.874583632 0.488418679 377 -0.435220062 1.048709118 378 0.277746309 -0.319264756 379 -0.992462788 0.008992303 380 -0.497623457 1.378339569 381 -0.703661187 0.239980675 382 0.250129158 -1.071683289 383 -0.387917597 0.329309485 384 -2.120925232 0.948290951 385 -0.626263789 0.865032494 386 -1.241988531 2.335454052 387 -0.791304575 -0.148787933 388 1.538354860 0.190950392 389 0.386366031 1.929055257 390 0.173484280 0.848813294 391 0.724469903 0.510478891 392 0.046328053 0.685413850 393 -1.026775432 0.893981448 394 -0.286436887 -1.379481916 395 1.375825752 0.937778956 396 0.756545194 1.122312497 397 -1.015818409 -0.430672679 398 0.112782561 0.927250137 399 1.439816017 -0.102303010 400 -0.559647156 0.894720265 401 -0.018559983 -0.060233715 402 0.409909036 -0.013639332 403 -0.579151659 0.115630689 404 0.400433298 -1.126869908 405 0.263609420 -0.015955457 406 1.571011728 0.471807163 407 1.082535677 0.366146833 408 -1.784615899 1.339450423 409 -0.266991950 1.350265332 410 0.536160581 0.304892260 411 -1.329304281 -1.357192647 412 0.598367353 1.235648392 413 0.794382317 1.494002741 414 0.165823682 2.235993294 415 0.134161390 -0.211943506 416 -0.709000457 -0.300352295 417 -0.146880152 -0.302404703 418 0.912962718 0.711528548 419 -0.059651930 0.749620798 420 -0.749959030 0.989317575 421 -0.518312672 1.094876634 422 -2.019362734 1.552406891 423 1.216361497 2.164249834 424 -1.965554835 1.191475229 425 1.583555498 0.944055082 426 0.134363972 1.420120325 427 -0.665016950 0.294698144 428 -1.021669997 1.462706924 429 0.725685705 1.186899320 430 -0.538765405 0.613229736 431 -0.606006662 1.347997818 432 0.049609037 1.089596586 433 -0.302340648 -0.249222890 434 0.197260360 0.928219879 435 -0.777692680 0.304754041 436 0.801934877 1.198502485 437 -0.323154521 1.702882289 438 0.194878426 1.875316349 439 -0.453532215 -0.725932612 440 -1.530295137 -0.217598474 441 -0.418641977 -0.878684291 442 -3.912348940 0.102321837 443 -0.347645833 0.201313400 444 -1.701434135 0.347382938 445 0.022551973 0.606007266 446 -0.481795439 -1.664349123 447 -3.598582563 -1.146124149 448 -0.487167305 -0.808215558 449 1.352282746 2.880473544 450 -0.538042206 -0.230815570 451 -0.288929606 0.461304573 452 0.578269280 -0.023100487 > postscript(file="/var/wessaorg/rcomp/tmp/1l5kd1337852979.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/2pexj1337852979.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/3v9ff1337852979.tab") > > try(system("convert tmp/1l5kd1337852979.ps tmp/1l5kd1337852979.png",intern=TRUE)) character(0) > try(system("convert tmp/2pexj1337852979.ps tmp/2pexj1337852979.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.060 0.199 1.250