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 = 'COLLES actuals' > par4 = 'all' > par3 = 'bachelor' > par2 = 'all' > par1 = '2' > par5 <- 'COLLES actuals' > 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 C1 0.53 0.12 0.30 0.70 C3 0.69 0.04 0.48 0.52 C5 0.69 0.11 0.49 0.51 C7 0.71 0.04 0.51 0.49 C9 0.52 0.28 0.35 0.65 C11 0.50 0.28 0.32 0.68 C13 0.46 0.26 0.28 0.72 C15 0.46 0.30 0.30 0.70 C17 0.24 0.53 0.34 0.66 C19 0.09 0.59 0.36 0.64 C21 0.12 0.68 0.47 0.53 C23 0.28 0.56 0.39 0.61 C25 0.59 0.31 0.45 0.55 C27 0.43 0.30 0.28 0.72 C29 0.63 0.10 0.40 0.60 C31 0.47 0.26 0.29 0.71 C33 0.28 0.68 0.54 0.46 C35 0.24 0.70 0.56 0.44 C37 0.25 0.66 0.50 0.50 C39 0.02 0.61 0.37 0.63 C41 0.47 0.31 0.31 0.69 C43 0.42 0.43 0.36 0.64 C45 0.56 0.17 0.35 0.65 C47 0.54 0.22 0.33 0.67 RC1 RC2 SS loadings 5.19 4.14 Proportion Var 0.22 0.17 Cumulative Var 0.22 0.39 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 276 and the objective function was 9.51 The degrees of freedom for the model are 229 and the objective function was 3.19 The number of observations was 387 with Chi Square = 1200.24 with prob < 2.6e-131 Fit based upon off diagonal values = 0.91> fs <- factor.scores(y,fit) > fs RC1 RC2 1 0.833371777 0.951444716 2 0.397048732 0.478714134 3 0.032076640 -0.261990425 4 -1.194947680 1.307656747 5 -0.370917477 -0.826811337 6 0.506226018 -1.079256485 7 1.438566256 -2.712423762 8 1.164970898 1.562404839 9 0.137716386 0.233482834 10 -0.092998197 1.117931206 11 0.444591105 -1.367692572 12 0.292778100 0.670384674 13 0.759693129 1.451795113 14 1.358123984 -1.117783897 15 -1.077948114 -0.971266053 16 -0.224888088 -0.516637619 17 -1.597061453 0.307651359 18 0.425023780 0.944601689 19 0.249495995 1.546713096 20 1.077898841 0.014112925 21 -0.823634329 0.866479856 22 -0.345315383 0.893417729 23 0.826880416 -2.895875800 24 -0.299835272 -1.131147852 25 0.075884183 0.981283233 26 0.315489290 0.786738453 27 0.710795641 -0.147442357 28 -1.319427700 0.229689031 29 0.907008699 -0.591091985 30 1.934770613 -2.290721310 31 -0.006267003 -0.688842110 32 -0.342953777 -0.574849281 33 1.529228132 -1.025260579 34 -0.015889519 0.274100601 35 -2.156511400 1.272138859 36 -1.212781141 -1.375306897 37 -0.795412539 -0.157954629 38 0.629231860 -0.121265765 39 -0.500211457 0.705208886 40 0.047521356 -3.354990334 41 -0.434773646 -0.832972015 42 0.172829914 -0.915613816 43 0.188880535 0.309402650 44 -0.993975158 -0.343396143 45 1.371103248 -1.119909147 46 0.158642239 0.644406995 47 -0.289437448 0.029986714 48 0.359948587 -0.307583016 49 0.319193356 -0.499968383 50 -0.386727734 1.322628043 51 -0.273498729 -0.913680907 52 0.284604915 0.369447847 53 -1.131320070 0.391193488 54 0.118938515 1.308649047 55 0.258287801 2.530872290 56 1.383218481 -0.541165840 57 -0.773635331 -0.534322111 58 -0.431498456 0.657852457 59 0.020385446 -0.141414714 60 -0.743186941 0.424286728 61 -0.491060104 -0.147487506 62 1.439709489 0.876864526 63 1.200559991 -0.463592232 64 -0.491830171 0.377703821 65 0.952866322 -0.844541845 66 1.408877815 -0.518252450 67 -0.540373424 -0.116320967 68 -0.042834278 0.082649531 69 1.888782423 -0.524107254 70 -0.285391812 0.255969049 71 0.858568646 -1.388168873 72 0.464408321 -0.341628552 73 0.198002310 0.081031394 74 -2.344818659 0.309832282 75 2.112141932 1.479715712 76 -0.096798012 0.177912741 77 0.219261827 -0.590465940 78 0.811109334 -0.026801475 79 0.841420671 1.880939919 80 2.252856821 0.148042957 81 -2.108498986 -0.931165923 82 1.351163041 1.011560688 83 0.738578678 -1.689838691 84 0.103051081 0.494349438 85 0.579589602 0.192332902 86 1.346632009 -0.475916229 87 0.447752144 -0.944426506 88 0.520414442 0.197212313 89 -0.670008858 -0.843620858 90 -0.145970022 1.011416611 91 0.220631013 -0.737252563 92 0.928411828 1.877679339 93 0.327501120 -1.241670467 94 0.478850465 1.256214063 95 0.540369592 -1.167131562 96 -0.575402382 -3.021348760 97 -0.072363308 0.433204060 98 0.212382789 0.585100830 99 0.346932366 -0.873282340 100 -0.124909665 0.512096239 101 0.162605112 -0.760856326 102 0.361889972 0.341774444 103 0.090052797 0.800563760 104 -0.226044887 -0.111155479 105 1.746555919 1.020238473 106 -1.835907013 -0.203028463 107 0.543561856 0.642994509 108 0.546321161 0.337432285 109 -0.069449269 1.418528362 110 -2.156511400 1.272138859 111 0.237850014 0.023211938 112 -2.486933019 0.881109928 113 -1.033222385 0.653634576 114 1.864823575 2.073447603 115 -1.331369376 -0.277418079 116 1.223274192 -0.945703783 117 -0.198141738 1.045033463 118 1.225383808 -1.044163211 119 0.176262379 1.158075382 120 0.581392089 -0.768356256 121 1.312108044 0.354862424 122 0.431659204 -0.325124163 123 1.909336269 0.468715894 124 1.011521018 0.053493936 125 -0.092619929 -0.021837207 126 2.337273217 1.057678689 127 -0.687172394 -0.214085939 128 0.218856210 1.768971321 129 -0.018648949 0.759933344 130 1.963061339 0.357200551 131 -0.502110908 0.513600873 132 0.413432268 -0.913854891 133 -1.794000883 -0.752859496 134 -1.481003827 -0.257137836 135 0.563890949 -0.556250245 136 -1.025865763 0.250507429 137 1.004342340 -0.542467752 138 -0.774804379 0.834865133 139 0.752093328 1.635319939 140 -0.037469467 0.084441345 141 0.401513344 0.176992787 142 0.025394714 0.108455297 143 0.333949757 0.246935063 144 0.779496786 0.321942577 145 -1.217815953 1.250038632 146 0.313712821 0.485361651 147 1.225288861 0.038517726 148 0.043427786 1.057259978 149 -0.161371287 -0.932605592 150 0.569458881 0.128079113 151 -0.909618301 0.188436724 152 -1.266737414 -0.465408795 153 0.837889571 1.881790426 154 -1.481003827 -0.257137836 155 0.711908006 0.316348668 156 0.115489667 -1.812381726 157 -0.187108721 0.333281997 158 0.358895898 0.773076017 159 0.799631400 0.469848500 160 -0.563491772 1.267263106 161 0.582891973 0.069327826 162 0.681429858 -0.529016710 163 0.968401460 0.293410784 164 1.230781397 1.455382282 165 0.326556992 1.171129804 166 0.857689545 0.523526534 167 0.786356887 0.492909226 168 -0.218747914 0.998651208 169 1.332213661 0.773854949 170 0.176166604 -0.150609883 171 1.288081275 0.465666351 172 1.064083994 0.558914577 173 -0.528828944 0.953272350 174 0.036601452 0.679558487 175 0.297569254 0.769314807 176 2.008498278 -0.572349294 177 0.011108925 -0.540137959 178 0.517898026 0.655206806 179 -1.406459901 -0.866526034 180 0.936742960 1.393100121 181 -0.031432372 -0.111721668 182 0.172863072 -1.323837834 183 0.954310879 0.433297581 184 0.171862286 0.677436862 185 0.328259910 1.685524289 186 1.562290357 1.213454858 187 -0.023450250 -0.055502640 188 -1.755921128 2.019321932 189 1.527695880 0.482785027 190 0.211681927 0.878610037 191 0.422039103 1.262116646 192 1.706392372 1.140146899 193 -1.138121494 0.635968694 194 -1.481003827 -0.257137836 195 0.757824235 -0.782229287 196 1.285344050 0.547465328 197 -0.091245782 -0.765672128 198 0.503462410 0.216546166 199 2.179460115 -2.242879245 200 -0.234402275 -3.701015626 201 1.864823575 2.073447603 202 -0.366690505 0.264968533 203 -0.070460822 -0.588525697 204 1.436893087 0.302643584 205 -0.122300376 -1.579253770 206 -0.020068905 1.110684583 207 -0.421034562 -0.961355955 208 -0.865922703 -0.366571218 209 -1.528462634 -0.205697026 210 -0.400687632 0.055042727 211 0.755144543 0.638357522 212 1.036562544 -0.077185491 213 -1.194214115 0.581147418 214 0.576165359 0.782013822 215 0.330237992 -0.058884883 216 0.013710858 0.709660742 217 -0.820802557 0.230400758 218 -2.490308275 0.910310453 219 -0.638831407 -1.137357437 220 -0.842707681 -0.656401568 221 -0.299926597 -3.478894386 222 -2.053976830 -0.165766675 223 -1.795287696 -0.207433312 224 -1.656135783 -0.295904878 225 -0.426737057 0.834292569 226 -0.017085227 0.009231165 227 0.897995194 0.713454600 228 -1.797028030 -0.299341345 229 -0.129791006 -1.038254380 230 -0.807234835 -0.682815070 231 -2.067608282 0.386391343 232 0.118955346 -0.403900813 233 0.224667353 -0.147069356 234 -0.024450019 -0.594584061 235 -0.626156028 -1.269627954 236 -1.547661836 1.527271981 237 -0.722333940 -0.199112879 238 0.536410341 -1.285060117 239 -0.957500892 -0.038335287 240 -0.316552441 0.115708505 241 0.286909315 -0.039285767 242 -2.367102301 0.429892196 243 0.378979651 0.555966184 244 1.144387438 -1.071400091 245 -1.419131077 -0.480194419 246 -0.835383993 1.168266785 247 0.018417111 0.238135886 248 -0.997218365 -0.514066350 249 1.243359375 -0.932668694 250 -0.223896424 0.850294488 251 0.562481987 -0.547587686 252 1.665460343 1.495610295 253 1.206280591 -1.092737411 254 0.012351494 0.820574776 255 -0.911333428 -0.346520038 256 0.705947528 0.029600310 257 -0.276463596 0.074683234 258 -0.726071080 -0.213269573 259 -0.905918612 -0.220841159 260 -1.359160230 -0.754197796 261 1.329208062 -1.319883190 262 -0.357882256 0.367373840 263 0.878879408 -1.716879995 264 -1.144670048 0.993700779 265 -0.232690663 1.350618029 266 1.627623267 -2.461089226 267 0.498471738 -0.476390214 268 0.898231263 2.009974741 269 -1.374105828 -1.025583749 270 -1.145424815 -0.343168409 271 1.097366563 1.018006648 272 0.349661426 0.535936948 273 -0.160000361 1.393546704 274 0.409346289 0.829822075 275 -1.554967501 -0.465555760 276 -0.490475966 0.975546978 277 1.012431559 1.799019928 278 -0.228112333 0.977473564 279 0.192928942 -2.568954539 280 1.335419723 0.710712670 281 0.044249587 -0.126617713 282 1.505081978 -0.547972022 283 0.260886621 -0.210785441 284 0.879130457 0.020940035 285 -1.448605780 0.022609481 286 1.346373666 -1.768711270 287 -1.481003827 -0.257137836 288 1.462145102 -1.054038300 289 0.345692215 -0.165452731 290 0.139318172 -2.685406540 291 -0.378596550 -0.273687336 292 -0.037727335 0.885149495 293 0.726373153 1.622179198 294 1.528536410 0.005340231 295 -1.733213697 -0.997733815 296 0.428394787 -0.940362760 297 0.529111945 -1.394275848 298 -0.072308821 -1.202789569 299 -0.348828788 0.798890358 300 2.097148204 0.285640647 301 -1.948515104 -0.510309728 302 0.825167718 0.572992120 303 -1.060982311 -1.693591120 304 0.314291514 0.357096799 305 0.405840687 1.234789526 306 1.111103407 -0.639866898 307 1.883453727 -0.596435620 308 -0.973188492 -0.219421699 309 -0.308544049 0.126763947 310 0.457230561 -1.469277055 311 -1.109547325 -1.006969729 312 -0.052133352 0.552150629 313 -3.587982570 -0.288844986 314 -0.440250216 1.108742849 315 -0.424494878 0.258788030 316 1.314458149 -0.440477802 317 -1.947394779 -0.364829383 318 0.040735301 0.974782077 319 -1.095591714 -0.314057553 320 -0.258889235 0.800892304 321 0.281279670 0.022104459 322 -0.117531897 -0.444860061 323 0.100271788 0.589553588 324 -0.036835134 -0.355820680 325 -0.710929603 0.650029567 326 -1.084599004 -0.640194270 327 -0.821209164 -0.792071376 328 0.031699417 1.572746389 329 -0.706882983 -0.187978294 330 0.515348175 -2.613535910 331 0.495352742 -1.101296307 332 0.404729230 0.998671952 333 -0.532809947 0.331911788 334 -1.198263439 0.453268560 335 -0.214567927 -0.134541194 336 1.358315790 -0.140269038 337 0.186265782 1.276252079 338 -0.730746710 0.730933931 339 -2.221552737 0.632148885 340 -1.039826482 0.004456163 341 1.000803331 -0.796798819 342 0.892947572 1.028231586 343 -0.528593859 0.567660318 344 -0.890969952 -0.439868552 345 1.453741614 0.232684016 346 -0.643106301 -1.056184725 347 0.665163105 1.046224142 348 -0.460588318 0.035776848 349 -0.892793938 0.019247773 350 -0.532027981 -0.498596070 351 -1.407831139 -1.493213552 352 1.651074925 -0.697292103 353 -0.705318014 -0.651975263 354 1.028384166 0.953851278 355 -1.440613036 1.842878606 356 1.082288943 1.178564235 357 1.162829874 -2.523762142 358 -1.112488942 0.385607180 359 -0.027688461 1.087573977 360 0.994989047 -0.031452337 361 -0.972868056 -0.991221247 362 -0.499543603 -0.088662113 363 0.829389085 -0.294370958 364 -1.708891832 -0.587896650 365 0.318589742 0.879452907 366 -1.180666860 0.301051358 367 -1.549289195 0.688848163 368 -0.561371038 0.129432135 369 -1.330177378 0.217835826 370 -0.272241491 -0.313646069 371 -0.457666301 -0.623319597 372 -0.777971906 0.285325704 373 -1.113218831 -0.856702532 374 -1.138284183 0.799946617 375 -0.722634537 -1.008655909 376 -0.159166207 0.079868401 377 -0.880982081 -0.238045266 378 -0.479689369 -1.466782924 379 -1.812580081 0.326861472 380 -0.919672262 0.339315136 381 0.692407451 -3.615167095 382 -2.133235149 -0.084970789 383 -0.567839639 -0.524769397 384 -0.081145169 -2.162807827 385 -0.550655477 -0.482740612 386 0.369181509 -0.186877271 387 -0.760217754 0.619479141 > postscript(file="/var/wessaorg/rcomp/tmp/14n2g1337361767.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/2hw391337361767.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/3zrzc1337361767.tab") > > try(system("convert tmp/14n2g1337361767.ps tmp/14n2g1337361767.png",intern=TRUE)) character(0) > try(system("convert tmp/2hw391337361767.ps tmp/2hw391337361767.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.996 0.189 1.180