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(109415 + ,112454 + ,119920 + ,132540 + ,135574 + ,130455 + ,102082 + ,100001 + ,107304 + ,112514 + ,118240 + ,120528 + ,121225 + ,118277 + ,123725 + ,134704 + ,137448 + ,130676 + ,103493 + ,99197 + ,106534 + ,108293 + ,109078 + ,109337 + ,106758 + ,104519 + ,108811 + ,117008 + ,120327 + ,115867 + ,87486 + ,84031 + ,93248 + ,94545 + ,101281 + ,104782 + ,104919 + ,105531 + ,114971 + ,123946 + ,130374 + ,124129 + ,93051 + ,94542 + ,101802 + ,104609 + ,111272 + ,116566 + ,115614 + ,122683 + ,134339 + ,149147 + ,149946 + ,143565 + ,112093 + ,110737 + ,113719 + ,116615 + ,122716 + ,125326 + ,132111 + ,136524 + ,146681 + ,157221 + ,157230 + ,148729 + ,112879 + ,112135 + ,117352 + ,122401 + ,126611 + ,130322 + ,134588 + ,139208 + ,149470 + ,160942 + ,161761 + ,152803 + ,116193 + ,114158 + ,119647 + ,125554 + ,133001 + ,136151 + ,136919 + ,137507 + ,147768 + ,157928 + ,159129 + ,150739 + ,111078 + ,108366 + ,113537 + ,117702 + ,122860 + ,127059 + ,128140 + ,130340 + ,138920 + ,146571 + ,147579 + ,137277 + ,98181 + ,98173 + ,102841 + ,107005 + ,110452 + ,113012 + ,113706 + ,116805 + ,131822 + ,139887 + ,139183 + ,122257 + ,91382 + ,93093 + ,97686 + ,101328 + ,105645 + ,109406 + ,109416 + ,113438 + ,123913 + ,133739 + ,139261 + ,119321 + ,91496 + ,93302 + ,99983 + ,103753 + ,110924 + ,116222 + ,118755 + ,122104 + ,132404 + ,144954 + ,149033 + ,131305 + ,102334 + ,105395 + ,111599 + ,117599 + ,123066 + ,128461 + ,130691 + ,131852 + ,141514 + ,155283 + ,159836 + ,137272 + ,105428 + ,109627 + ,116598 + ,123090 + ,130104 + ,134066 + ,139174 + ,141481 + ,151108 + ,163129 + ,160069 + ,147747 + ,116440 + ,116428 + ,124226 + ,129818 + ,136473 + ,141579 + ,146310 + ,149601 + ,157939 + ,167395 + ,169316 + ,155276 + ,118632 + ,120297 + ,128332 + ,133639 + ,142773 + ,149657 + ,150969 + ,152402 + ,160158 + ,164254 + ,164375 + ,150610 + ,114488 + ,115570 + ,123538 + ,129943 + ,137502 + ,143320 + ,146878 + ,149621 + ,158028 + ,165189 + ,166308 + ,152788 + ,119459 + ,120952 + ,128628 + ,137278 + ,147166 + ,155171 + ,157951 + ,158934 + ,162912 + ,168856 + ,167161 + ,154976 + ,115950 + ,114173 + ,118654 + ,124285 + ,131417 + ,136525 + ,138583 + ,136159 + ,140463 + ,145000 + ,146232 + ,135497 + ,100121 + ,98445 + ,104166 + ,109231 + ,116898 + ,125325 + ,128444 + ,128858 + ,134770 + ,138787 + ,138748 + ,128141 + ,89679 + ,89180 + ,94801 + ,100892 + ,109216 + ,114290 + ,117390 + ,118394 + ,123657 + ,128503 + ,127795 + ,120024 + ,80539 + ,79319 + ,84635 + ,91561 + ,101033 + ,111051 + ,115288 + ,117903 + ,124674 + ,131559 + ,136374 + ,125488 + ,89362 + ,90113 + ,97078 + ,109418 + ,116158 + ,128587 + ,134100 + ,137688 + ,145277 + ,153393 + ,156686 + ,149117 + ,108621 + ,108997 + ,117491 + ,126897 + ,138797 + ,151305 + ,157745 + ,161624 + ,170622 + ,177478 + ,177428 + ,171411 + ,132330 + ,134551 + ,143184 + ,152607 + ,163415 + ,178727 + ,184923 + ,183993 + ,195807 + ,195428 + ,193623 + ,184211 + ,144011 + ,145655 + ,152733 + ,163068 + ,175068 + ,189173 + ,195175 + ,197412 + ,206360 + ,215830 + ,216663 + ,202720 + ,159250 + ,168580 + ,177203 + ,185819 + ,196890 + ,214046 + ,212918 + ,223580 + ,230266 + ,237295 + ,239283 + ,215334 + ,168807 + ,172892 + ,179997 + ,192830 + ,205751 + ,217396 + ,224842 + ,231966 + ,243958 + ,251243 + ,250448 + ,230352 + ,183347 + ,185306 + ,194674 + ,202864 + ,213230 + ,221351 + ,226194 + ,227938 + ,231232 + ,237277 + ,236313 + ,218711 + ,168805 + ,171274 + ,178806 + ,185788 + ,194189 + ,200338) > 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] 4258.700 6432.491 14620.993 22633.302 23696.351 11265.067 [7] -24687.399 -24497.207 -18121.308 -12229.666 -4968.327 1597.002 > postscript(file="/var/wessaorg/rcomp/tmp/1awov1322558772.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/2xz1d1322558772.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/31dbg1322558772.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/4xi2g1322558772.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/57mv01322558772.tab") > > try(system("convert tmp/1awov1322558772.ps tmp/1awov1322558772.png",intern=TRUE)) character(0) > try(system("convert tmp/2xz1d1322558772.ps tmp/2xz1d1322558772.png",intern=TRUE)) character(0) > try(system("convert tmp/31dbg1322558772.ps tmp/31dbg1322558772.png",intern=TRUE)) character(0) > try(system("convert tmp/4xi2g1322558772.ps tmp/4xi2g1322558772.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.378 0.204 4.618