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(4581945 + ,3874038 + ,4086290 + ,4364364 + ,3793586 + ,4533914 + ,4823043 + ,3981535 + ,4746356 + ,5284534 + ,4264830 + ,3924674 + ,3734753 + ,3762290 + ,3609739 + ,3877594 + ,3636415 + ,3578195 + ,3604342 + ,3459513 + ,3366571 + ,3371277 + ,3724848 + ,3350830 + ,3305159 + ,3390736 + ,3349758 + ,3253655 + ,3734250 + ,3455433 + ,2966726 + ,2993716 + ,3009320 + ,3169713 + ,3170061 + ,3368934 + ,3292638 + ,3337344 + ,3208306 + ,3359130 + ,3223078 + ,3437159 + ,3400156 + ,3657576 + ,3765613 + ,3481921 + ,3604800 + ,3981340 + ,3734078 + ,4018173 + ,3887417 + ,3919880 + ,4014466 + ,4197758 + ,3896531 + ,3964742 + ,4201847 + ,4050512 + ,3997402 + ,4314479 + ,4925744 + ,5130631 + ,4444855 + ,3967319 + ,3931250 + ,4235952 + ,4169219 + ,3779064 + ,3558810 + ,3699466 + ,3650693 + ,3525633 + ,3470276 + ,3859094 + ,3661155 + ,3356365 + ,3344440 + ,3338684 + ,3404294 + ,3289319 + ,3469252 + ,3571850 + ,3639914 + ,3091730 + ,3078149 + ,3188115 + ,3246082 + ,3486992 + ,3378187 + ,3282306 + ,3288345 + ,3325749 + ,3352262 + ,3531954 + ,3722622 + ,3809365 + ,3750617 + ,3615286 + ,3696556 + ,4123959 + ,4136163 + ,3933392 + ,4035576 + ,4551202 + ,4032195 + ,3970893 + ,4489016 + ,5426127 + ,4578224 + ,4126390 + ,4892100 + ,4128697 + ,4408721 + ,4199465 + ,4074767 + ,4161758 + ,3891319 + ,4470302 + ,4283111 + ,3845962 + ,3911471 + ,3798478 + ,3644313 + ,3784029 + ,3647134 + ,3994662 + ,3607836 + ,3566008 + ,3511412 + ,3258665 + ,3486573 + ,3369443 + ,3465544 + ,3905224 + ,3733881 + ,3220642 + ,3225812 + ,3354461 + ,3352261 + ,3450652) > 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] 10205.93 61543.46 9794.82 -14884.56 16447.70 41894.10 [7] -75192.13 -44580.49 -104697.90 -60682.66 63014.18 97137.55 > postscript(file="/var/wessaorg/rcomp/tmp/1zp9l1322733237.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/2v0fn1322733237.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/3jhdy1322733237.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/4wb5a1322733237.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/5ho5f1322733237.tab") > > try(system("convert tmp/1zp9l1322733237.ps tmp/1zp9l1322733237.png",intern=TRUE)) character(0) > try(system("convert tmp/2v0fn1322733237.ps tmp/2v0fn1322733237.png",intern=TRUE)) character(0) > try(system("convert tmp/3jhdy1322733237.ps tmp/3jhdy1322733237.png",intern=TRUE)) character(0) > try(system("convert tmp/4wb5a1322733237.ps tmp/4wb5a1322733237.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.704 0.210 1.919