R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(41 + ,48 + ,52 + ,53 + ,65 + ,68 + ,64 + ,57 + ,55 + ,54 + ,59 + ,66 + ,83 + ,100 + ,101 + ,98 + ,92 + ,85 + ,92 + ,94 + ,90 + ,99 + ,108 + ,106 + ,99 + ,100 + ,99 + ,93 + ,92 + ,93 + ,98 + ,95 + ,86 + ,85 + ,83 + ,85 + ,80 + ,84 + ,86 + ,87 + ,85 + ,83 + ,76 + ,70 + ,78 + ,83 + ,88 + ,90 + ,90 + ,97 + ,102 + ,101 + ,98 + ,98 + ,100 + ,102 + ,108 + ,112 + ,110 + ,110 + ,117 + ,120 + ,119 + ,113 + ,123 + ,120 + ,129 + ,132 + ,136 + ,141 + ,122 + ,137 + ,145 + ,155 + ,148 + ,153 + ,172 + ,169 + ,180 + ,190 + ,233 + ,231 + ,245 + ,299 + ,385 + ,381 + ,322 + ,317 + ,323 + ,393 + ,372 + ,387 + ,413 + ,405 + ,407 + ,392 + ,363 + ,358 + ,375 + ,370 + ,386 + ,353 + ,347 + ,363 + ,350 + ,347 + ,333 + ,327 + ,328 + ,309 + ,286 + ,319 + ,285 + ,301 + ,315 + ,388 + ,383 + ,417 + ,423 + ,430 + ,486 + ,394 + ,411 + ,431 + ,447 + ,432 + ,457 + ,453 + ,441 + ,416 + ,451 + ,432 + ,436 + ,429 + ,421 + ,425 + ,437 + ,432 + ,413 + ,419 + ,436 + ,421 + ,424 + ,402 + ,403 + ,400 + ,426 + ,418 + ,403 + ,405 + ,394 + ,400 + ,376 + ,367 + ,354 + ,348 + ,364 + ,329 + ,348 + ,330 + ,351 + ,336 + ,332 + ,349 + ,384 + ,370 + ,346 + ,338 + ,335 + ,338 + ,347 + ,372 + ,376 + ,373 + ,392 + ,374 + ,385 + ,372 + ,372 + ,352 + ,353 + ,330 + ,348 + ,346 + ,361 + ,364 + ,375 + ,369 + ,342 + ,338 + ,337 + ,333 + ,336 + ,322 + ,329 + ,322 + ,325 + ,331 + ,311 + ,318 + ,312 + ,315 + ,333 + ,311 + ,321 + ,316 + ,284 + ,281 + ,280 + ,266 + ,268 + ,278 + ,292 + ,263 + ,265 + ,266 + ,251 + ,256 + ,280 + ,283 + ,289 + ,308 + ,293 + ,281 + ,274 + ,277 + ,278 + ,250 + ,265 + ,269 + ,262 + ,258 + ,251 + ,243 + ,247 + ,224 + ,241 + ,255 + ,261 + ,267 + ,264 + ,270 + ,275 + ,281 + ,301 + ,321 + ,355 + ,319 + ,299 + ,319 + ,328 + ,348 + ,335 + ,333 + ,331 + ,318 + ,325 + ,318 + ,313 + ,313 + ,315 + ,298 + ,311 + ,309 + ,297 + ,294 + ,291 + ,292 + ,290 + ,287 + ,281 + ,295 + ,289 + ,286 + ,295 + ,291 + ,315 + ,306 + ,304 + ,309 + ,307 + ,299 + ,294 + ,295 + ,296 + ,294 + ,292 + ,290 + ,289 + ,310 + ,297 + ,301 + ,302 + ,297 + ,305 + ,298 + ,299 + ,273 + ,267 + ,266 + ,284 + ,276 + ,284 + ,285 + ,267 + ,273 + ,262 + ,246 + ,251 + ,248 + ,255 + ,245 + ,251 + ,261 + ,259 + ,271 + ,258 + ,253 + ,239 + ,241 + ,281 + ,285 + ,289 + ,290 + ,290 + ,305 + ,289 + ,302 + ,294 + ,301 + ,299 + ,312 + ,310 + ,312 + ,309 + ,292 + ,284 + ,290 + ,292 + ,297 + ,316 + ,320 + ,304 + ,301 + ,322 + ,309 + ,308 + ,311 + ,328 + ,343 + ,345 + ,342 + ,350 + ,322 + ,311 + ,319 + ,328 + ,320 + ,321 + ,331 + ,342 + ,322 + ,307 + ,302 + ,307 + ,301 + ,315 + ,342 + ,333 + ,332 + ,332 + ,330 + ,322 + ,319 + ,345 + ,324 + ,322 + ,325 + ,325 + ,335 + ,335 + ,335 + ,341 + ,320 + ,324 + ,328 + ,329 + ,338 + ,336 + ,361 + ,353 + ,352 + ,393 + ,393 + ,420 + ,435 + ,468 + ,466 + ,481 + ,511 + ,508 + ,480 + ,496 + ,487 + ,473 + ,473 + ,488 + ,479 + ,501 + ,503 + ,497 + ,496 + ,490 + ,482 + ,486 + ,493 + ,522 + ,546 + ,534 + ,570 + ,624 + ,640 + ,589 + ,559 + ,570 + ,590 + ,588 + ,566 + ,630 + ,576 + ,642 + ,626 + ,718 + ,750 + ,690 + ,667 + ,689 + ,666 + ,662 + ,666 + ,681 + ,705 + ,783 + ,758 + ,776 + ,812 + ,824 + ,887 + ,984 + ,1016 + ,897 + ,980 + ,957 + ,969 + ,1063 + ,1048 + ,968 + ,1022 + ,1014 + ,1035 + ,1069 + ,1038 + ,1133 + ,1260 + ,1207 + ,1235 + ,1297 + ,1179 + ,1332 + ,1323 + ,1248 + ,1248 + ,1260 + ,1260 + ,1317 + ,1308 + ,1380 + ,1327 + ,1327) > par2 = '12' > par1 = 'multiplicative' > par2 <- '12' > par1 <- 'multiplicative' > #'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] 1.0175371 1.0163499 1.0033068 0.9991880 1.0021176 0.9932328 0.9905528 [8] 0.9907521 1.0003357 0.9909701 1.0027168 0.9929403 > postscript(file="/var/wessaorg/rcomp/tmp/1mld51356021610.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/26pdv1356021610.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/3a3sr1356021610.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/4o0la1356021610.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/57mmr1356021610.tab") > > try(system("convert tmp/1mld51356021610.ps tmp/1mld51356021610.png",intern=TRUE)) character(0) > try(system("convert tmp/26pdv1356021610.ps tmp/26pdv1356021610.png",intern=TRUE)) character(0) > try(system("convert tmp/3a3sr1356021610.ps tmp/3a3sr1356021610.png",intern=TRUE)) character(0) > try(system("convert tmp/4o0la1356021610.ps tmp/4o0la1356021610.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 15.952 0.938 16.826