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. > x <- c(0.552514900 + ,-0.415233631 + ,-0.443505270 + ,-0.269121643 + ,-0.008403113 + ,0.067701517 + ,-0.001956584 + ,0.192909884 + ,-0.267874375 + ,-0.226255248 + ,-0.430298473 + ,-0.638100667 + ,-0.479124765 + ,-1.024474510 + ,-0.348637834 + ,-0.393955343 + ,0.358931095 + ,0.063381185 + ,0.238243996 + ,0.250678752 + ,-0.487515927 + ,-0.225775256 + ,-0.885760418 + ,-0.830655282 + ,0.296897628 + ,-0.344915585 + ,-0.133869039 + ,-0.139756916 + ,0.014602114 + ,0.011865030 + ,0.255115762 + ,0.226820722 + ,-0.309023585 + ,-0.151618802 + ,-0.531858288 + ,-0.429638741 + ,-0.965975558 + ,-1.301831527 + ,0.137422114 + ,0.148700147 + ,0.044143121 + ,0.226631056 + ,0.330163975 + ,0.517790690 + ,-0.011123165 + ,-0.416908592 + ,-0.381488696 + ,-0.031884958 + ,-0.414393439 + ,-0.911095332 + ,-0.457371141 + ,-0.266401460 + ,-0.263471321 + ,-0.134106783 + ,0.055333648 + ,-0.039713557 + ,-0.285383350 + ,-0.167483970 + ,-0.890023318 + ,-0.973150900 + ,-0.185793746 + ,-1.183720382 + ,0.419787663 + ,-0.220470559 + ,0.002758416 + ,0.094605253 + ,-0.203747577 + ,-0.370446898 + ,-0.384431401 + ,-0.050166061 + ,-1.027647092 + ,-0.821409393 + ,-1.373356682 + ,-1.691725416 + ,-0.521561774 + ,-0.449977604 + ,-0.090629713 + ,0.011651815 + ,0.913398739 + ,-0.271811435 + ,-0.168925538 + ,-0.213969528 + ,-0.663331231 + ,-0.668861966 + ,-0.045192980 + ,-0.304069160 + ,-0.190343886 + ,0.074887422 + ,-0.225243865 + ,-0.167614301 + ,-0.135891117 + ,-0.289021535 + ,-0.454125093 + ,-0.337581704 + ,-0.472963398 + ,-1.083843021) > par2 = '36' > par1 = '0' > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > x <- as.ts(x) > library(lattice) > postscript(file="/var/wessaorg/rcomp/tmp/19fc81322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x,type='l',main='Run Sequence Plot',xlab='time or index',ylab='value') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/22wsc1322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(x) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3ib5y1322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > if (par1 > 0) + { + densityplot(~x,col='black',main=paste('Density Plot bw = ',par1),bw=par1) + } else { + densityplot(~x,col='black',main='Density Plot') + } > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/46ar01322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(x) > qqline(x) > grid() > dev.off() null device 1 > if (par2 > 0) + { + postscript(file="/var/wessaorg/rcomp/tmp/5mdd61322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + dum <- cbind(lag(x,k=1),x) + dum + dum1 <- dum[2:length(x),] + dum1 + z <- as.data.frame(dum1) + z + plot(z,main='Lag plot (k=1), lowess, and regression line') + lines(lowess(z)) + abline(lm(z)) + dev.off() + if (par2 > 1) { + postscript(file="/var/wessaorg/rcomp/tmp/6f6wa1322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + dum <- cbind(lag(x,k=par2),x) + dum + dum1 <- dum[(par2+1):length(x),] + dum1 + z <- as.data.frame(dum1) + z + mylagtitle <- 'Lag plot (k=' + mylagtitle <- paste(mylagtitle,par2,sep='') + mylagtitle <- paste(mylagtitle,'), and lowess',sep='') + plot(z,main=mylagtitle) + lines(lowess(z)) + dev.off() + } + postscript(file="/var/wessaorg/rcomp/tmp/7hu931322916297.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + acf(x,lag.max=par2,main='Autocorrelation Function') + grid() + dev.off() + } null device 1 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. -1.692000 -0.451000 -0.226000 -0.271800 0.004982 0.913400 > > #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,'Descriptive Statistics',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'# observations',header=TRUE) > a<-table.element(a,length(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'minimum',header=TRUE) > a<-table.element(a,min(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q1',header=TRUE) > a<-table.element(a,quantile(x,0.25)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'median',header=TRUE) > a<-table.element(a,median(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'mean',header=TRUE) > a<-table.element(a,mean(x)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Q3',header=TRUE) > a<-table.element(a,quantile(x,0.75)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'maximum',header=TRUE) > a<-table.element(a,max(x)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/8axbj1322916297.tab") > > try(system("convert tmp/19fc81322916297.ps tmp/19fc81322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/22wsc1322916297.ps tmp/22wsc1322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/3ib5y1322916297.ps tmp/3ib5y1322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/46ar01322916297.ps tmp/46ar01322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/5mdd61322916297.ps tmp/5mdd61322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/6f6wa1322916297.ps tmp/6f6wa1322916297.png",intern=TRUE)) character(0) > try(system("convert tmp/7hu931322916297.ps tmp/7hu931322916297.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.883 0.317 2.275