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 separate' > par4 = 'all' > par3 = 'all' > par2 = 'female' > par1 = '2' > par5 <- 'ATTLES separate' > 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 A11 0.56 -0.46 0.53 0.47 A12 0.03 0.73 0.53 0.47 A13 -0.04 0.41 0.17 0.83 A14 0.15 0.64 0.43 0.57 A15 0.70 -0.05 0.49 0.51 A16 0.60 -0.24 0.41 0.59 A17 0.37 0.27 0.21 0.79 A18 0.63 0.14 0.42 0.58 A19 0.55 0.32 0.40 0.60 A20 0.39 0.32 0.26 0.74 RC1 RC2 SS loadings 2.18 1.67 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 45 and the objective function was 1.01 The degrees of freedom for the model are 26 and the objective function was 0.42 The number of observations was 451 with Chi Square = 188.09 with prob < 1.6e-26 Fit based upon off diagonal values = 0.6> fs <- factor.scores(y,fit) > fs RC1 RC2 1 -1.125805646 -1.871597833 2 1.936035604 0.623323685 3 0.942873717 -0.629150373 4 -0.546841427 -1.312603017 5 0.240555935 0.130234147 6 -0.025420550 -1.589158288 7 0.453874216 -1.664382143 8 -0.452514433 0.312257056 9 0.242198229 -0.501918746 10 1.139517472 0.816526996 11 0.782809764 -1.095649428 12 0.408612387 -0.400098731 13 -0.847650607 -0.683608008 14 -0.836773179 0.133254356 15 0.364592580 0.069191911 16 0.438752080 -1.161262573 17 0.045880519 -1.216344623 18 1.197037490 -1.368756839 19 0.510484897 0.106089880 20 0.052830185 -1.029057076 21 -0.469856288 -0.250978720 22 -0.243861409 0.127956423 23 0.507562264 -1.333450436 24 0.753860504 0.370210720 25 -0.409064138 -0.948297640 26 0.661856251 -0.027543262 27 0.146505965 -0.775253819 28 1.100554700 -0.062437891 29 1.772155219 -0.988198174 30 0.683262631 -0.976653831 31 1.613702464 0.074711366 32 0.524938471 1.040284902 33 -0.137183918 -0.723283565 34 0.104306648 -0.240647636 35 1.067297742 -1.741815823 36 0.808696114 -0.352425986 37 -1.337873087 -0.583437739 38 0.164534189 -0.649647715 39 0.220175667 -0.839744060 40 0.502110042 0.169919227 41 -0.858322419 -2.179954489 42 0.879605660 0.144689022 43 0.150219154 -0.407570653 44 0.362219952 -0.045199689 45 0.516398821 -1.240495581 46 1.564795650 0.061549509 47 0.261062021 -0.967888338 48 -1.183885752 -1.148520508 49 -0.962077278 0.110825815 50 -0.581445080 0.177964327 51 0.391263924 -2.012717721 52 0.030150181 -1.091521396 53 -1.673581559 -1.507554033 54 -0.167656869 -0.783275400 55 -0.118922726 0.329373395 56 1.283189747 -0.600687207 57 0.680560811 -1.084846759 58 0.217727506 -0.740131528 59 0.300278336 -1.224996071 60 -1.626690552 -2.197744180 61 0.139246546 -0.257051906 62 -0.391975617 -0.205110499 63 0.705876058 -0.496833904 64 -0.577223866 -0.965076978 65 -1.340349100 -0.517652369 66 -0.157573503 -1.011584209 67 0.033266229 -0.932340551 68 0.629589709 -0.310437168 69 -1.047434960 -1.876647842 70 1.574681427 0.141203498 71 0.472140450 0.248365394 72 0.454697419 -0.895540052 73 0.178268445 -1.634685891 74 -0.298091442 -1.348169000 75 0.710180114 0.012843875 76 -0.799767949 -0.636589780 77 -0.427599458 -0.134901477 78 -1.423447958 1.075685408 79 -0.522370703 -1.074390235 80 -0.647224483 -1.497585421 81 0.201066098 0.555891680 82 -1.400380357 -0.771022572 83 -0.686557300 0.145945441 84 -0.206837138 -0.435785662 85 0.373992258 0.281049324 86 0.268396251 -0.608444846 87 0.418245994 -0.063140088 88 1.083128325 0.023777118 89 -0.104588905 -0.092963088 90 0.653368034 -0.647883924 91 0.739378579 0.372402672 92 0.297837281 -0.308190169 93 -1.514192063 -1.843345305 94 2.304441229 0.913922058 95 -0.614762446 -0.290261103 96 1.003708521 0.551320218 97 0.350375259 -0.894894734 98 1.007836913 -0.009560251 99 -0.593985870 -0.213629437 100 0.556945652 -0.552717478 101 0.294143133 -0.469771284 102 0.648021145 0.026557776 103 1.162434659 -0.460646806 104 1.286894342 -0.642976014 105 -0.075521994 0.569290016 106 0.360223868 -0.167390343 107 0.705876058 -0.496833904 108 -0.014101244 -1.737010692 109 0.675684933 -1.396109882 110 -1.366050832 -0.395536792 111 -1.240378177 -2.488382602 112 0.791588087 -0.561728464 113 0.474723899 -1.417929687 114 0.020202281 -1.271169676 115 -0.856730409 -0.958010823 116 -0.233495258 -0.287411374 117 1.213573695 -0.961039705 118 -3.468720086 -1.725081506 119 0.594642712 0.221916706 120 1.579683998 -1.524187899 121 0.839312381 -0.346018727 122 -0.772866362 -0.724951507 123 0.363037553 -1.173280493 124 -0.625882475 -2.291729905 125 0.722984086 -0.287531426 126 0.837531185 -1.421541714 127 -2.166215255 -1.834186234 128 0.188800035 -0.159036624 129 0.758281060 -0.506534629 130 -0.140777470 -0.340289014 131 0.492046247 -0.320809247 132 0.515253431 -0.957113561 133 0.268509720 -0.651564023 134 0.879605660 0.144689022 135 -0.937742223 -1.652411389 136 0.333942331 -0.755499652 137 0.261062021 -0.967888338 138 0.410320898 -0.564578193 139 0.713090652 -0.888068130 140 1.223258735 1.036358758 141 0.646811206 -0.144253867 142 -0.653526793 -2.097291755 143 -0.439960062 -1.072155122 144 1.045949598 -1.233671362 145 0.023717268 -0.096856144 146 -0.007607582 -2.240459404 147 0.338035310 1.148503337 148 0.938405908 0.758387583 149 0.648566969 -0.819525937 150 1.058544132 -0.171316487 151 0.918139110 -0.254709800 152 -0.650468980 -1.497144801 153 0.880341236 -1.950941369 154 1.557573399 -0.068098980 155 1.792321167 -0.906037928 156 1.270863277 -0.104463009 157 0.586423127 0.191336334 158 0.281311415 -0.192488038 159 1.231038544 -1.340697630 160 2.513706114 -0.069490021 161 0.878685718 0.614746868 162 0.440402356 -0.884775926 163 0.898469451 -0.321280569 164 1.084318757 0.728473423 165 0.960424290 -1.075019531 166 -0.032288445 -1.195257719 167 1.763541799 0.095201505 168 0.156814672 -0.089597616 169 2.935556434 1.097881286 170 1.135316580 -0.489916647 171 1.707395397 0.454113723 172 -1.442552183 -0.599685804 173 0.055811337 -0.148612308 174 1.594462128 0.548480013 175 -0.989687126 -1.684558851 176 0.420573581 -0.936826814 177 1.217538333 0.375295562 178 -0.484317076 -1.275077926 179 2.192524647 0.498166322 180 1.008051914 0.380985496 181 0.273283042 -1.241038359 182 0.989968597 -0.227652637 183 1.928544920 -2.057119134 184 -0.010622704 -0.268472001 185 0.393659490 0.731445015 186 -0.151883877 0.969690884 187 0.154356320 -0.137777984 188 1.093435471 -0.031335634 189 0.687012267 -0.030864313 190 -0.870539583 -0.123328865 191 1.079780551 -0.522894479 192 1.937426519 -0.976085954 193 0.729061309 -0.215428633 194 0.515597028 0.387461380 195 -0.539393007 -1.349903945 196 0.619450496 0.018692276 197 1.613711166 -0.242605848 198 0.876547739 0.271831255 199 0.473322645 -0.341939312 200 -0.110309306 -0.754026284 201 1.066592120 -0.383940016 202 -0.444144365 -0.225301397 203 0.050276905 1.014529431 204 1.002116511 -0.670623448 205 -0.036820726 -0.161945901 206 0.994528621 -0.499848106 207 -1.161531686 -2.544596868 208 0.980516987 -1.129735734 209 2.124991226 -0.388664065 210 1.056610427 0.192848620 211 1.156410498 0.635283726 212 -0.071038526 -0.693998149 213 1.323616256 -0.300621826 214 0.158927257 -1.353830089 215 1.103180804 0.149056540 216 2.790709262 -1.112814870 217 1.384975710 0.554169947 218 1.852004344 -0.237377565 219 0.302586308 -0.837508947 220 0.184053319 -0.619396555 221 0.698513363 -0.525744208 222 2.321469543 -0.834003760 223 0.581722913 0.950631459 224 0.900842079 -0.206888969 225 0.313436246 0.342622833 226 0.232061328 -1.162468011 227 0.221664401 -0.164912610 228 0.045523698 -0.627384219 229 0.296917339 0.161867677 230 -2.837317087 -0.637863269 231 0.810198219 -0.497479222 232 1.577569102 0.729723282 233 0.610154095 0.353947079 234 -1.340626138 0.795360880 235 -2.054118413 -0.763859270 236 0.593261069 0.535190349 237 -0.639535527 0.377622387 238 -1.059961049 -0.933471482 239 2.175151334 1.752414655 240 0.258932139 -0.668642135 241 1.870461781 0.009262142 242 0.862497632 -0.064613456 243 0.722064144 0.182526419 244 0.737646379 -0.362441338 245 0.270152014 -1.283716916 246 1.129596178 -1.150979844 247 1.847613844 -0.327218870 248 1.266653542 -1.008404340 249 -1.713242739 -0.938738930 250 1.117344380 0.442382074 251 1.065906827 -0.142406183 252 1.304752465 0.165347765 253 -1.145507922 1.873129485 254 -0.779537341 0.319069940 255 -0.145122493 0.322452204 256 -0.284922347 2.698683478 257 -1.216153838 0.376999651 258 0.489034158 -0.430150089 259 -1.732968957 0.782279152 260 0.575690516 0.751560980 261 -0.709508400 0.606230293 262 -1.115557485 0.244703188 263 0.827245954 1.528829544 264 -0.010216869 2.519975310 265 -0.490145022 0.391657774 266 -0.229970956 0.943248887 267 0.469269250 0.469264898 268 1.101878647 -0.399073297 269 0.807305200 1.246983653 270 -1.142761174 1.625522659 271 -0.616126640 0.865168056 272 -1.403296383 -0.423155381 273 -0.722548512 2.280375297 274 0.623643360 -0.187962054 275 -2.502528060 0.524121028 276 -0.101786955 1.299792221 277 -0.514250215 0.580310348 278 -1.692843715 1.227802278 279 0.833623905 1.187242560 280 0.245844520 1.129934007 281 0.017110069 0.582623609 282 0.807305200 1.246983653 283 -1.179261822 0.036636163 284 -3.065162157 0.780026396 285 -0.724411733 0.237302723 286 0.745240693 0.781248904 287 0.167466907 0.926950394 288 -1.763112832 0.110234859 289 -0.122883184 1.164270557 290 -0.531416478 0.811973980 291 -0.587771598 2.179991131 292 -1.142230592 -0.823563210 293 0.408573163 1.623791850 294 -1.441238967 0.118238055 295 -0.294373134 1.214143070 296 -0.994097343 -0.284394237 297 0.806149725 1.393307880 298 0.256632297 0.966160939 299 1.319887417 1.649055274 300 -0.343848880 0.141277015 301 -0.627066982 -0.711746491 302 -1.875942823 0.751713365 303 -0.344685988 1.803242483 304 -0.284922347 2.698683478 305 -2.149458123 1.248756367 306 0.489034158 -0.430150089 307 0.098169133 1.504255860 308 -1.966446494 -0.025976545 309 -0.497328763 0.662911214 310 -0.451583828 0.753375300 311 1.316199552 2.887124840 312 -0.718804801 0.941485096 313 -0.602557785 -0.766976626 314 -0.426125097 -1.041071062 315 -0.617061000 -0.850233566 316 -0.118531878 1.901180021 317 -0.753528207 1.075520935 318 -0.149287613 1.290222882 319 0.289037285 0.648507897 320 0.564977990 1.552019259 321 -0.200583271 0.926159583 322 0.697149169 0.629684952 323 -1.054803769 0.346713450 324 1.180533103 1.145139697 325 -1.041615338 0.207758987 326 -1.403296383 -0.423155381 327 -0.575481327 0.293186297 328 0.625057428 0.722874649 329 0.623643360 -0.187962054 330 -0.713561796 1.417434503 331 -1.282103015 0.918519402 332 -0.332016962 -1.590232340 333 -1.356346030 1.454338478 334 -0.592806101 -0.420109221 335 -0.828292622 0.970736597 336 -1.113558976 0.721093214 337 0.542626350 2.564270697 338 -0.378544541 0.298404910 339 -1.620111222 0.901916995 340 0.112405961 1.934457842 341 -2.483092446 -0.140263220 342 -1.135164425 -2.022698791 343 1.685783400 0.198089118 344 -0.530496536 0.341916134 345 -1.488317193 1.684885066 346 -0.333139131 1.070484159 347 -0.657825750 0.758624615 348 -1.132966381 0.534275585 349 0.008855895 1.431262256 350 1.181566514 0.631962675 351 -1.440076278 0.061818012 352 0.214781310 -0.769555764 353 -0.255223035 0.489361905 354 -1.523134560 0.590131126 355 -0.273429404 -2.356758235 356 -2.814036695 -0.595154568 357 -1.333674622 1.106830825 358 -0.322383609 -1.639635168 359 -0.432487953 -0.210132579 360 -0.831668821 0.160220865 361 0.172671976 1.232014845 362 0.113414195 0.056847234 363 0.160123972 0.750516898 364 -0.214240618 0.818425660 365 -1.248645574 0.293791389 366 -0.359427134 -0.155646949 367 0.150930702 0.519233260 368 0.074072529 0.904044652 369 -0.172361139 0.852251143 370 1.070351071 0.618196233 371 -0.168138181 -0.177342871 372 -0.844801405 0.198354693 373 -1.121551010 0.105606922 374 -0.955540205 0.953554705 375 -1.875041923 -0.796778043 376 -0.056847206 0.360443733 377 0.026874908 0.229131120 378 -1.224534097 0.766765203 379 -0.371689196 0.879956009 380 -1.300676202 0.327855159 381 -0.746165511 1.104431239 382 0.737659194 1.624385740 383 -0.192619096 0.174675741 384 -0.959496607 0.912220450 385 -0.770157350 0.644110850 386 -0.143479176 0.895396138 387 -0.456125066 0.845311349 388 -0.737365515 0.147733173 389 -0.668312584 0.389183113 390 0.122005542 0.110649456 391 1.045362269 1.249159218 392 -1.154565905 0.075163299 393 -0.663612369 -0.370112013 394 0.206084591 0.734254519 395 -1.153068321 1.680635411 396 -0.424446356 -1.095117602 397 0.259782831 0.474954833 398 -1.194461122 1.246166359 399 -0.963126350 1.237777339 400 0.149385759 -0.586181350 401 -0.218772217 1.354465264 402 -0.441096637 0.237787764 403 -0.246159762 0.617513807 404 -1.583994798 -1.603110230 405 -0.570063282 1.860345766 406 -1.873615237 -0.121973361 407 -1.272041646 1.793072799 408 -0.548599501 0.352347761 409 -1.125638463 0.132866523 410 -0.553093234 1.057876966 411 -1.079998258 0.643477418 412 -1.426335633 0.487165625 413 0.689638371 0.180630118 414 -0.775630104 2.214292641 415 -2.143536985 -0.007924910 416 -0.254207030 0.476512093 417 -2.371060191 -0.030016181 418 -0.983283851 0.451938408 419 -0.550511349 -0.301164239 420 0.204903002 -0.372944098 421 -0.155693806 1.840907654 422 0.280406566 1.504945599 423 -0.930878849 0.442237683 424 -1.380831274 -1.478525996 425 -0.773640411 1.664121801 426 -0.716982820 0.733886458 427 0.804434000 1.467883158 428 2.352895857 1.876176289 429 -0.990695105 0.579413228 430 0.586027689 1.106683995 431 0.108318539 0.584895023 432 -1.432995484 0.830044936 433 1.399193751 1.164631350 434 0.231027916 -0.649290988 435 -0.309218486 0.017887920 436 -0.845373228 0.396769349 437 -0.409631780 1.421349444 438 -1.056260900 1.478449658 439 -0.431751081 2.322424067 440 0.618921402 2.060556747 441 -0.207599338 0.898520269 442 -1.504928318 1.126811715 443 -0.299023887 0.701798947 444 -0.413764352 -0.189002514 445 0.030400955 1.573238673 446 -1.874883412 0.148181106 447 0.509422454 2.052926090 448 -0.270092077 -1.606216717 449 -0.450462022 -2.438744994 450 -0.968735027 0.420147674 451 -0.552996494 -0.181022970 > postscript(file="/var/wessaorg/rcomp/tmp/197an1335883807.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/21w5q1335883807.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/3cft21335883807.tab") > > try(system("convert tmp/197an1335883807.ps tmp/197an1335883807.png",intern=TRUE)) character(0) > try(system("convert tmp/21w5q1335883807.ps tmp/21w5q1335883807.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.021 0.248 1.261