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(179.257 + ,179.947 + ,179.094 + ,181.624 + ,184.954 + ,187.928 + ,187.151 + ,189.959 + ,192.492 + ,191.103 + ,191.737 + ,192.31 + ,192.013 + ,192.106 + ,192.141 + ,194.58 + ,196.421 + ,199.021 + ,198.136 + ,199.426 + ,200.997 + ,201.277 + ,201.663 + ,202.874 + ,204.256 + ,205.597 + ,205.471 + ,211.064 + ,212.856 + ,217.036 + ,219.302 + ,219.759 + ,221.388 + ,220.834 + ,221.788 + ,222.358 + ,222.972 + ,224.164 + ,224.915 + ,226.294 + ,224.69 + ,227.021 + ,229.284 + ,229.189 + ,230.032 + ,229.389 + ,231.053 + ,232.56 + ,232.681 + ,231.555 + ,231.428 + ,232.141 + ,234.939 + ,235.424 + ,235.471 + ,236.355 + ,238.693 + ,236.958 + ,237.06 + ,239.282 + ,238.252 + ,241.552 + ,236.23 + ,238.909 + ,240.723 + ,242.12 + ,242.1 + ,243.276 + ,244.677 + ,243.494 + ,244.902 + ,245.247 + ,245.578 + ,243.052 + ,238.121 + ,241.863 + ,241.203 + ,243.634 + ,242.351 + ,245.18 + ,246.126 + ,244.424 + ,245.166 + ,247.258 + ,245.094 + ,246.02 + ,243.082 + ,245.555 + ,243.685 + ,247.277 + ,245.029 + ,246.169 + ,246.778 + ,244.577 + ,246.048 + ,245.775 + ,245.328 + ,245.477 + ,241.903 + ,243.219 + ,248.088 + ,248.521 + ,247.389 + ,249.057 + ,248.916 + ,249.193 + ,250.768 + ,253.106 + ,249.829 + ,249.447 + ,246.755 + ,250.785 + ,250.14 + ,255.755 + ,254.671 + ,253.919 + ,253.741 + ,252.729 + ,253.81 + ,256.653 + ,255.231 + ,258.405 + ,251.061 + ,254.811 + ,254.895 + ,258.325 + ,257.608 + ,258.759 + ,258.621 + ,257.852 + ,260.56 + ,262.358 + ,260.812 + ,261.165 + ,257.164 + ,260.72 + ,259.581 + ,264.743 + ,261.845 + ,262.262 + ,261.631 + ,258.953 + ,259.966 + ,262.85 + ,262.204 + ,263.418 + ,262.752 + ,266.433 + ,267.722 + ,266.003 + ,262.971 + ,265.521 + ,264.676 + ,270.223 + ,269.508 + ,268.457 + ,265.814 + ,266.68 + ,263.018 + ,269.285 + ,269.829 + ,270.911 + ,266.844 + ,271.244 + ,269.907 + ,271.296 + ,270.157 + ,271.322 + ,267.179 + ,264.101 + ,265.518 + ,269.419 + ,268.714 + ,272.482 + ,268.351 + ,268.175 + ,270.674 + ,272.764 + ,272.599 + ,270.333 + ,270.846 + ,270.491 + ,269.16 + ,274.027 + ,273.784 + ,276.663 + ,274.525 + ,271.344 + ,271.115 + ,270.798 + ,273.911 + ,273.985 + ,271.917 + ,273.338 + ,270.601 + ,273.547 + ,275.363 + ,281.229 + ,277.793 + ,279.913 + ,282.5 + ,280.041 + ,282.166 + ,290.304 + ,283.519 + ,287.816 + ,285.226 + ,287.595 + ,289.741 + ,289.148 + ,288.301 + ,290.155 + ,289.648 + ,288.225 + ,289.351 + ,294.735 + ,305.333 + ,309.03 + ,310.215 + ,321.935 + ,325.734 + ,320.846 + ,323.023 + ,319.753 + ,321.753 + ,320.757 + ,324.479 + ,324.641 + ,322.767 + ,324.181 + ,321.389 + ,327.897 + ,334.287 + ,332.653 + ,334.819 + ,335.264 + ,339.622 + ,342.44 + ,346.585 + ,335.378 + ,337.01 + ,339.13 + ,341.193 + ,343.507 + ,348.915 + ,346.431 + ,348.322 + ,348.288 + ,346.597 + ,351.076 + ,355.215 + ,350.562 + ,355.266) > 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.75788316 -0.51900816 -3.13901233 0.01880851 0.73115226 1.75753142 [7] 0.23232934 0.31675226 0.62717101 -0.18303108 0.33118559 0.58400434 > postscript(file="/var/wessaorg/rcomp/tmp/1fm6j1324132963.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/28xo71324132963.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/39b3j1324132963.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/4hfpr1324132963.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/5c4vh1324132963.tab") > > try(system("convert tmp/1fm6j1324132963.ps tmp/1fm6j1324132963.png",intern=TRUE)) character(0) > try(system("convert tmp/28xo71324132963.ps tmp/28xo71324132963.png",intern=TRUE)) character(0) > try(system("convert tmp/39b3j1324132963.ps tmp/39b3j1324132963.png",intern=TRUE)) character(0) > try(system("convert tmp/4hfpr1324132963.ps tmp/4hfpr1324132963.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.779 0.266 3.060