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(2030 + ,1855 + ,1834 + ,2092 + ,2164 + ,2368 + ,2072 + ,2521 + ,1823 + ,1947 + ,2226 + ,1754 + ,1786 + ,2072 + ,1846 + ,2137 + ,2466 + ,2154 + ,2289 + ,2628 + ,2074 + ,2798 + ,2194 + ,2442 + ,2565 + ,2063 + ,2069 + ,2539 + ,1898 + ,2139 + ,2408 + ,2725 + ,2201 + ,2311 + ,2548 + ,2276 + ,2351 + ,2280 + ,2057 + ,2479 + ,2379 + ,2295 + ,2456 + ,2546 + ,2844 + ,2260 + ,2981 + ,2678 + ,3440 + ,2842 + ,2450 + ,2669 + ,2570 + ,2540 + ,2318 + ,2930 + ,2947 + ,2799 + ,2695 + ,2498 + ,2260 + ,2160 + ,2058 + ,2533 + ,2150 + ,2172 + ,2155 + ,3016 + ,2333 + ,2355 + ,2825 + ,2214 + ,2360 + ,2299 + ,1746 + ,2069 + ,2267 + ,1878 + ,2266 + ,2282 + ,2085 + ,2277 + ,2251 + ,1828 + ,1954 + ,1851 + ,1570 + ,1852 + ,2187 + ,1855 + ,2218 + ,2253 + ,2028 + ,2169 + ,1997 + ,2034 + ,1791 + ,1627 + ,1631 + ,2319 + ,1707 + ,1747 + ,2397 + ,2059 + ,2251 + ,2558 + ,2406 + ,2049 + ,2074 + ,1734 + ,1983 + ,2121 + ,1905 + ,2126 + ,2363 + ,2173 + ,2710 + ,2137 + ,2742 + ,2419 + ,2194 + ,2660 + ,2189 + ,2310 + ,2349 + ,2540 + ,2434 + ,2916 + ,2446 + ,2375 + ,3032 + ,2218 + ,1920 + ,2039 + ,1889 + ,2014 + ,2105 + ,2153 + ,2309 + ,2955 + ,2225 + ,2160 + ,2386 + ,1653 + ,1099 + ,5010 + ,2672 + ,2729 + ,2955 + ,2409 + ,3086 + ,3384 + ,2458 + ,2913 + ,2448 + ,2215 + ,2179 + ,2461 + ,2098 + ,2621 + ,2703 + ,2388 + ,3880 + ,3310 + ,3093 + ,3237 + ,3002 + ,2670 + ,2311 + ,2062 + ,2059 + ,2465 + ,2213 + ,2028 + ,2322 + ,2825 + ,2687 + ,2373 + ,2889 + ,2708 + ,2542 + ,2477 + ,2419 + ,2977 + ,3001 + ,3075 + ,2870 + ,3756 + ,3443 + ,2948 + ,3560 + ,3257 + ,2600 + ,2741 + ,2349 + ,2783 + ,2845 + ,2987 + ,2696 + ,3874 + ,2912 + ,2743 + ,3857 + ,2660 + ,2226 + ,2942 + ,2420 + ,2516 + ,2421 + ,2631 + ,2887 + ,3328 + ,2587 + ,2695 + ,3669 + ,2773 + ,2527 + ,2750 + ,2014 + ,2763 + ,2726 + ,1826 + ,2713 + ,3040 + ,2405 + ,2526 + ,2526 + ,2529 + ,2474 + ,2576 + ,2219 + ,2900 + ,2274 + ,2184 + ,2629 + ,2739 + ,2933 + ,3144 + ,3354 + ,3357 + ,3329) > 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] -205.580409 2.877924 -363.613304 2.801170 -90.455409 -201.391813 [7] 84.814327 403.070906 94.785819 50.055556 285.415205 -62.779971 > postscript(file="/var/www/rcomp/tmp/1d2tv1293638644.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/2d2tv1293638644.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/3ntag1293638644.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/4gkrj1293638644.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/5j38o1293638644.tab") > > try(system("convert tmp/1d2tv1293638644.ps tmp/1d2tv1293638644.png",intern=TRUE)) character(0) > try(system("convert tmp/2d2tv1293638644.ps tmp/2d2tv1293638644.png",intern=TRUE)) character(0) > try(system("convert tmp/3ntag1293638644.ps tmp/3ntag1293638644.png",intern=TRUE)) character(0) > try(system("convert tmp/4gkrj1293638644.ps tmp/4gkrj1293638644.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.580 0.780 3.358