R version 2.12.0 (2010-10-15) Copyright (C) 2010 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(42.33600 + ,42.14710 + ,40.25640 + ,39.18980 + ,39.13170 + ,38.15070 + ,38.27070 + ,39.13350 + ,40.12190 + ,41.28450 + ,42.57490 + ,43.90190 + ,43.18350 + ,43.61880 + ,44.76240 + ,45.19720 + ,44.38810 + ,43.55520 + ,43.56780 + ,44.21350 + ,45.14510 + ,45.80790 + ,42.32820 + ,37.89990 + ,34.79640 + ,35.21440 + ,36.37270 + ,36.25020 + ,36.82610 + ,36.77230 + ,36.90420 + ,37.04940 + ,36.82590 + ,36.13570 + ,36.03000 + ,35.79270 + ,35.91740 + ,35.40080 + ,35.17230 + ,34.92110 + ,35.02920 + ,34.77390 + ,34.89990 + ,34.90540 + ,34.56800 + ,34.40600 + ,34.45780 + ,34.73160 + ,34.26020 + ,33.88490 + ,34.05490 + ,34.27550 + ,34.13930 + ,34.15870 + ,34.53860 + ,33.79870 + ,33.49730 + ,33.68020 + ,34.32840 + ,34.15380 + ,33.91840 + ,34.32620 + ,34.77500 + ,35.01190 + ,34.55130 + ,34.69510 + ,35.47300 + ,35.97940 + ,36.47890 + ,36.39100 + ,36.67040 + ,37.41620 + ,37.11850 + ,36.30010 + ,35.70020 + ,35.58590 + ,35.67770 + ,35.24080 + ,34.80160 + ,34.43890 + ,34.98810 + ,36.06800 + ,36.35660 + ,36.12540 + ,34.87100 + ,35.21990 + ,34.33900 + ,33.82340 + ,34.51990 + ,35.53000 + ,35.79660 + ,33.84840 + ,33.98710 + ,34.11610 + ,33.82350 + ,32.45400 + ,31.87740 + ,31.11500 + ,31.04360 + ,30.88680 + ,31.30010 + ,30.05070 + ,28.67990 + ,27.64380 + ,27.23940 + ,26.85490 + ,27.01580 + ,26.91880 + ,26.49660 + ,26.78500 + ,26.83980 + ,26.44780 + ,25.17280 + ,24.87840 + ,25.40150 + ,25.77160 + ,26.11810 + ,26.3969 + ,26.65710 + ,25.18390 + ,23.83940 + ,23.86190 + ,24.25810 + ,25.10980 + ,26.16170 + ,26.80870 + ,25.65770 + ,27.09820 + ,27.46650 + ,28.28900 + ,28.69330 + ,27.24010 + ,27.27980 + ,27.64040 + ,26.83100 + ,26.24670 + ,25.22120 + ,25.36530 + ,26.25920 + ,27.22790 + ,26.33150 + ,25.89810 + ,26.68980) > 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] -0.61477812 -0.56725687 -0.30527896 -0.17924021 -0.04159229 -0.04456813 [7] 0.01682146 0.05231354 0.35031438 0.68711896 0.66748146 -0.02133521 > postscript(file="/var/www/rcomp/tmp/1m8zd1292009493.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/www/rcomp/tmp/2m8zd1292009493.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/www/rcomp/tmp/3sxsa1292009493.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/www/rcomp/tmp/4sxsa1292009493.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/5o6pi1292009493.tab") > > try(system("convert tmp/1m8zd1292009493.ps tmp/1m8zd1292009493.png",intern=TRUE)) character(0) > try(system("convert tmp/2m8zd1292009493.ps tmp/2m8zd1292009493.png",intern=TRUE)) character(0) > try(system("convert tmp/3sxsa1292009493.ps tmp/3sxsa1292009493.png",intern=TRUE)) character(0) > try(system("convert tmp/4sxsa1292009493.ps tmp/4sxsa1292009493.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 1.570 0.550 2.117