R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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. > par4 = '4' > par3 = 'e200351280b22ccde9002540153e9636' > par2 = 'x31' > par1 = 'a-101530532' > par4 <- '4' > par3 <- 'e200351280b22ccde9002540153e9636' > par2 <- 'x31' > par1 <- 'a-101530532' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: aston2 > #To cite this work: I. Holliday, 2012, MC Mock Q5 (v1.1.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_May_mock3.wasp/ > #Source of accompanying publication: > # > library(digest) > par4 <- as.numeric(par4) > if(exists('par2')) { + if (par2 != 'wnga') { + if (digest(par2,ser=F) == par3) { + par4 = par4 + 4 + lastanswer <- 'correct' + } + if (digest(par2,ser=F) != par3) { + par4 = par4 - 2 + lastanswer <- 'incorrect' + } + } + if (par2 == 'wnga') { + lastanswer <- 'Skipped question' + } + } > myran <- runif(1) > if (myran <= 1) { + x1 <- rnorm(110) + x1 <- sort(x1)[5:104] + x2 <- c(rnorm(80), rnorm(20, sd=3.0, mean=0.0)) + x3 <- rgamma(100, shape=2) + answer <- 's2' + } > if (myran < 0.66) { + x2 <- rnorm(110) + x2 <- sort(x2)[5:104] + x3 <- c(rnorm(80), rnorm(20, sd=3.0, mean=0.0)) + x1 <- rgamma(100, shape=2) + answer <- 's3' + } > if (myran < 0.33) { + x3 <- rnorm(110) + x3 <- sort(x3)[5:104] + x1 <- c(rnorm(80), rnorm(20, sd=3.0, mean=0.0)) + x2 <- rgamma(100, shape=2) + answer <- 's1' + } > answer <- digest(answer,ser=F) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Your last Question',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,lastanswer,1,TRUE) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12wxu1337528970.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'From the information given below which sample seems to be both from a symmetric distribution and contains outliers?',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_May_mock4.wasp?par1=',par1,'&par2=s1&par3=',answer,'&par0=1&par4=',par4,sep=''),'Sample 1','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_May_mock4.wasp?par1=',par1,'&par2=s2&par3=',answer,'&par0=1&par4=',par4,sep=''),'Sample 2','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_May_mock4.wasp?par1=',par1,'&par2=s3&par3=',answer,'&par0=1&par4=',par4,sep=''),'Sample 3','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_May_mock4.wasp?par1=',par1,'&par2=wnga&par3=',answer,'&par0=1&par4=',par4,sep=''),'Avoid Guessing Penalty','',target='')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/2p5eu1337528970.tab") > postscript(file="/var/wessaorg/rcomp/tmp/360fu1337528970.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > boxplot(x=cbind(x1, x2, x3), notch=TRUE, names=c('Sample1','Sample2','Sample3')) > dev.off() null device 1 > > try(system("convert tmp/360fu1337528970.ps tmp/360fu1337528970.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 0.501 0.141 0.635