R version 2.10.1 (2009-12-14) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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(131.676 + ,135.050 + ,129.070 + ,137.792 + ,139.762 + ,142.917 + ,144.198 + ,142.648 + ,152.170 + ,136.022 + ,138.142 + ,138.135 + ,135.027 + ,132.911 + ,133.976 + ,137.012 + ,119.610 + ,118.106 + ,120.383 + ,133.185 + ,131.416 + ,134.248 + ,134.397 + ,127.728 + ,131.837 + ,125.955 + ,134.187 + ,143.291 + ,145.074 + ,149.812 + ,144.668 + ,147.253 + ,145.568 + ,155.564 + ,155.872 + ,156.323 + ,158.010 + ,155.598 + ,154.785 + ,157.294 + ,162.938 + ,157.283 + ,166.074 + ,169.282 + ,172.552 + ,174.055 + ,175.409 + ,173.696 + ,171.283 + ,173.322 + ,170.717 + ,174.229 + ,175.339 + ,173.511 + ,175.839 + ,173.816 + ,173.990 + ,174.777 + ,174.819 + ,176.726 + ,176.199 + ,180.952 + ,176.663 + ,182.346 + ,180.605 + ,182.497 + ,187.856 + ,190.020 + ,190.108 + ,193.288 + ,193.230 + ,199.068 + ,195.076 + ,191.563 + ,191.067 + ,186.665 + ,185.508 + ,184.371 + ,183.046 + ,175.714 + ,175.768 + ,171.029 + ,170.465 + ,170.102 + ,156.389 + ,124.291 + ,99.360 + ,86.675 + ,85.056 + ,128.236 + ,164.257 + ,162.401 + ,152.779 + ,156.005 + ,153.387 + ,153.190 + ,148.840 + ,144.211 + ,145.953 + ,145.542 + ,150.271 + ,147.489 + ,143.824 + ,134.754 + ,131.736 + ,126.304 + ,125.511 + ,125.495 + ,130.133 + ,126.257 + ,110.323 + ,98.417 + ,105.749 + ,120.665 + ,124.075 + ,127.245 + ,146.731 + ,144.979 + ,148.210 + ,144.670 + ,142.970 + ,142.524 + ,146.142 + ,146.522 + ,148.128 + ,148.798 + ,150.181 + ,152.388 + ,155.694 + ,160.662 + ,155.520 + ,158.262 + ,154.338 + ,158.196 + ,160.371 + ,154.856 + ,150.636 + ,145.899 + ,141.242 + ,140.834 + ,141.119 + ,139.104 + ,134.437 + ,129.425 + ,123.155 + ,119.273 + ,120.472 + ,121.523 + ,121.983 + ,123.658 + ,124.794 + ,124.827 + ,120.382 + ,117.395 + ,115.790 + ,114.283 + ,117.271 + ,117.448 + ,118.764 + ,120.550 + ,123.554 + ,125.412 + ,124.182 + ,119.828 + ,115.361 + ,114.226 + ,115.214 + ,115.864 + ,114.276 + ,113.469 + ,114.883 + ,114.172 + ,111.225 + ,112.149 + ,115.618 + ,118.002 + ,121.382 + ,120.663 + ,128.049) > 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.8524145 -2.7046752 -4.7997874 -5.2164124 -5.1092970 -1.0193515 [7] 2.5557703 2.7712094 3.0221806 3.8051966 3.1841229 2.6586293 > postscript(file="/var/yougetitorg/rcomp/tmp/19h0a1305573579.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/yougetitorg/rcomp/tmp/2c7qa1305573579.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/yougetitorg/rcomp/tmp/31zdu1305573579.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/yougetitorg/rcomp/tmp/4qxco1305573579.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/yougetitorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/yougetitorg/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/yougetitorg/rcomp/tmp/5z66y1305573579.tab") > > try(system("convert tmp/19h0a1305573579.ps tmp/19h0a1305573579.png",intern=TRUE)) character(0) > try(system("convert tmp/2c7qa1305573579.ps tmp/2c7qa1305573579.png",intern=TRUE)) character(0) > try(system("convert tmp/31zdu1305573579.ps tmp/31zdu1305573579.png",intern=TRUE)) character(0) > try(system("convert tmp/4qxco1305573579.ps tmp/4qxco1305573579.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.450 0.850 2.778