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 = 'bachelor' > par2 = 'male' > par1 = '2' > par5 <- 'Learning Activities' > par4 <- 'all' > par3 <- 'bachelor' > 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.24 0.71 0.57 0.43 NNZFG 0.46 0.32 0.32 0.68 MRT 0.63 0.18 0.43 0.57 AFL 0.91 0.18 0.87 0.13 LPM 0.89 0.19 0.83 0.17 LPC 0.84 0.08 0.72 0.28 W 0.20 0.84 0.74 0.26 WPA 0.07 0.78 0.61 0.39 RC1 RC2 SS loadings 3.06 2.03 Proportion Var 0.38 0.25 Cumulative Var 0.38 0.64 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.53 The degrees of freedom for the model are 13 and the objective function was 1.1 The number of observations was 142 with Chi Square = 150.46 with prob < 1.7e-25 Fit based upon off diagonal values = 0.92> fs <- factor.scores(y,fit) > fs RC1 RC2 1 1.1736597654 -0.7940083132 2 0.6353148941 -0.4515412974 3 -0.2973230802 0.5283984028 4 -0.6543181721 0.9166096688 5 -1.2931386195 0.2955935676 6 1.8370838848 0.3207019875 7 0.1413911398 0.0340413613 8 -0.2309728022 -0.3902087237 9 -0.4602255443 0.6148628229 10 -0.1048387896 0.2385008728 11 0.0030826436 0.0046259623 12 0.6567925019 -0.1832709322 13 0.5924298122 -0.7241565847 14 1.9059409542 -0.4868701593 15 -1.2322279239 -0.2890909735 16 0.6339071777 0.4255324296 17 2.1277991199 0.0003935837 18 0.7971240344 -0.2000467823 19 0.7890030954 -0.3953867451 20 -0.6639003547 -0.5690953415 21 -0.5777493065 -0.3817015506 22 -0.9362863427 -0.2955190405 23 1.8743811279 -1.9248300314 24 -0.1345182648 -0.2978873221 25 -0.4603526090 -0.0163491167 26 0.0003244726 -0.2461212146 27 0.6210859747 -0.1624836270 28 -0.0635795715 -1.9108155989 29 0.1873879547 1.8373354078 30 0.6751836664 -1.1342833283 31 0.4641703141 0.4891496384 32 0.1002001546 0.1079392219 33 -0.9544686991 0.0033029904 34 0.3509557157 0.5196666817 35 3.9889643437 -0.1855718320 36 0.0888624816 1.1490880185 37 -0.7950917128 0.8192669505 38 0.9058122482 -1.2587140545 39 1.1901417483 -0.9848275004 40 1.0786265167 0.6337076121 41 -1.0550864351 -0.6958292814 42 -0.2424382719 0.1859270230 43 -0.3754315099 -0.3073008008 44 -0.8218501776 0.5743998164 45 -0.2720231860 0.4126656528 46 0.7418216449 0.5223319097 47 1.6129414576 -0.7534498013 48 -0.5978603935 -0.5947201653 49 1.5058494636 0.4803484495 50 0.4191312526 -0.4356015587 51 1.4579427050 -0.0327688423 52 1.7538307777 -0.7563378509 53 -0.1185186544 0.8778378681 54 0.0887919379 1.7883450193 55 1.3923789127 0.9321504973 56 1.6117832729 0.1858598404 57 -0.6908522199 1.0651140083 58 -0.8930184617 -0.3388348206 59 0.2196453926 0.9023895224 60 0.2620040537 1.4419332119 61 0.3507192409 0.7028688538 62 0.1181998454 0.5208804326 63 -0.0184290584 -0.1989702181 64 0.2723412030 0.0064238536 65 -0.7856752454 -0.6423993596 66 0.4446047585 0.1924111432 67 -0.6580374766 0.3220828531 68 -0.4092316860 0.8187097055 69 -0.9984958718 -0.3005702432 70 -0.4356170259 1.2115436585 71 -0.9475073575 0.3479149359 72 -0.1023382927 -0.4705090534 73 -0.3046937212 0.4049287234 74 -0.8013264792 0.1839941685 75 1.1763728829 0.7375824590 76 -0.0702295381 -0.1067395302 77 0.3802099174 0.6334995756 78 0.9182338689 1.4527172653 79 -0.0727788016 -0.5940721865 80 -0.0523435991 -0.7247341547 81 0.0986049923 -1.2849790152 82 1.0638974772 1.5751948335 83 -0.5011138789 0.5803221577 84 -0.1085560361 0.9632204662 85 -0.7743999399 0.8037315133 86 0.1413153586 0.8725656219 87 -0.8931625225 1.5633147777 88 -0.7546647332 -2.3855274112 89 0.3732951658 -0.1959056123 90 1.6821882365 0.6030502556 91 -0.8809968694 0.6143694783 92 -0.1995934013 -0.1007940783 93 0.7638321621 0.9416665513 94 1.0628231628 -0.8804643883 95 -0.9368163451 1.6816635208 96 -0.6580151060 -1.7682130147 97 -0.9175550664 -1.2737393992 98 2.9513302954 -0.6397240076 99 0.2124313761 -2.2604532614 100 -1.2222303838 -0.5564812263 101 -0.3044436156 0.2692523989 102 -0.4262875830 -0.0663718523 103 -0.2470759750 0.2016093948 104 -0.4959237814 0.8247328914 105 2.3915834731 0.8208664476 106 -0.3499768798 0.5894700142 107 0.3518440224 -0.0821191538 108 -1.2771549156 0.1848470716 109 -1.3539764102 -1.9597772725 110 -2.1094627373 -0.4915158359 111 -0.4479713432 -1.5233683401 112 -0.7050591174 1.5737687515 113 -0.1598206098 0.9580212115 114 -0.9405480057 -0.5984470980 115 -1.3162859413 4.0357807336 116 -1.2390017032 0.4432861400 117 -1.3932965240 -1.0642153064 118 0.1713145384 -2.1893432816 119 -0.5774087101 -1.6762213419 120 -0.4768269309 1.5300896054 121 -0.2880257875 -0.6349014403 122 -0.5699231112 -0.2199114430 123 0.0124199280 -0.5649548016 124 -0.9715113723 0.7605283893 125 1.5453151072 -1.4180493161 126 -0.6702906730 0.6986822477 127 -1.5084531368 1.1414341854 128 2.2867748507 0.7314145801 129 -0.2711290950 0.7047120314 130 0.6040954797 -0.1090235577 131 -0.2361485880 0.0442910974 132 -1.1383340957 -0.3009048217 133 -2.2536861119 -2.3379943048 134 0.4029481047 -0.1931865204 135 -0.1979742470 1.6488598356 136 -0.5504421541 -0.5517448088 137 0.2455560683 -0.8885337396 138 0.0105848924 -2.8586216104 139 -1.2380030274 -0.1508097631 140 -0.6193389497 0.3229045114 141 -1.8575966377 -2.0230194550 142 -0.2973257128 -0.0422939259 > postscript(file="/var/wessaorg/rcomp/tmp/1ree41335172375.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/24c101335172375.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/3r4s01335172376.tab") > > try(system("convert tmp/1ree41335172375.ps tmp/1ree41335172375.png",intern=TRUE)) character(0) > try(system("convert tmp/24c101335172375.ps tmp/24c101335172375.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.870 0.190 1.071