par3 <- '20' par2 <- '0.97' par1 <- 'two.sided' par2 <- as.numeric(par2) par3 <- as.numeric(par3) (tt <- t.test(x,mu=par3,alternative=par1,conf.level=par2)) load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'One Sample t-test',2,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'H0',header=TRUE) a<-table.element(a,tt$null.value) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Alternative',header=TRUE) a<-table.element(a,tt$alternative) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'CI',header=TRUE) a<-table.element(a,par2) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Sample Mean',header=TRUE) a<-table.element(a,mean(x)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'T-Test',header=TRUE) a<-table.element(a,tt$statistic) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'DF',header=TRUE) a<-table.element(a,tt$parameter) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'P-Value',header=TRUE) a<-table.element(a,tt$p.value) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable.tab')
|