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 = 'female' > par1 = '3' > 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.08 0.22 0.82 0.73 0.266 NNZFG 0.15 -0.26 0.83 0.77 0.228 MRT 0.35 -0.22 0.13 0.19 0.813 AFL 0.96 0.06 0.01 0.93 0.069 LPM 0.97 0.10 0.03 0.95 0.051 LPC 0.90 0.03 0.19 0.84 0.161 W -0.05 0.81 0.16 0.69 0.315 WPA 0.12 0.84 -0.15 0.75 0.253 RC1 RC2 RC3 SS loadings 2.83 1.55 1.46 Proportion Var 0.35 0.19 0.18 Cumulative Var 0.35 0.55 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 4.57 The degrees of freedom for the model are 7 and the objective function was 0.89 The number of observations was 133 with Chi Square = 113.19 with prob < 2e-21 Fit based upon off diagonal values = 0.94> fs <- factor.scores(y,fit) > fs RC1 RC2 RC3 1 -0.3952203315 -1.251412427 0.125924506 2 -0.2801716816 -1.116637548 -0.109327397 3 2.0626260500 0.554746609 0.757704235 4 -0.7526378829 -0.291746849 -0.475209080 5 1.1097013578 -0.149613941 0.842310897 6 0.9492872080 1.025111144 0.997215589 7 0.0156053746 -0.898701448 1.744815835 8 0.6543299298 -0.217243814 1.068951000 9 5.0978030485 -0.744474387 0.338881344 10 -0.9972248409 -0.313671091 0.501391339 11 5.1256526369 0.076163022 -0.247129618 12 0.0719960022 -0.593537419 0.595986913 13 1.9210756402 -1.329169507 1.041977297 14 -0.9805308163 -0.574646395 1.083383694 15 -0.4909104441 -0.899368443 0.663459194 16 -0.3831633194 0.173700184 0.941463150 17 -0.8821832688 0.542646350 1.987690539 18 1.3659350917 -0.806488519 0.451460408 19 -0.9653269735 -0.473209882 0.032344772 20 1.5878849549 -1.500581143 0.012602321 21 -0.4844347441 -0.510174571 0.832084385 22 -0.3826633000 -0.119331346 0.888288488 23 -0.9905151177 -0.983736161 0.200662879 24 0.3015466275 -1.279193157 0.474312697 25 0.0757729616 1.433018203 1.741956288 26 0.2935740615 -0.321239070 0.073973057 27 -0.0164153695 -0.851083220 0.664744748 28 0.4721924090 -0.475653348 0.051697149 29 0.0749834551 -0.326711695 0.289543032 30 -0.2743562945 -0.308840623 1.001715630 31 -0.2080373466 -0.937446625 0.074885405 32 -1.0229190634 -0.505870130 0.182980873 33 1.6323792877 -0.738092486 0.975359753 34 -0.4190292820 0.966455259 1.352451109 35 -0.5339512686 -0.789001437 -0.406379161 36 -0.8227676628 -0.853244339 0.103200429 37 0.8240501952 0.045826683 0.338100752 38 -0.0991416997 -1.042236799 0.062633693 39 -0.7883318849 -1.115810553 0.715630802 40 1.1633791962 -0.333022516 1.026259768 41 -0.5318182566 -1.365899378 0.110927428 42 -1.1642189797 -0.096545214 1.046733087 43 -0.2104837324 -0.167242154 1.650256083 44 -0.6228836298 -0.133465148 0.905817602 45 -0.6162970601 1.017099159 0.516370787 46 -0.3322531916 -1.145867442 0.603695749 47 -0.8175596357 -0.004203609 1.101246313 48 0.1366413374 -1.199714614 -0.355324298 49 -0.1406793853 0.593147433 0.577327902 50 -0.5765830825 0.406782059 -0.009603908 51 -0.8848680074 -0.856982571 0.595437055 52 0.2141342264 -1.178583197 -0.192906796 53 0.0928473473 -0.953083630 0.892209899 54 0.6416043375 -1.575904301 -0.429634962 55 2.3984603803 0.559229167 0.406916457 56 -0.8095854503 -0.234781385 1.937108834 57 2.4138591589 0.672041923 0.538875360 58 -0.5931961469 -0.669641689 0.587274264 59 -0.3250919782 1.056993607 0.945912631 60 2.1264696255 -1.042432582 -1.320366296 61 -0.7580561909 0.732467880 0.956642488 62 0.8940710769 -0.695531499 0.010593782 63 1.6250409550 -0.850600953 -0.102655706 64 -0.1249814762 -0.655011035 0.284702925 65 -0.6196015668 0.186410039 0.399511876 66 -0.6710518001 -0.493436972 0.406481427 67 -0.0383842144 0.079465096 0.089834757 68 0.3100258169 0.549112905 0.077861501 69 -0.2934667340 0.924324458 0.173823406 70 -0.1607750115 -0.102487729 1.885567915 71 -0.9212398543 -0.731220005 0.268402528 72 0.1885289656 -0.119644962 0.252484939 73 0.0316804779 -0.175121472 0.859013553 74 -0.2986333321 -1.467121055 -0.447118568 75 0.0385448749 -0.263295546 0.514033250 76 -0.9568662270 -0.340803051 1.377588075 77 -0.3001113600 -0.431845593 1.091388598 78 0.9979894919 1.311104505 -0.750880200 79 -0.1591706815 -0.642539618 0.815940540 80 0.7064492250 -0.504497053 0.950257107 81 -0.2676626260 -0.357700306 -0.092405834 82 -0.9386831430 1.531365441 2.358453765 83 -0.5583531388 2.209125362 0.516904068 84 -0.1216906736 -0.212426211 -0.429575691 85 -0.5173223270 2.038879585 -0.822399171 86 -1.0572355900 0.059708111 -0.828853340 87 0.1489343027 0.622836856 -1.465131456 88 -1.2456521660 -0.037922093 -0.936996458 89 -0.7909184066 0.309430396 -0.603450059 90 -0.5486490570 1.947628715 -0.518550745 91 1.0359313886 -0.031035857 -0.793983025 92 -0.6317481605 1.023803090 1.281109514 93 -0.1728349664 0.301630995 -1.357238723 94 -1.1310129920 1.619254642 0.498088107 95 0.4092588557 0.068338046 -1.140062229 96 0.2984922309 0.390623706 -2.341376854 97 2.0753463078 1.981031879 -1.069761646 98 -0.1937404120 0.583547448 0.111707583 99 -0.5005996033 0.086319482 -1.058710672 100 -0.1012302287 2.036663997 -0.145873669 101 0.2475793683 -0.658596500 -1.042406382 102 -0.3852968279 -0.584816444 -1.006821733 103 -0.0862354077 -0.253057011 -0.719704369 104 0.2549174723 0.056993550 -0.403639948 105 0.0781882968 2.385205521 -0.200082654 106 -0.3959392911 -0.747300989 -1.804725147 107 0.2374548598 0.040443090 -1.692880787 108 -0.3621306563 0.916097234 -0.633968808 109 -0.7636744256 -1.262152935 -1.934541789 110 0.6818951299 3.171966090 0.250744629 111 -0.4285303628 -0.829400399 -1.060113528 112 -0.6371318708 0.228258612 0.897674532 113 -0.0200279657 1.320508357 -0.621673299 114 -0.6169191444 -2.433896608 -2.255876312 115 -0.7982217769 -1.199257177 -1.837656895 116 -0.0607027225 1.351642083 -2.808800040 117 -0.3317148334 -0.770552779 -2.375219275 118 -0.4335152890 1.471689246 -0.973186293 119 -0.7411621433 -0.016545646 -0.517605002 120 -0.3838828618 1.185024627 -1.067554910 121 -0.7031200552 -0.682407625 -0.719763251 122 -0.8424106593 -0.255524224 -1.964865026 123 0.4942630289 2.832268048 -0.271354007 124 -0.0118875527 1.303961445 -0.875685509 125 0.2741169383 -0.549432576 -1.136222677 126 -0.6896203132 0.181633953 -0.378665734 127 -0.0002276444 2.134524388 0.180015168 128 0.1595659219 1.283836799 -0.647880809 129 -0.0158127449 0.391192248 -1.526159399 130 -0.0840713674 0.401325624 -1.572871987 131 -0.1862634772 1.034141981 -0.941897385 132 -0.8131713992 0.734550425 -1.150709857 133 -0.3452730257 -0.510577025 -0.569541083 > postscript(file="/var/wessaorg/rcomp/tmp/100je1335465384.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/2wicd1335465384.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/3uhot1335465384.tab") > > try(system("convert tmp/100je1335465384.ps tmp/100je1335465384.png",intern=TRUE)) character(0) > try(system("convert tmp/2wicd1335465384.ps tmp/2wicd1335465384.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.924 0.172 1.095