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(413491 + ,399153 + ,385939 + ,373917 + ,364635 + ,364696 + ,418358 + ,428212 + ,423730 + ,420677 + ,417428 + ,423245 + ,423113 + ,418873 + ,405733 + ,397812 + ,389918 + ,391116 + ,443814 + ,460373 + ,455422 + ,456288 + ,452233 + ,459256 + ,461146 + ,451391 + ,443101 + ,438810 + ,430457 + ,435721 + ,488280 + ,505814 + ,502338 + ,500910 + ,501434 + ,515476 + ,520862 + ,519517 + ,511805 + ,508607 + ,505327 + ,511435 + ,570158 + ,591665 + ,593572 + ,586346 + ,586063 + ,591504 + ,594033 + ,585597 + ,572450 + ,562917 + ,554675 + ,553997 + ,601310 + ,622255 + ,616735 + ,606480 + ,595079 + ,598588 + ,599917 + ,591573 + ,575489 + ,567223 + ,555338 + ,555252 + ,608249 + ,630859 + ,628632 + ,624435 + ,609670 + ,615830 + ,621170 + ,604212 + ,584348 + ,573717 + ,555234 + ,544897 + ,598866 + ,620081 + ,607699 + ,589960 + ,578665 + ,580166 + ,579457 + ,571560 + ,560460 + ,551397 + ,536763 + ,540562 + ,588184 + ,607049 + ,598968 + ,577644 + ,562640 + ,565867 + ,561274 + ,554144 + ,539900 + ,526271 + ,511841 + ,505282 + ,554083 + ,584225 + ,568858 + ,539516 + ,521612 + ,525562 + ,526519 + ,515713 + ,503454 + ,489301 + ,479020 + ,475102 + ,523682 + ,551528 + ,531626 + ,511037 + ,492417 + ,492188 + ,492865 + ,480961 + ,461935 + ,456608 + ,441977 + ,439148 + ,488180 + ,520564 + ,501492 + ,485025 + ,464196 + ,460170 + ,467037 + ,460070 + ,447988 + ,442867 + ,436087 + ,431328 + ,484015 + ,509673 + ,512927 + ,502831 + ,470984 + ,471067 + ,476049 + ,474605 + ,470439 + ,461251 + ,454724 + ,455626 + ,516847 + ,525192 + ,522975 + ,518585 + ,509239 + ,512238 + ,519164 + ,517009 + ,509933 + ,509127 + ,500857 + ,506971 + ,569323 + ,579714 + ,577992 + ,565464 + ,547344 + ,554788 + ,562325 + ,560854 + ,555332 + ,543599 + ,536662 + ,542722 + ,593530 + ,610763 + ,612613 + ,611324 + ,594167 + ,595454 + ,590865 + ,589379 + ,584428 + ,573100 + ,567456 + ,569028 + ,620735 + ,628884 + ,628232 + ,612117 + ,595404 + ,597141 + ,593408 + ,590072 + ,579799 + ,574205 + ,572775 + ,572942 + ,619567 + ,625809 + ,619916 + ,587625 + ,565742 + ,557274 + ,560576 + ,548854 + ,531673 + ,525919 + ,511038 + ,498662 + ,555362 + ,564591 + ,541657 + ,527070 + ,509846 + ,514258 + ,516922 + ,507561 + ,492622 + ,490243 + ,469357 + ,477580 + ,528379 + ,533590 + ,517945 + ,506174 + ,501866 + ,516141 + ,528222 + ,532638 + ,536322 + ,536535 + ,523597 + ,536214 + ,586570 + ,596594 + ,580523 + ,564478 + ,557560 + ,575093 + ,580112 + ,574761 + ,563250 + ,551531 + ,537034 + ,544686 + ,600991 + ,604378 + ,586111 + ,563668 + ,548604 + ,551174 + ,555654) > par2 = '12' > par1 = 'multiplicative' > #'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] 1.0096297 0.9962763 0.9742250 0.9590820 0.9381561 0.9387779 1.0365338 [8] 1.0652828 1.0507539 1.0258687 0.9998617 1.0055521 > postscript(file="/var/wessaorg/rcomp/tmp/1qhit1322576636.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/2rgx91322576636.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/3t1i71322576636.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/45tu81322576636.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/5fgxb1322576636.tab") > > try(system("convert tmp/1qhit1322576636.ps tmp/1qhit1322576636.png",intern=TRUE)) character(0) > try(system("convert tmp/2rgx91322576636.ps tmp/2rgx91322576636.png",intern=TRUE)) character(0) > try(system("convert tmp/3t1i71322576636.ps tmp/3t1i71322576636.png",intern=TRUE)) character(0) > try(system("convert tmp/45tu81322576636.ps tmp/45tu81322576636.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.805 0.225 3.056