R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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. > par1 = '157163' > par1 <- '157163' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Dr. Ian E. Holliday > #To cite this work: Ian E. Holliday, 2009, YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: > #Technical description: > library(digest) > myran <- runif(1) > if (myran <= 1) { + nx1 <- rnorm(100) + nx2 <- rnorm(100, sd=1.0, mean=0.0) + nx3 <- rnorm(100, sd=2.0, mean=-2.0) + answer <- 'nx3' + } > if (myran < 0.66) { + nx2 <- rnorm(100) + nx3 <- rnorm(100, sd=1.0, mean=0.0) + nx1 <- rnorm(100, sd=2.0, mean=-2.0) + answer <- 'nx1' + } > if (myran < 0.33) { + nx3 <- rnorm(100) + nx1 <- rnorm(100, sd=1.0, mean=0.0) + nx2 <- rnorm(100, sd=2.0, mean=-2.0) + answer <- 'nx2' + } > answer <- digest(answer,ser=F) > allmeans<- c(mean(nx1),mean(nx2),mean(nx3)) > names(allmeans)<-c('Sample 1', 'Sample 2', 'Sample 3') > allmeans Sample 1 Sample 2 Sample 3 -0.1004873 -0.1168547 -2.2116603 > allsd<- c(sd(nx1), sd(nx2), sd(nx3)) > names(allsd)<- c('Sample 1', 'Sample 2', 'Sample 3') > allsd Sample 1 Sample 2 Sample 3 1.114392 1.148482 1.932349 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Identify the sample least likely to be from a standard normal distribution.',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/Ian.Holliday/rwasp_May_mock2.wasp?par1=',par1,'&par2=nx1&par3=',answer,'&par0=1',sep=''),'The sample called nx1','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/Ian.Holliday/rwasp_May_mock2.wasp?par1=',par1,'&par2=nx2&par3=',answer,'&par0=1',sep=''),'The sample called nx2','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/Ian.Holliday/rwasp_May_mock2.wasp?par1=',par1,'&par2=nx3&par3=',answer,'&par0=1',sep=''),'The sample called nx3','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/Ian.Holliday/rwasp_May_mock2.wasp?par1=',par1,'&par2=wnga&par3=',answer,'&par0=1',sep=''),'Avoid Guessing Penalty','',target='')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1b2ik1275422076.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Means of the three samples',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Sample',1,TRUE) > a<-table.element(a,'nx1',1,TRUE) > a<-table.element(a,'nx2',1,TRUE) > a<-table.element(a,'nx3',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Value',1,TRUE) > a<-table.element(a,round(mean(nx1),3)) > a<-table.element(a,round(mean(nx2),3)) > a<-table.element(a,round(mean(nx3),3)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/23bz51275422076.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Standard deviations of the three samples',4,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Sample',1,TRUE) > a<-table.element(a,'nx1',1,TRUE) > a<-table.element(a,'nx2',1,TRUE) > a<-table.element(a,'nx3',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Value',1,TRUE) > a<-table.element(a,round(sd(nx1),3)) > a<-table.element(a,round(sd(nx2),3)) > a<-table.element(a,round(sd(nx3),3)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/3ptgt1275422076.tab") > postscript(file="/var/www/html/rcomp/tmp/4ptgt1275422076.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(nx1) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5ptgt1275422076.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(nx2) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/6ptgt1275422076.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(nx3) > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7ptgt1275422076.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pairs(x=cbind(nx1, nx2, nx3)) > dev.off() null device 1 > > try(system("convert tmp/4ptgt1275422076.ps tmp/4ptgt1275422076.png",intern=TRUE)) character(0) > try(system("convert tmp/5ptgt1275422076.ps tmp/5ptgt1275422076.png",intern=TRUE)) character(0) > try(system("convert tmp/6ptgt1275422076.ps tmp/6ptgt1275422076.png",intern=TRUE)) character(0) > try(system("convert tmp/7ptgt1275422076.ps tmp/7ptgt1275422076.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.790 0.555 0.970