library(psych) par1b <- T if(par1=='FALSE') par1b <- F z <- t(y) (r <- alpha(z,check.keys=par1b)) load(file='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='mytable.tab')
|