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 = 'male' > par1 = '2' > par5 <- 'Learning Activities' > par4 <- 'all' > par3 <- 'all' > par2 <- 'male' > 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.29 0.72 0.60 0.398 NNZFG 0.15 0.64 0.43 0.568 MRT 0.32 0.34 0.21 0.787 AFL 0.92 0.20 0.89 0.114 LPM 0.94 0.19 0.92 0.078 LPC 0.80 0.26 0.71 0.295 W 0.18 0.73 0.56 0.436 WPA 0.13 0.70 0.51 0.486 RC1 RC2 SS loadings 2.63 2.21 Proportion Var 0.33 0.28 Cumulative Var 0.33 0.60 Test of the hypothesis that 2 factors are sufficient. The degrees of freedom for the null model are 28 and the objective function was 4.1 The degrees of freedom for the model are 13 and the objective function was 0.76 The number of observations was 304 with Chi Square = 226.51 with prob < 4.7e-41 Fit based upon off diagonal values = 0.93> fs <- factor.scores(y,fit) > fs RC1 RC2 1 3.25892153 -0.0178001167 2 1.29419240 -0.3194782787 3 0.26341133 0.7163961031 4 3.46286927 -1.1696985867 5 2.46646023 1.7176443020 6 -0.21656585 0.7650211046 7 -1.04618633 1.4889713157 8 1.62894682 0.0258831797 9 1.61765453 -0.5529686441 10 -0.26851797 0.7687318549 11 0.51236750 0.9629708512 12 0.59209682 1.6745705186 13 -0.84305585 2.0450079224 14 0.60704655 1.1638213344 15 1.14079775 -1.7104276101 16 -0.06446662 0.1738637050 17 0.31173556 1.1521766830 18 -0.90430850 0.6621184212 19 0.28338223 0.0116812589 20 0.85592300 0.6202691419 21 -0.61363497 1.2306808147 22 -0.14063625 1.6149840220 23 1.22449814 0.3347220803 24 0.32614467 -0.3285921914 25 1.61769116 0.5871478306 26 1.47453660 1.9249929377 27 0.17735947 0.2214865092 28 -0.57414570 1.7570543540 29 0.68218313 -0.5111990201 30 0.79315532 1.0792732706 31 0.81035407 0.9506631322 32 4.03666655 -0.1617082701 33 -0.95492898 1.1208653498 34 0.18616189 -0.1415377332 35 -0.54205181 1.0579154901 36 -0.36656696 0.8484928097 37 2.04596703 0.2007824552 38 0.55629712 -0.0179660335 39 1.69388165 -0.1341664065 40 -0.52170930 0.0718705579 41 0.59559236 0.6855502877 42 2.09900551 -0.9173701450 43 2.97647805 0.1067122793 44 1.47752612 0.8329806421 45 0.00313119 -0.0289303485 46 3.04829350 -2.0796922596 47 -0.80920220 1.0582205852 48 -0.39162517 0.5444229364 49 -0.61417678 -0.4943531547 50 -0.50329142 0.9255137952 51 2.97092934 -0.2261678972 52 1.02372455 0.3864371013 53 0.52582528 0.3886694559 54 0.62555931 -1.0288543592 55 0.70198165 -1.1193049280 56 1.12465324 0.5184902519 57 -0.97105289 1.6367174459 58 0.86225694 0.4368480643 59 -0.02746229 -0.0313348843 60 -0.17164283 -0.3726557768 61 0.37458167 -0.6704180760 62 0.38603151 -0.8000790789 63 0.24025721 1.1423320774 64 -0.46054958 0.3086792677 65 0.74049339 -0.3553463945 66 -0.29575906 -0.0613113769 67 -0.34764679 0.1793717698 68 -0.60677180 -1.2642510761 69 -0.12931093 1.3503141271 70 1.12721538 -0.4033481134 71 -1.11663854 0.8900594777 72 0.17661283 1.9921085061 73 -0.82256157 -0.0174968585 74 -0.44772391 0.6611951878 75 -0.20217486 -0.6660489001 76 1.51907956 0.0004630631 77 0.13114340 0.1134580237 78 2.72480053 -1.6327528224 79 0.02439421 0.6852391756 80 0.74991258 1.1356997272 81 -0.16546273 0.5233051901 82 0.50881949 -0.6945357298 83 -0.06875916 -0.2836815628 84 -0.68548397 0.1569407123 85 -0.97383423 0.5225468196 86 -1.27670257 -0.1481078738 87 0.77890217 0.3314793377 88 -0.56402737 0.1170512196 89 -0.49020389 -0.6423757169 90 -0.82335180 0.1849098324 91 -0.63426556 0.0547902094 92 -0.55228382 0.0169876222 93 -0.35351502 0.2006954342 94 -0.03845836 -0.6528070441 95 0.96284092 -0.5062062242 96 -1.08225069 -0.8244071690 97 -0.11542745 0.3931369426 98 1.16368394 -0.2293315642 99 0.12693414 -0.2921474738 100 -0.01587208 -0.1685836407 101 -0.93688756 -0.6214309114 102 -0.91996498 -0.3414890460 103 -1.06429587 -0.5005843835 104 0.98572133 -1.3281253873 105 -0.70280242 -0.1886527432 106 -0.79593099 -0.1291784316 107 -0.40878552 -0.3074196414 108 -0.08040277 -0.1602080958 109 -0.29552054 -1.6605221496 110 -0.40565482 1.1647453353 111 0.33096831 -1.3148863956 112 -0.28745820 0.4920231119 113 0.15555145 -0.8538877916 114 -1.06755060 -0.2486664213 115 -0.34656599 0.4589314517 116 2.47383076 0.0049258331 117 -0.52507156 0.7170403205 118 -1.18414903 0.4743202731 119 0.33518477 -1.0725958113 120 0.47382341 -0.8375691972 121 0.14577168 0.5181463703 122 -0.58721200 -1.3577650445 123 -0.81013121 0.2391277908 124 -0.55012897 -0.5796400812 125 -1.04779555 0.0971934745 126 -0.86694765 0.3620774775 127 -0.08774124 0.4820713828 128 0.61966483 -0.3902567703 129 -0.93119337 -0.4814956471 130 0.55893910 0.2742325167 131 -0.20611938 -0.2743847758 132 0.36738150 0.1018753394 133 0.64747896 -0.2979409998 134 -0.69336763 0.5341349493 135 -0.57597121 1.2689502936 136 0.57840231 0.6551224338 137 0.60790180 0.2087685505 138 -1.11564880 0.6844875241 139 -1.04812183 -0.4734755640 140 -0.45345369 0.6269006546 141 -0.26554884 0.7047172836 142 -0.47919118 0.7511089762 143 -0.46037877 0.2667555822 144 -0.42738790 -0.2888244111 145 -0.41864681 0.1054985183 146 -0.77518845 -0.9720054670 147 -0.35103338 0.2784494586 148 -1.08152008 0.2398966915 149 -0.77503782 0.3272927188 150 -0.95946664 -0.6897255531 151 -0.44552321 0.7076535160 152 0.52050429 0.0214003750 153 -0.30857101 -0.6543040810 154 0.06018657 -0.4899309911 155 -0.27439702 -0.5207282073 156 -0.08524654 0.0141215631 157 -0.25312696 -0.0181334264 158 -0.73130927 0.3287257975 159 -0.79515980 1.0339259001 160 1.43347483 -1.5195267835 161 -0.87888506 1.4413554431 162 -1.20523541 0.4261721872 163 -0.66915416 0.2385006281 164 -0.56576986 -1.5062005859 165 1.96111154 3.9895976956 166 -0.25856703 0.2660780185 167 -0.84791444 0.6036209470 168 -0.30962921 -0.8483405216 169 -0.01625538 1.1473882959 170 1.33115834 1.4646162977 171 -0.66543126 -0.6179220014 172 -0.48257150 -0.0844127598 173 -0.15520826 0.8363233995 174 -0.86608370 0.4965683493 175 -0.41373416 -0.2454598949 176 -0.73264073 0.0007552692 177 -0.15719888 -1.2958829155 178 1.58050900 1.1584511230 179 1.60230532 -1.2023801019 180 -0.14908471 1.8425009639 181 -0.05778281 -0.4573998194 182 0.79840934 -0.1529975262 183 -1.64064997 -2.3048714521 184 -0.89873700 0.3025113562 185 -0.67549109 1.2786453679 186 -0.50772725 0.0758418580 187 -1.61947575 -2.4535862549 188 -0.94533059 1.4979027363 189 -0.82400615 0.9547619424 190 -0.95796789 2.0854867123 191 0.43612655 -1.2937595160 192 0.79287951 -0.6912608207 193 -0.40815189 -0.4016460342 194 -0.21037788 4.0224276818 195 -0.22000326 -1.2416333793 196 3.65079619 -0.8800478221 197 0.89648984 0.2828299061 198 1.41344984 0.0653799515 199 3.60939764 -3.0636618390 200 0.36294939 -0.2652778580 201 0.14395184 0.6644874743 202 -0.18412068 1.3326369855 203 0.43109223 -0.2407188060 204 -1.14787012 0.6713547973 205 -0.73796359 0.0036595957 206 -0.44168796 -0.0743603759 207 -0.07619296 0.8881898303 208 0.32254010 1.0465473326 209 -0.05774606 0.6355247349 210 -0.33171521 2.3688138476 211 -0.31450418 0.3717065540 212 0.83653067 0.5559501247 213 3.00638545 1.0486466939 214 -0.10735999 0.5117630190 215 1.38300746 -0.7601521948 216 -0.47318490 1.0828786544 217 0.64066407 1.0643368432 218 1.74323479 -0.0853274262 219 1.92511848 1.8286726096 220 -1.60653595 -2.5444675232 221 -0.18530067 1.0729363177 222 0.33484080 0.4430250525 223 0.30133769 1.0596956844 224 -0.48344445 0.1261914190 225 -0.46680417 -0.3586478650 226 -0.03168472 1.7139491602 227 0.78687708 0.5976896412 228 -1.00466709 0.2909829543 229 -0.99314992 -1.3195589104 230 0.16295538 -0.0346968675 231 0.49572331 -0.5409107025 232 -0.53606205 0.2535465605 233 -0.83099776 -0.5361040160 234 -0.36640312 -0.7779165489 235 -0.56812446 -0.0289929812 236 -0.74980904 -0.4617360006 237 0.55769560 0.2905557155 238 -0.36208546 -0.4407593746 239 -0.02963869 0.1327181810 240 0.37262933 0.6350008683 241 -0.40861911 -0.6902403912 242 -0.06410647 -1.1174865184 243 -0.13782491 -1.3290721690 244 0.28374133 0.9838492933 245 -0.76836949 0.1006303693 246 -0.35614109 0.2548155919 247 -0.83964111 0.0586221878 248 -0.16841427 0.2360940180 249 -0.92733153 0.5141647771 250 -0.56323298 -2.4059728434 251 -0.11975051 -0.3443349742 252 0.89218001 0.2860893155 253 -1.02335289 0.1031212159 254 -0.50284868 -0.4108089246 255 0.14094249 0.5082387201 256 0.69821594 -1.2813496005 257 -0.99630496 0.7225152874 258 -0.47739659 -1.9909209679 259 -0.87054751 -1.3882897733 260 1.96147842 -0.6871842405 261 0.05840766 -2.0924080670 262 -1.13401917 -0.8922488062 263 -0.48825573 -0.3108607978 264 -0.62519005 -0.4324622953 265 -0.34051601 -0.3958562586 266 -0.73320884 0.1813459040 267 1.37096897 0.5142354311 268 -0.39557355 -0.2529073732 269 0.02211964 -0.4433400516 270 -1.01859839 -0.5478715425 271 -0.86750447 -2.3012643872 272 -1.46169468 -1.3039922892 273 -0.51708686 -1.5904762498 274 -0.73673777 0.4580423256 275 -0.48009362 0.4133149949 276 -0.85996996 -0.9633621338 277 -1.27710595 2.1714322319 278 -1.15188300 -0.3225221242 279 -1.01758989 -1.5952400664 280 0.11678444 -2.2424236609 281 -0.38380401 -1.9254810697 282 -0.44258817 0.2436231360 283 -0.64777045 -0.5972292190 284 -0.78070846 -0.4458502440 285 -0.16506125 -1.0173121576 286 -0.99540647 -0.0407024437 287 0.97955278 -1.4276024240 288 -0.73769525 -0.0531265631 289 -1.12368311 0.0102545586 290 1.52218573 -0.0193631235 291 -0.56215502 0.1407928116 292 0.23941958 -0.5573379823 293 -0.46978012 -0.4341311863 294 -0.85086245 -1.0381449471 295 -1.60653595 -2.5444675232 296 -0.18342348 -0.2092494910 297 -0.54169858 0.7861635185 298 -0.50835857 -1.0069727286 299 -0.06208359 -1.1077789406 300 0.03967078 -2.6358395193 301 -1.17088599 -0.5889911206 302 -0.81586932 -0.1535368563 303 -1.29077464 -2.2567813850 304 -0.40193788 -0.5778461361 > postscript(file="/var/wessaorg/rcomp/tmp/104n71335787248.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/2ula51335787248.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/33ijb1335787248.tab") > > try(system("convert tmp/104n71335787248.ps tmp/104n71335787248.png",intern=TRUE)) character(0) > try(system("convert tmp/2ula51335787248.ps tmp/2ula51335787248.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.869 0.193 1.058