R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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. > x <- array(list(1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,1 + ,1 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,4 + ,2 + ,1 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,3 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,2 + ,2 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,4 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,4 + ,6 + ,3 + ,2 + ,3 + ,3 + ,3 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,2 + ,2 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,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,1 + ,2 + ,2 + ,2 + ,1 + ,2 + ,1 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,5 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,3 + ,2 + ,1 + ,1 + ,2 + ,1 + ,2 + ,1 + ,1 + ,1 + ,1 + ,2 + ,3 + ,2 + ,2 + ,1 + ,2 + ,1 + ,1 + ,1 + ,2 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,1 + ,1 + ,1 + ,2 + ,2 + ,1 + ,1 + ,4 + ,4 + ,4 + ,4 + ,1 + ,3 + ,1 + ,1 + ,1 + ,1 + ,2 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1 + ,1) + ,dim=c(4 + ,162) + ,dimnames=list(c('Q1_5' + ,'Q1_12' + ,'Q1_19' + ,'Q1_26') + ,1:162)) > y <- array(NA,dim=c(4,162),dimnames=list(c('Q1_5','Q1_12','Q1_19','Q1_26'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > library(psych) > z <- t(y) > (r <- alpha(z)) Reliability analysis Call: alpha(x = z) raw_alpha std.alpha G6(smc) average_r mean sd 0.8 0.81 0.78 0.52 1.4 0.66 Reliability if an item is dropped: raw_alpha std.alpha G6(smc) average_r Q1_5 0.71 0.74 0.67 0.48 Q1_12 0.82 0.82 0.76 0.60 Q1_19 0.70 0.72 0.64 0.46 Q1_26 0.77 0.78 0.72 0.54 Item statistics n r r.cor r.drop mean sd Q1_5 162 0.84 0.77 0.69 1.4 0.80 Q1_12 162 0.73 0.57 0.52 1.7 1.02 Q1_19 162 0.86 0.81 0.71 1.4 0.79 Q1_26 162 0.78 0.67 0.59 1.3 0.69 Non missing response frequency for each item 1 2 3 4 5 6 7 miss Q1_5 0.69 0.22 0.04 0.04 0.01 0.00 0.00 0 Q1_12 0.57 0.28 0.08 0.04 0.01 0.01 0.01 0 Q1_19 0.75 0.16 0.04 0.04 0.01 0.00 0.00 0 Q1_26 0.78 0.17 0.02 0.02 0.01 0.00 0.00 0 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Cronbach Alpha and Related Statistics',5,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Items',1,TRUE) > a<-table.element(a,'Cronbach Alpha',1,TRUE) > a<-table.element(a,'Std. Alpha',1,TRUE) > a<-table.element(a,'G6(smc)',1,TRUE) > a<-table.element(a,'Average R',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'All itmes',header=TRUE) > a<-table.element(a,round(r$total['raw_alpha'],4)) > a<-table.element(a,round(r$total['std.alpha'],4)) > a<-table.element(a,round(r$total['G6(smc)'],4)) > a<-table.element(a,round(r$total['average_r'],4)) > a<-table.row.end(a) > n = length(z[1,]) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,paste(colnames(z)[i],' excluded',sep=''),header=TRUE) + a<-table.element(a,round(r$alpha.drop[i,'raw_alpha'],4)) + a<-table.element(a,round(r$alpha.drop[i,'std.alpha'],4)) + a<-table.element(a,round(r$alpha.drop[i,'G6(smc)'],4)) + a<-table.element(a,round(r$alpha.drop[i,'average_r'],4)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/15y8k1356104866.tab") > > > > proc.time() user system elapsed 0.496 0.105 0.577