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 = 'prep' > par2 = 'all' > par1 = '3' > par5 <- 'Learning Activities' > par4 <- 'all' > par3 <- 'prep' > par2 <- 'all' > par1 <- '3' > #'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 RC3 h2 u2 BC 0.19 0.70 0.34 0.64 0.363 NNZFG -0.04 0.81 0.18 0.69 0.308 MRT 0.14 0.69 -0.10 0.51 0.491 AFL 0.93 0.02 0.08 0.87 0.132 LPM 0.96 0.03 0.16 0.94 0.058 LPC 0.78 0.27 0.14 0.71 0.295 W 0.13 0.09 0.85 0.74 0.257 WPA 0.14 0.12 0.82 0.71 0.295 RC1 RC2 RC3 SS loadings 2.48 1.72 1.60 Proportion Var 0.31 0.22 0.20 Cumulative Var 0.31 0.53 0.73 Test of the hypothesis that 3 factors are sufficient. The degrees of freedom for the null model are 28 and the objective function was 3.62 The degrees of freedom for the model are 7 and the objective function was 0.86 The number of observations was 283 with Chi Square = 236.51 with prob < 2.1e-47 Fit based upon off diagonal values = 0.92> fs <- factor.scores(y,fit) > fs RC1 RC2 RC3 1 0.167699859 -0.0716410633 0.275531142 2 1.917417812 1.1309173027 -0.704168566 3 0.313005442 0.6565665691 0.113820760 4 -0.769483192 -0.7193881165 0.713945467 5 0.601257816 -0.3164146091 -0.426359909 6 1.045109121 -0.6591115302 -0.190317618 7 -0.728121122 0.4473305436 -0.355166636 8 -0.230664623 0.7024212473 -0.055855710 9 2.056383658 -0.5272912901 -0.629305476 10 1.344751661 2.4534881318 0.136774406 11 -0.626378160 1.6088184760 -0.866024388 12 -0.245889789 -0.8205559603 -0.192488749 13 -0.461888657 -0.7993477876 -0.181112712 14 0.335179751 2.1016683885 -1.324565932 15 -1.056890068 0.2715082827 0.916348850 16 0.751540842 0.3342435442 -0.294229100 17 -0.001658206 1.8525572185 -1.000453931 18 0.820188492 -0.6854352991 -0.227604289 19 -0.937663597 0.5768442942 -0.451567951 20 -0.619730014 0.6943879294 -0.088559315 21 -0.862707325 0.6277332759 0.253824936 22 0.130504912 0.5275678427 -0.202592114 23 -0.127526171 1.2467412022 0.601595086 24 -0.119298278 1.6535232911 -0.471044953 25 0.406058736 2.6900688471 -1.133680854 26 0.108082855 0.6280129781 -0.151663107 27 0.375503067 0.0002341026 0.419430911 28 -0.170182937 1.5721956174 0.378488015 29 0.228261075 0.3468393690 0.524022975 30 0.084464255 1.1672103131 0.755555741 31 -0.159389019 -0.1698085780 0.189963769 32 1.137854902 0.4565138158 0.946180344 33 -0.995672565 1.6366391837 0.545756933 34 0.112846521 0.3379506373 0.792724376 35 0.594125511 -2.3736936259 -0.358134607 36 -0.521246675 1.0695774751 -1.117518153 37 -0.128559264 0.6502387307 0.463495168 38 -0.926602050 -0.5359267592 0.556466848 39 5.991460411 -2.0421933101 0.244758447 40 1.231683026 -0.3541586954 0.511149439 41 -0.103276770 0.2789195077 0.424378181 42 -0.036818182 0.0412080765 -0.093449867 43 0.196956238 1.8891379697 -0.811721681 44 0.360709539 -0.3780428331 -0.205481424 45 2.423577703 -1.5706773193 -0.572591217 46 -0.749694921 0.2294290742 0.874483841 47 -0.255462103 0.6745902403 -0.909345653 48 0.296722100 0.6622339783 -0.151117518 49 -0.549198109 1.4981934828 0.334243716 50 1.480162253 0.2090652788 -0.135990314 51 -0.139467002 2.0490249113 0.425111925 52 -0.190090445 -0.5667401119 -0.476241105 53 -0.845665134 1.3402870908 -0.193062493 54 -0.499612906 1.5141405455 0.250237041 55 1.475327428 1.0585462797 0.284823638 56 0.470643327 0.4604155210 -0.149681197 57 0.051535334 -0.4839560619 0.883826337 58 -0.109311163 -0.2838194176 -0.626370300 59 0.806485369 0.3884755837 0.254045960 60 0.638521339 2.2459548139 0.360085823 61 -0.249216322 0.1719408729 -0.288486702 62 -0.764188106 0.8648742924 0.887016846 63 0.162716662 -0.6044323935 -0.534274145 64 -0.039401229 1.2282140296 -0.639307310 65 -0.497533433 0.2626693497 0.696555654 66 0.186656538 0.8196063797 0.378969460 67 -0.821707888 1.3493996128 -1.612181802 68 -0.294260506 1.1303755231 -0.531029708 69 0.221789447 0.6212683181 0.340865080 70 2.537597223 0.3329121118 -0.161940283 71 -1.034009157 0.2557745161 0.509719722 72 0.737247716 1.6332724631 -1.012102280 73 -0.299586831 0.2240203656 -0.742054091 74 -0.806264459 1.3645913951 -0.413567901 75 -0.707645921 1.1379836131 -0.399808875 76 -1.130573239 0.6550138561 0.422776427 77 0.976325564 1.3884704281 -0.906815929 78 -0.263899179 1.0435490866 -0.438209487 79 0.918901872 1.6262225699 -0.901084049 80 -0.005797270 0.3733641384 -0.693876785 81 0.811620808 -0.0190155117 -0.213092996 82 1.944330481 2.0493933887 -0.231854320 83 -0.746487755 -0.2274159909 -0.296591361 84 0.318997593 -1.0038450484 -0.402517289 85 2.283606358 -1.1790822111 -0.615874777 86 0.084823633 0.2945466298 0.274215981 87 1.155775799 -0.8782390020 -0.478179986 88 1.846450028 -0.3113670873 0.508766050 89 0.726063091 0.4667503076 0.438288746 90 -0.375009597 0.2777711826 -0.786084034 91 1.887968102 -2.0926990197 -0.712860244 92 0.389149819 1.4191417594 -0.014806257 93 -0.845877517 -0.0755478997 0.660384239 94 -0.641716055 1.0040041925 -0.547388524 95 -0.637965602 0.4874792888 -0.338083506 96 0.113116805 -0.1912804076 -1.253475706 97 -0.762098297 -0.4234471951 -0.950414065 98 -0.736841223 0.8206840328 -0.147417209 99 1.825132524 -0.6165977230 0.359081208 100 -0.696934780 -1.0454870964 0.334264996 101 0.229545387 1.5935873832 -1.053183756 102 0.017032623 0.2764929942 -0.140340980 103 0.083144511 -0.5756031698 -1.203568384 104 0.180162893 -1.0697242931 -0.907242464 105 0.540800118 -0.7215884537 0.904026265 106 -0.894194855 0.6666976003 -0.351507271 107 -1.049811248 1.0049224402 0.518160080 108 0.143150999 1.4320578980 -0.901866627 109 0.953062627 0.2714780482 -0.560881443 110 -0.481713583 0.6175557654 -0.965591159 111 -0.454219067 -0.8149792390 -0.329394864 112 -0.147725073 -0.0721643308 -1.141449529 113 -0.022415279 -1.2458241426 -0.423589301 114 -0.205776170 1.2365325848 -0.061243424 115 -0.453534113 2.0769439841 -0.323616248 116 -0.744109852 0.4536891998 -0.551782893 117 0.111313326 0.0858855096 -0.847814844 118 -0.524511416 -0.4041013701 -0.347058164 119 -0.525281605 -0.6170014671 0.139173773 120 0.316312664 0.3796810395 -0.770022484 121 -0.769223224 -1.5434708711 -0.895399137 122 -0.454423119 0.8290565506 0.511888628 123 5.239332531 -1.9456577282 -1.605963032 124 0.518771329 -0.8146751247 -0.123420145 125 -1.223264950 0.3795549204 0.151311863 126 -0.256458534 1.3609829197 0.947678769 127 -0.961121921 -0.2735727906 -0.421466610 128 -0.722892138 0.1102766283 0.230750593 129 2.915739124 0.0417671523 -0.943501083 130 -0.500907782 -1.1799774740 -0.335264652 131 0.711112471 -0.3437599888 0.188286716 132 -0.405751011 0.9783223544 -1.050051251 133 1.596981369 -1.6071827931 -0.541729313 134 -0.372098495 -0.0525967663 0.499214250 135 0.037703033 1.8551421768 -0.346599005 136 -0.583059902 1.0506039140 -0.692603311 137 -0.638618428 -0.3900186992 0.667622365 138 -0.009697535 0.6205160870 -0.857688006 139 -0.655341651 -0.0179678296 0.231398252 140 -0.528111460 -1.6031598533 0.019183194 141 -0.500537740 0.1588097099 0.002487086 142 -0.304584777 -0.6817593345 -0.494476129 143 -0.524307967 0.1575298439 0.336309494 144 -0.527655365 -1.3330026743 -0.036457909 145 -0.453916223 0.1157454149 -0.524509744 146 -0.560542686 -0.6399758504 0.042816634 147 1.988137504 0.2690378319 1.639951820 148 -0.862322537 -0.7561126917 0.453073012 149 -0.493467774 -0.0488270396 0.608515871 150 -0.880029641 -0.3757195111 0.982993966 151 0.729632204 -2.3675993942 -0.104474064 152 -0.185412197 -0.1063540979 -0.028835071 153 -0.899368468 -0.3524207758 1.414673144 154 -1.169408585 -0.6892080663 0.358097839 155 -0.816751215 -0.4794110305 0.074110658 156 1.981256042 -0.2602186440 0.558831570 157 2.638946099 1.4326192818 -0.870674660 158 -0.806183998 -0.8192097728 -1.798281618 159 1.193563065 -0.2859676978 5.361781258 160 -0.565279679 -0.3298835883 0.134368773 161 -0.893194826 -0.6388255142 0.626117403 162 -0.178821418 0.1816704941 0.178886085 163 -0.941290558 -1.1327751901 2.656331143 164 -0.568097158 -0.6991314537 -1.024933621 165 -0.384163999 0.6280463745 0.463139316 166 0.685161316 -0.5657048436 2.167399213 167 0.364141570 -1.0566924060 1.741171289 168 0.023843770 0.8440742756 -0.287474069 169 0.264184276 0.0845931348 1.363825520 170 -0.868476226 -0.1571533603 0.084350626 171 -0.858244524 -1.6786992914 -0.428413495 172 -0.787920584 -1.1169757010 -0.487852339 173 0.008751302 -1.0581122841 0.791894180 174 -0.740393243 0.2033570348 -0.859635687 175 -0.417341308 0.4340911568 0.111500455 176 -0.956258572 -0.3803703551 0.295082251 177 -0.670627370 -0.4758934818 -0.447716671 178 -0.864001658 -0.7628348267 0.017661495 179 -0.121550329 -1.3869123873 -0.680329610 180 -0.244794864 -1.0530176742 0.731680422 181 -0.435284573 -1.5084910124 -0.870959578 182 0.844307210 -0.4910889282 1.747836965 183 0.844050371 -1.6238559802 -0.290519002 184 -0.441334946 -0.1020410219 1.976653820 185 -0.428957916 -0.0615010276 -1.000354448 186 -0.421834537 -1.9348895907 -2.233783274 187 -0.956782905 -1.4122072783 -1.165056412 188 0.162256386 0.4201445205 -0.796016725 189 -1.452300654 -2.3597766369 -1.848349745 190 -0.913412884 -1.5568491871 1.069425727 191 -0.846123623 0.4637570632 0.631030528 192 -0.751967957 -0.5856470316 0.080094655 193 -1.443379182 -2.5176812718 -1.886135515 194 5.290197106 -0.9287551794 0.458207027 195 -1.040774360 0.2739000072 1.028282900 196 -0.931809381 -0.3378086740 0.872372602 197 -0.913975966 -0.1458848390 2.001252922 198 0.095690147 -0.4010560871 0.138401834 199 -0.160175640 0.0234165723 -1.032298741 200 0.017886829 -1.8333940782 -0.425588220 201 0.040065781 -0.2815524917 3.194391365 202 0.282756312 -1.3054844210 -0.080598882 203 -0.582717023 1.9796859783 -1.216634754 204 -0.414486039 0.6116795947 0.604913597 205 -0.780207482 -0.2484814351 0.809503507 206 -0.640590227 -0.4128185520 -0.742681189 207 0.156625458 0.5288114572 -1.331720949 208 0.085831435 0.4413484095 0.124812383 209 -0.336491115 -1.1333559883 5.645187250 210 0.929895058 0.4187832074 1.682937720 211 -0.636581570 0.1072847760 0.159299939 212 -0.419515131 -2.1577829760 -0.262909273 213 2.181654934 0.1688871461 -0.818359797 214 0.250678094 0.1579806840 0.028334333 215 0.690231660 -0.3290105568 0.187533863 216 2.195711827 -0.9317751327 -2.726140849 217 1.745107050 0.9661619196 -0.438497073 218 -0.257458164 -0.6728280073 -0.883811567 219 -0.359499517 0.0657180915 0.601783046 220 -0.124472502 0.2675776032 -0.973684474 221 -0.244734640 0.2268659666 0.193669110 222 1.555237865 0.9876596971 0.280303849 223 -0.671544678 -0.2531371874 0.008469423 224 -0.410567335 -0.3171561353 1.404393059 225 -0.068443189 0.3998744431 -1.046276167 226 -0.526431604 -1.4418381405 -0.932508402 227 -0.997370402 -1.5970976785 -0.188441298 228 -0.392460376 -0.2925749540 0.738585125 229 0.186966553 0.0316119972 0.726395489 230 0.393321164 -0.7724888878 1.834962986 231 0.036668233 0.3091014006 1.703418012 232 -1.181473953 0.4084879262 -0.264005864 233 -0.895444133 -0.6711223342 -0.028002391 234 -0.657384463 -0.4407307161 -0.285787115 235 -0.516416857 -0.1826591616 0.752475745 236 -0.410102685 0.3037903742 0.411245044 237 -0.143337854 0.1495909303 3.647670810 238 -0.498384218 0.6417849986 -0.901824699 239 -0.132323663 1.0635723210 0.005628407 240 -0.456324899 0.4967967847 -0.041153732 241 -0.281198341 -0.2903440166 0.605184042 242 -0.486997154 -0.5460668100 2.930741850 243 1.026100349 0.6537355012 -0.430412543 244 -0.323967799 -0.2281903047 0.227063040 245 0.825768657 1.0881714868 1.079949522 246 -0.606792805 -0.1982494611 0.153419619 247 0.232467694 0.1654808185 0.328125524 248 1.801497106 0.0580052878 1.574253512 249 -0.360428600 -0.9082520364 0.911795487 250 0.894557576 1.0881686446 -0.001611100 251 0.557389774 -0.0408153137 -0.999923388 252 -0.722152638 0.8769652111 0.073460383 253 0.152435288 0.3937249406 0.658428517 254 -0.448387854 -0.6465485071 0.261548925 255 -0.330607363 -0.9382669087 -0.569907578 256 0.910552474 -0.2921231484 0.099373719 257 -0.744860257 0.6132244363 0.029471715 258 1.120507824 0.2592008790 2.024117159 259 0.043999883 0.2590671266 -0.982929118 260 0.442363793 1.3868312540 -0.400043883 261 -0.230522301 -0.8296248415 -0.455774825 262 -0.236476068 -1.0713769486 -0.865647952 263 -1.437927171 -2.6141785487 -1.909226819 264 -0.493877449 0.5860550972 0.345613679 265 -0.425076294 -1.0439699707 1.669894276 266 -0.780233145 -0.8863367650 0.059811644 267 -1.020432184 -0.3695966339 -0.204513093 268 -0.126357004 0.4378784485 -0.223007307 269 -0.134324793 0.4253095877 0.572752042 270 0.799224547 -1.1214438483 1.499500445 271 -0.692032945 -0.6176518087 0.127942565 272 0.520273364 0.2513155655 0.686279768 273 -0.671949111 -0.5044644419 -0.627573666 274 -0.393419217 1.0344486312 0.817125795 275 -0.386489439 -1.5528384747 -2.347876215 276 0.116873157 1.5172155880 -0.792343573 277 -1.025246852 -0.7100499039 0.254184165 278 -0.630288111 1.0574156308 -1.916168363 279 -0.326032650 0.2449377232 -0.813161503 280 -0.949944051 -2.5335061532 -0.270960879 281 -0.223915837 -0.4994360495 -0.020784979 282 -0.008109974 -0.1186757977 -0.955285926 283 -1.437927171 -2.6141785487 -1.909226819 > postscript(file="/var/wessaorg/rcomp/tmp/1fa6c1337760135.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/2mg881337760135.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/32tqc1337760135.tab") > > try(system("convert tmp/1fa6c1337760135.ps tmp/1fa6c1337760135.png",intern=TRUE)) character(0) > try(system("convert tmp/2mg881337760135.ps tmp/2mg881337760135.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.924 0.180 1.099