R version 2.15.3 (2013-03-01) -- "Security Blanket" Copyright (C) 2013 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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 = '18' > par3 = '6dbf9ac2da09ee1d3debf5a51873ec6d' > par2 = 'wnga' > par1 = '119049057_0.536881156032905_Wed May 22 10:31:41 2013' > par4 <- '18' > par3 <- '6dbf9ac2da09ee1d3debf5a51873ec6d' > par2 <- 'wnga' > par1 <- '119049057_0.536881156032905_Wed May 22 10:31:41 2013' > #'GNU S' R Code compiled by R2WASP v. 1.2.291 () > #Author: aston2 > #To cite this work: I. Holliday, 2012, MC Mock Q9 (v1.0.1) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_mcq20109.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 + } + if (digest(par2,ser=F) != par3) { + par4 = par4 - 2 + } + } + if (par2 == 'wnga') { + } + } NULL > myran <- runif(1) > x1<-rnorm(100) > x2<-rnorm(100) > x3<-rnorm(100) > x4<-rnorm(100) > if (myran <= 1) { + y1<-x1+rnorm(100) + y2<-x2+1+rnorm(100) + y3<-x3+1.0*x3*x3+rnorm(100) + y4<-x4-2+rnorm(100) + answer <- 'y3' + } > if (myran <= 0.75) { + y2<-x2+rnorm(100) + y3<-x3+1+rnorm(100) + y4<-x4+1.0*x4*x4+rnorm(100) + y1<-x1-2+rnorm(100) + answer <- 'y4' + } > if (myran <= 0.5) { + y3<-x3+rnorm(100) + y4<-x4+1+rnorm(100) + y1<-x1+1.0*x1*x1+rnorm(100) + y2<-x2-2+rnorm(100) + answer <- 'y1' + } > if (myran <= 0.25) { + y4<-x4+rnorm(100) + y1<-x1+1+rnorm(100) + y2<-x2+1.0*x2*x2+rnorm(100) + y3<-x3-2+rnorm(100) + answer <- 'y2' + } > answer <- digest(answer,ser=F) > postscript(file="/var/fisher/rcomp/tmp/1o3h81369233697.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > layout(matrix(c(1,2,3,4), 2,2)) > qqnorm(x1, main='X1') > qqline(x1) > qqnorm(x2, main='X2') > qqline(x2) > qqnorm(x3, main='X3') > qqline(x3) > qqnorm(x4, main='X4') > qqline(x4) > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/24fgq1369233697.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > layout(matrix(c(1,2,3,4), 2,2)) > plot(x1,y1, main='y1 vs. x1') > abline(reg=lm(y1~x1), col='red') > plot(x2,y2, main='y2 vs. x2') > abline(reg=lm(y2~x2), col='red') > plot(x3,y3, main='y3 vs. x3') > abline(reg=lm(y3~x3), col='red') > plot(x4,y4, main='y4 vs. x4') > abline(reg=lm(y4~x4), col='red') > dev.off() null device 1 > postscript(file="/var/fisher/rcomp/tmp/3do591369233697.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > layout(matrix(c(1,2,3,4), 2,2)) > plot(x1, resid(lm(y1~x1)), main='X1, y1') > abline(0,0, col='red') > plot(x2, resid(lm(y2~x2)), main='X2, Y2') > abline(0,0, col='red') > plot(x3, resid(lm(y3~x3)), main='X3, Y3') > abline(0,0, col='red') > plot(x4, resid(lm(y4~x4)), main='X4, Y4') > abline(0,0, col='red') > dev.off() null device 1 > > #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Based on the evidence below which pair of samples is least well represented by a simple linear regression?',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_mcq201210.wasp?par1=',par1,'&par2=y1&par3=',answer,'&par0=1&par4=',par4,sep=''),'X1, Y1','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_mcq201210.wasp?par1=',par1,'&par2=y2&par3=',answer,'&par0=1&par4=',par4,sep=''),'X2, Y2','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_mcq201210.wasp?par1=',par1,'&par2=y3&par3=',answer,'&par0=1&par4=',par4,sep=''),'X3, Y3','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_mcq201210.wasp?par1=',par1,'&par2=y4&par3=',answer,'&par0=1&par4=',par4,sep=''),'X4, Y4','',target='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink(paste('http://www.wessa.net/rwasp_mcq201210.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/fisher/rcomp/tmp/4e5eb1369233697.tab") > > try(system("convert tmp/1o3h81369233697.ps tmp/1o3h81369233697.png",intern=TRUE)) character(0) > try(system("convert tmp/24fgq1369233697.ps tmp/24fgq1369233697.png",intern=TRUE)) character(0) > try(system("convert tmp/3do591369233697.ps tmp/3do591369233697.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.989 0.339 2.312