bitmap(file='test1.png') plot(x,y, xlab=xlab, ylab=ylab) abline(coef=(lm(y ~ x))$coeff, col='red') ctp<-cor.test(x, y, use='pair', method='pearson') legend('bottomright', c('cor =', as.character(round(ctp$estimate, digits=4)))) dev.off() sw1<-shapiro.test(x) sw2<-shapiro.test(y) cxy<-cor.test(x, y, method=par1) load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,paste('Shapiro Test ', xlab),3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Statistic W',header=TRUE) a<-table.element(a,'probability',header=TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com','ShapiroWilks Test','ShapiroWilks Test')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,round(sw1$statistic, digits=4)) a<-table.element(a,round(sw1$p.value, digits=4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a, paste('Shapiro Test ', ylab),3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Statistic W',header=TRUE) a<-table.element(a,'probability',header=TRUE) a<-table.element(a,hyperlink('http://www.xycoon.com','ShapiroWilks Test','ShapiroWilks Test')) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,round(sw2$statistic, digits=4)) a<-table.element(a,round(sw2$p.value, digits=4)) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable1.tab') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Correlation Test X-Y',3,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Statistic',header=TRUE) a<-table.element(a,'Value',header=TRUE) a<-table.element(a,'probability',header=TRUE) a<-table.element(a,'Method') a<-table.element(a,'alternative') a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,names(cxy$estimate)) a<-table.element(a,round(cxy$estimate, digits=4)) a<-table.element(a,round(cxy$p.value, digits=4)) a<-table.element(a,cxy$method) a<-table.element(a,cxy$alternative) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable2.tab')
|