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(276986 + ,260633 + ,291551 + ,275383 + ,275302 + ,231693 + ,238829 + ,274215 + ,277808 + ,299060 + ,286629 + ,232313 + ,294053 + ,267510 + ,309739 + ,280733 + ,287298 + ,235672 + ,256449 + ,288997 + ,290789 + ,321898 + ,291834 + ,241380 + ,295469 + ,258200 + ,306102 + ,281480 + ,283101 + ,237414 + ,274834 + ,299340 + ,300383 + ,340862 + ,318794 + ,265740 + ,322656 + ,281563 + ,323461 + ,312579 + ,310784 + ,262785 + ,273754 + ,320036 + ,310336 + ,342206 + ,320052 + ,265582 + ,326988 + ,300713 + ,346414 + ,317325 + ,326208 + ,270657 + ,278158 + ,324584 + ,321801 + ,343542 + ,354040 + ,278179 + ,330246 + ,307344 + ,375874 + ,335309 + ,339271 + ,280264 + ,293689 + ,341161 + ,345097 + ,368712 + ,369403 + ,288384 + ,340981 + ,319072 + ,374214 + ,344529 + ,337271 + ,281016 + ,282224 + ,320984 + ,325426 + ,366276 + ,380296 + ,300727 + ,359326 + ,327610 + ,383563 + ,352405 + ,329351 + ,294486 + ,333454 + ,334339 + ,358000 + ,396057 + ,386976 + ,307155 + ,363909 + ,344700 + ,397561 + ,376791 + ,337085 + ,299252 + ,323136 + ,329091 + ,346991 + ,461999 + ,436533 + ,360372 + ,415467 + ,382110 + ,432197 + ,424254 + ,386728 + ,354508 + ,375765 + ,367986 + ,402378 + ,426516 + ,433313 + ,338461 + ,416834 + ,381099 + ,445673 + ,412408 + ,393997 + ,348241 + ,380134 + ,373688 + ,393588 + ,434192 + ,430731 + ,344468 + ,411891 + ,370497 + ,437305 + ,411270 + ,385495 + ,341273 + ,384217 + ,373223 + ,415771 + ,448634 + ,454341 + ,350297 + ,419104 + ,398027 + ,456059 + ,430052 + ,399757 + ,362731 + ,384896 + ,385349 + ,432289 + ,468891 + ,442702 + ,370178 + ,439400 + ,393900 + ,468700 + ,438800 + ,430100 + ,366300 + ,391000 + ,380900 + ,431400 + ,465400 + ,471500 + ,387500 + ,446400 + ,421500 + ,504800 + ,492071 + ,421253 + ,396682 + ,428000 + ,421900 + ,465600 + ,525793 + ,499855 + ,435287 + ,479499 + ,473027 + ,554410 + ,489574 + ,462157 + ,420331) > par2 = '12' > par1 = 'additive' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), 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: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > par2 <- as.numeric(par2) > x <- ts(x,freq=par2) > m <- decompose(x,type=par1) > m$figure [1] 16453.410 -15183.352 41519.419 15167.428 -3449.617 -50146.736 [7] -27843.534 -14587.971 3948.684 43393.874 33637.053 -42908.656 > postscript(file="/var/wessaorg/rcomp/tmp/1kgt31322502104.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(m) > dev.off() null device 1 > mylagmax <- length(x)/2 > postscript(file="/var/wessaorg/rcomp/tmp/23b891322502104.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > acf(as.numeric(x),lag.max = mylagmax,main='Observed') > acf(as.numeric(m$trend),na.action=na.pass,lag.max = mylagmax,main='Trend') > acf(as.numeric(m$seasonal),na.action=na.pass,lag.max = mylagmax,main='Seasonal') > acf(as.numeric(m$random),na.action=na.pass,lag.max = mylagmax,main='Random') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3l4z81322502104.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > spectrum(as.numeric(x),main='Observed') > spectrum(as.numeric(m$trend[!is.na(m$trend)]),main='Trend') > spectrum(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal') > spectrum(as.numeric(m$random[!is.na(m$random)]),main='Random') > par(op) > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4a1u61322502104.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > op <- par(mfrow = c(2,2)) > cpgram(as.numeric(x),main='Observed') > cpgram(as.numeric(m$trend[!is.na(m$trend)]),main='Trend') > cpgram(as.numeric(m$seasonal[!is.na(m$seasonal)]),main='Seasonal') > cpgram(as.numeric(m$random[!is.na(m$random)]),main='Random') > par(op) > dev.off() null device 1 > > #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,'Classical Decomposition by Moving Averages',6,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'t',header=TRUE) > a<-table.element(a,'Observations',header=TRUE) > a<-table.element(a,'Fit',header=TRUE) > a<-table.element(a,'Trend',header=TRUE) > a<-table.element(a,'Seasonal',header=TRUE) > a<-table.element(a,'Random',header=TRUE) > a<-table.row.end(a) > for (i in 1:length(m$trend)) { + a<-table.row.start(a) + a<-table.element(a,i,header=TRUE) + a<-table.element(a,x[i]) + if (par1 == 'additive') a<-table.element(a,m$trend[i]+m$seasonal[i]) else a<-table.element(a,m$trend[i]*m$seasonal[i]) + a<-table.element(a,m$trend[i]) + a<-table.element(a,m$seasonal[i]) + a<-table.element(a,m$random[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/57yds1322502104.tab") > > try(system("convert tmp/1kgt31322502104.ps tmp/1kgt31322502104.png",intern=TRUE)) character(0) > try(system("convert tmp/23b891322502104.ps tmp/23b891322502104.png",intern=TRUE)) character(0) > try(system("convert tmp/3l4z81322502104.ps tmp/3l4z81322502104.png",intern=TRUE)) character(0) > try(system("convert tmp/4a1u61322502104.ps tmp/4a1u61322502104.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.138 0.209 2.348