Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_decompose.wasp
Title produced by softwareClassical Decomposition
Date of computationFri, 25 Nov 2016 13:57:13 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Nov/25/t1480082272l3p27832jcvutlv.htm/, Retrieved Mon, 20 May 2024 00:36:55 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Mon, 20 May 2024 00:36:55 +0200
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact0
Dataseries X:
180
215
264
197
262
191
200
221
211
212
304
191
255
273
248
196
261
230
278
245
244
276
281
215
269
231
290
248
294
250
272
196
204
293
243
228
238
219
185
211
171
129
145
142
169
152
141
146
119
141
150
111
83
107
104
81
106
113
86
131





Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ yule.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 2 seconds \tabularnewline
R Server & 'George Udny Yule' @ yule.wessa.net \tabularnewline
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ yule.wessa.net[/C][/ROW]
[ROW][C]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ yule.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1180NANA10.224NA
2215NANA8.43229NA
3264NANA13.2344NA
4197NANA-11.3906NA
5262NANA2.66146NA
6191NANA-17.6927NA
7200224.693223.7920.901042-24.6927
8221208.891229.333-20.442712.1094
9211218.599231.083-12.4844-7.59896
10212246.224230.37515.849-34.224
11304257.901230.29227.609446.099
12191214.974231.875-16.901-23.974
13255246.974236.7510.2248.02604
14273249.4322418.4322923.5677
15248256.609243.37513.2344-8.60937
16196236.026247.417-11.3906-40.026
17261251.786249.1252.661469.21354
18230231.474249.167-17.6927-1.47396
19278251.651250.750.90104226.349
20245229.141249.583-20.442715.8594
21244237.099249.583-12.48446.90104
22276269.349253.515.8496.65104
23281284.651257.04227.6094-3.65104
24215242.349259.25-16.901-27.349
25269270.057259.83310.224-1.05729
26231265.974257.5428.43229-34.974
27290267.068253.83313.234422.9323
28248241.484252.875-11.39066.51563
29294254.6612522.6614639.3385
30250233.266250.958-17.692716.7344
31272251.109250.2080.90104220.8906
32196227.974248.417-20.4427-31.974
33204231.057243.542-12.4844-27.0573
34293253.474237.62515.84939.526
35243258.568230.95827.6094-15.5677
36228203.891220.792-16.90124.1094
37238220.682210.45810.22417.3177
38219211.349202.9178.432297.65104
39185212.443199.20813.2344-27.4427
40211180.484191.875-11.390630.5156
41171184.411181.752.66146-13.4115
42129156.391174.083-17.6927-27.3906
43145166.609165.7080.901042-21.6094
44142137.057157.5-20.44274.94271
45169140.307152.792-12.484428.6927
46152163.016147.16715.849-11.0156
47141166.943139.33327.6094-25.9427
48146117.849134.75-16.90128.151
49119142.349132.12510.224-23.349
50141136.307127.8758.432294.69271
51150135.943122.70813.234414.0573
52111107.068118.458-11.39063.93229
5383117.203114.5422.66146-34.2031
5410793.9323111.625-17.692713.0677
55104NANA0.901042NA
5681NANA-20.4427NA
57106NANA-12.4844NA
58113NANA15.849NA
5986NANA27.6094NA
60131NANA-16.901NA

\begin{tabular}{lllllllll}
\hline
Classical Decomposition by Moving Averages \tabularnewline
t & Observations & Fit & Trend & Seasonal & Random \tabularnewline
1 & 180 & NA & NA & 10.224 & NA \tabularnewline
2 & 215 & NA & NA & 8.43229 & NA \tabularnewline
3 & 264 & NA & NA & 13.2344 & NA \tabularnewline
4 & 197 & NA & NA & -11.3906 & NA \tabularnewline
5 & 262 & NA & NA & 2.66146 & NA \tabularnewline
6 & 191 & NA & NA & -17.6927 & NA \tabularnewline
7 & 200 & 224.693 & 223.792 & 0.901042 & -24.6927 \tabularnewline
8 & 221 & 208.891 & 229.333 & -20.4427 & 12.1094 \tabularnewline
9 & 211 & 218.599 & 231.083 & -12.4844 & -7.59896 \tabularnewline
10 & 212 & 246.224 & 230.375 & 15.849 & -34.224 \tabularnewline
11 & 304 & 257.901 & 230.292 & 27.6094 & 46.099 \tabularnewline
12 & 191 & 214.974 & 231.875 & -16.901 & -23.974 \tabularnewline
13 & 255 & 246.974 & 236.75 & 10.224 & 8.02604 \tabularnewline
14 & 273 & 249.432 & 241 & 8.43229 & 23.5677 \tabularnewline
15 & 248 & 256.609 & 243.375 & 13.2344 & -8.60937 \tabularnewline
16 & 196 & 236.026 & 247.417 & -11.3906 & -40.026 \tabularnewline
17 & 261 & 251.786 & 249.125 & 2.66146 & 9.21354 \tabularnewline
18 & 230 & 231.474 & 249.167 & -17.6927 & -1.47396 \tabularnewline
19 & 278 & 251.651 & 250.75 & 0.901042 & 26.349 \tabularnewline
20 & 245 & 229.141 & 249.583 & -20.4427 & 15.8594 \tabularnewline
21 & 244 & 237.099 & 249.583 & -12.4844 & 6.90104 \tabularnewline
22 & 276 & 269.349 & 253.5 & 15.849 & 6.65104 \tabularnewline
23 & 281 & 284.651 & 257.042 & 27.6094 & -3.65104 \tabularnewline
24 & 215 & 242.349 & 259.25 & -16.901 & -27.349 \tabularnewline
25 & 269 & 270.057 & 259.833 & 10.224 & -1.05729 \tabularnewline
26 & 231 & 265.974 & 257.542 & 8.43229 & -34.974 \tabularnewline
27 & 290 & 267.068 & 253.833 & 13.2344 & 22.9323 \tabularnewline
28 & 248 & 241.484 & 252.875 & -11.3906 & 6.51563 \tabularnewline
29 & 294 & 254.661 & 252 & 2.66146 & 39.3385 \tabularnewline
30 & 250 & 233.266 & 250.958 & -17.6927 & 16.7344 \tabularnewline
31 & 272 & 251.109 & 250.208 & 0.901042 & 20.8906 \tabularnewline
32 & 196 & 227.974 & 248.417 & -20.4427 & -31.974 \tabularnewline
33 & 204 & 231.057 & 243.542 & -12.4844 & -27.0573 \tabularnewline
34 & 293 & 253.474 & 237.625 & 15.849 & 39.526 \tabularnewline
35 & 243 & 258.568 & 230.958 & 27.6094 & -15.5677 \tabularnewline
36 & 228 & 203.891 & 220.792 & -16.901 & 24.1094 \tabularnewline
37 & 238 & 220.682 & 210.458 & 10.224 & 17.3177 \tabularnewline
38 & 219 & 211.349 & 202.917 & 8.43229 & 7.65104 \tabularnewline
39 & 185 & 212.443 & 199.208 & 13.2344 & -27.4427 \tabularnewline
40 & 211 & 180.484 & 191.875 & -11.3906 & 30.5156 \tabularnewline
41 & 171 & 184.411 & 181.75 & 2.66146 & -13.4115 \tabularnewline
42 & 129 & 156.391 & 174.083 & -17.6927 & -27.3906 \tabularnewline
43 & 145 & 166.609 & 165.708 & 0.901042 & -21.6094 \tabularnewline
44 & 142 & 137.057 & 157.5 & -20.4427 & 4.94271 \tabularnewline
45 & 169 & 140.307 & 152.792 & -12.4844 & 28.6927 \tabularnewline
46 & 152 & 163.016 & 147.167 & 15.849 & -11.0156 \tabularnewline
47 & 141 & 166.943 & 139.333 & 27.6094 & -25.9427 \tabularnewline
48 & 146 & 117.849 & 134.75 & -16.901 & 28.151 \tabularnewline
49 & 119 & 142.349 & 132.125 & 10.224 & -23.349 \tabularnewline
50 & 141 & 136.307 & 127.875 & 8.43229 & 4.69271 \tabularnewline
51 & 150 & 135.943 & 122.708 & 13.2344 & 14.0573 \tabularnewline
52 & 111 & 107.068 & 118.458 & -11.3906 & 3.93229 \tabularnewline
53 & 83 & 117.203 & 114.542 & 2.66146 & -34.2031 \tabularnewline
54 & 107 & 93.9323 & 111.625 & -17.6927 & 13.0677 \tabularnewline
55 & 104 & NA & NA & 0.901042 & NA \tabularnewline
56 & 81 & NA & NA & -20.4427 & NA \tabularnewline
57 & 106 & NA & NA & -12.4844 & NA \tabularnewline
58 & 113 & NA & NA & 15.849 & NA \tabularnewline
59 & 86 & NA & NA & 27.6094 & NA \tabularnewline
60 & 131 & NA & NA & -16.901 & NA \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=1

[TABLE]
[ROW][C]Classical Decomposition by Moving Averages[/C][/ROW]
[ROW][C]t[/C][C]Observations[/C][C]Fit[/C][C]Trend[/C][C]Seasonal[/C][C]Random[/C][/ROW]
[ROW][C]1[/C][C]180[/C][C]NA[/C][C]NA[/C][C]10.224[/C][C]NA[/C][/ROW]
[ROW][C]2[/C][C]215[/C][C]NA[/C][C]NA[/C][C]8.43229[/C][C]NA[/C][/ROW]
[ROW][C]3[/C][C]264[/C][C]NA[/C][C]NA[/C][C]13.2344[/C][C]NA[/C][/ROW]
[ROW][C]4[/C][C]197[/C][C]NA[/C][C]NA[/C][C]-11.3906[/C][C]NA[/C][/ROW]
[ROW][C]5[/C][C]262[/C][C]NA[/C][C]NA[/C][C]2.66146[/C][C]NA[/C][/ROW]
[ROW][C]6[/C][C]191[/C][C]NA[/C][C]NA[/C][C]-17.6927[/C][C]NA[/C][/ROW]
[ROW][C]7[/C][C]200[/C][C]224.693[/C][C]223.792[/C][C]0.901042[/C][C]-24.6927[/C][/ROW]
[ROW][C]8[/C][C]221[/C][C]208.891[/C][C]229.333[/C][C]-20.4427[/C][C]12.1094[/C][/ROW]
[ROW][C]9[/C][C]211[/C][C]218.599[/C][C]231.083[/C][C]-12.4844[/C][C]-7.59896[/C][/ROW]
[ROW][C]10[/C][C]212[/C][C]246.224[/C][C]230.375[/C][C]15.849[/C][C]-34.224[/C][/ROW]
[ROW][C]11[/C][C]304[/C][C]257.901[/C][C]230.292[/C][C]27.6094[/C][C]46.099[/C][/ROW]
[ROW][C]12[/C][C]191[/C][C]214.974[/C][C]231.875[/C][C]-16.901[/C][C]-23.974[/C][/ROW]
[ROW][C]13[/C][C]255[/C][C]246.974[/C][C]236.75[/C][C]10.224[/C][C]8.02604[/C][/ROW]
[ROW][C]14[/C][C]273[/C][C]249.432[/C][C]241[/C][C]8.43229[/C][C]23.5677[/C][/ROW]
[ROW][C]15[/C][C]248[/C][C]256.609[/C][C]243.375[/C][C]13.2344[/C][C]-8.60937[/C][/ROW]
[ROW][C]16[/C][C]196[/C][C]236.026[/C][C]247.417[/C][C]-11.3906[/C][C]-40.026[/C][/ROW]
[ROW][C]17[/C][C]261[/C][C]251.786[/C][C]249.125[/C][C]2.66146[/C][C]9.21354[/C][/ROW]
[ROW][C]18[/C][C]230[/C][C]231.474[/C][C]249.167[/C][C]-17.6927[/C][C]-1.47396[/C][/ROW]
[ROW][C]19[/C][C]278[/C][C]251.651[/C][C]250.75[/C][C]0.901042[/C][C]26.349[/C][/ROW]
[ROW][C]20[/C][C]245[/C][C]229.141[/C][C]249.583[/C][C]-20.4427[/C][C]15.8594[/C][/ROW]
[ROW][C]21[/C][C]244[/C][C]237.099[/C][C]249.583[/C][C]-12.4844[/C][C]6.90104[/C][/ROW]
[ROW][C]22[/C][C]276[/C][C]269.349[/C][C]253.5[/C][C]15.849[/C][C]6.65104[/C][/ROW]
[ROW][C]23[/C][C]281[/C][C]284.651[/C][C]257.042[/C][C]27.6094[/C][C]-3.65104[/C][/ROW]
[ROW][C]24[/C][C]215[/C][C]242.349[/C][C]259.25[/C][C]-16.901[/C][C]-27.349[/C][/ROW]
[ROW][C]25[/C][C]269[/C][C]270.057[/C][C]259.833[/C][C]10.224[/C][C]-1.05729[/C][/ROW]
[ROW][C]26[/C][C]231[/C][C]265.974[/C][C]257.542[/C][C]8.43229[/C][C]-34.974[/C][/ROW]
[ROW][C]27[/C][C]290[/C][C]267.068[/C][C]253.833[/C][C]13.2344[/C][C]22.9323[/C][/ROW]
[ROW][C]28[/C][C]248[/C][C]241.484[/C][C]252.875[/C][C]-11.3906[/C][C]6.51563[/C][/ROW]
[ROW][C]29[/C][C]294[/C][C]254.661[/C][C]252[/C][C]2.66146[/C][C]39.3385[/C][/ROW]
[ROW][C]30[/C][C]250[/C][C]233.266[/C][C]250.958[/C][C]-17.6927[/C][C]16.7344[/C][/ROW]
[ROW][C]31[/C][C]272[/C][C]251.109[/C][C]250.208[/C][C]0.901042[/C][C]20.8906[/C][/ROW]
[ROW][C]32[/C][C]196[/C][C]227.974[/C][C]248.417[/C][C]-20.4427[/C][C]-31.974[/C][/ROW]
[ROW][C]33[/C][C]204[/C][C]231.057[/C][C]243.542[/C][C]-12.4844[/C][C]-27.0573[/C][/ROW]
[ROW][C]34[/C][C]293[/C][C]253.474[/C][C]237.625[/C][C]15.849[/C][C]39.526[/C][/ROW]
[ROW][C]35[/C][C]243[/C][C]258.568[/C][C]230.958[/C][C]27.6094[/C][C]-15.5677[/C][/ROW]
[ROW][C]36[/C][C]228[/C][C]203.891[/C][C]220.792[/C][C]-16.901[/C][C]24.1094[/C][/ROW]
[ROW][C]37[/C][C]238[/C][C]220.682[/C][C]210.458[/C][C]10.224[/C][C]17.3177[/C][/ROW]
[ROW][C]38[/C][C]219[/C][C]211.349[/C][C]202.917[/C][C]8.43229[/C][C]7.65104[/C][/ROW]
[ROW][C]39[/C][C]185[/C][C]212.443[/C][C]199.208[/C][C]13.2344[/C][C]-27.4427[/C][/ROW]
[ROW][C]40[/C][C]211[/C][C]180.484[/C][C]191.875[/C][C]-11.3906[/C][C]30.5156[/C][/ROW]
[ROW][C]41[/C][C]171[/C][C]184.411[/C][C]181.75[/C][C]2.66146[/C][C]-13.4115[/C][/ROW]
[ROW][C]42[/C][C]129[/C][C]156.391[/C][C]174.083[/C][C]-17.6927[/C][C]-27.3906[/C][/ROW]
[ROW][C]43[/C][C]145[/C][C]166.609[/C][C]165.708[/C][C]0.901042[/C][C]-21.6094[/C][/ROW]
[ROW][C]44[/C][C]142[/C][C]137.057[/C][C]157.5[/C][C]-20.4427[/C][C]4.94271[/C][/ROW]
[ROW][C]45[/C][C]169[/C][C]140.307[/C][C]152.792[/C][C]-12.4844[/C][C]28.6927[/C][/ROW]
[ROW][C]46[/C][C]152[/C][C]163.016[/C][C]147.167[/C][C]15.849[/C][C]-11.0156[/C][/ROW]
[ROW][C]47[/C][C]141[/C][C]166.943[/C][C]139.333[/C][C]27.6094[/C][C]-25.9427[/C][/ROW]
[ROW][C]48[/C][C]146[/C][C]117.849[/C][C]134.75[/C][C]-16.901[/C][C]28.151[/C][/ROW]
[ROW][C]49[/C][C]119[/C][C]142.349[/C][C]132.125[/C][C]10.224[/C][C]-23.349[/C][/ROW]
[ROW][C]50[/C][C]141[/C][C]136.307[/C][C]127.875[/C][C]8.43229[/C][C]4.69271[/C][/ROW]
[ROW][C]51[/C][C]150[/C][C]135.943[/C][C]122.708[/C][C]13.2344[/C][C]14.0573[/C][/ROW]
[ROW][C]52[/C][C]111[/C][C]107.068[/C][C]118.458[/C][C]-11.3906[/C][C]3.93229[/C][/ROW]
[ROW][C]53[/C][C]83[/C][C]117.203[/C][C]114.542[/C][C]2.66146[/C][C]-34.2031[/C][/ROW]
[ROW][C]54[/C][C]107[/C][C]93.9323[/C][C]111.625[/C][C]-17.6927[/C][C]13.0677[/C][/ROW]
[ROW][C]55[/C][C]104[/C][C]NA[/C][C]NA[/C][C]0.901042[/C][C]NA[/C][/ROW]
[ROW][C]56[/C][C]81[/C][C]NA[/C][C]NA[/C][C]-20.4427[/C][C]NA[/C][/ROW]
[ROW][C]57[/C][C]106[/C][C]NA[/C][C]NA[/C][C]-12.4844[/C][C]NA[/C][/ROW]
[ROW][C]58[/C][C]113[/C][C]NA[/C][C]NA[/C][C]15.849[/C][C]NA[/C][/ROW]
[ROW][C]59[/C][C]86[/C][C]NA[/C][C]NA[/C][C]27.6094[/C][C]NA[/C][/ROW]
[ROW][C]60[/C][C]131[/C][C]NA[/C][C]NA[/C][C]-16.901[/C][C]NA[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1180NANA10.224NA
2215NANA8.43229NA
3264NANA13.2344NA
4197NANA-11.3906NA
5262NANA2.66146NA
6191NANA-17.6927NA
7200224.693223.7920.901042-24.6927
8221208.891229.333-20.442712.1094
9211218.599231.083-12.4844-7.59896
10212246.224230.37515.849-34.224
11304257.901230.29227.609446.099
12191214.974231.875-16.901-23.974
13255246.974236.7510.2248.02604
14273249.4322418.4322923.5677
15248256.609243.37513.2344-8.60937
16196236.026247.417-11.3906-40.026
17261251.786249.1252.661469.21354
18230231.474249.167-17.6927-1.47396
19278251.651250.750.90104226.349
20245229.141249.583-20.442715.8594
21244237.099249.583-12.48446.90104
22276269.349253.515.8496.65104
23281284.651257.04227.6094-3.65104
24215242.349259.25-16.901-27.349
25269270.057259.83310.224-1.05729
26231265.974257.5428.43229-34.974
27290267.068253.83313.234422.9323
28248241.484252.875-11.39066.51563
29294254.6612522.6614639.3385
30250233.266250.958-17.692716.7344
31272251.109250.2080.90104220.8906
32196227.974248.417-20.4427-31.974
33204231.057243.542-12.4844-27.0573
34293253.474237.62515.84939.526
35243258.568230.95827.6094-15.5677
36228203.891220.792-16.90124.1094
37238220.682210.45810.22417.3177
38219211.349202.9178.432297.65104
39185212.443199.20813.2344-27.4427
40211180.484191.875-11.390630.5156
41171184.411181.752.66146-13.4115
42129156.391174.083-17.6927-27.3906
43145166.609165.7080.901042-21.6094
44142137.057157.5-20.44274.94271
45169140.307152.792-12.484428.6927
46152163.016147.16715.849-11.0156
47141166.943139.33327.6094-25.9427
48146117.849134.75-16.90128.151
49119142.349132.12510.224-23.349
50141136.307127.8758.432294.69271
51150135.943122.70813.234414.0573
52111107.068118.458-11.39063.93229
5383117.203114.5422.66146-34.2031
5410793.9323111.625-17.692713.0677
55104NANA0.901042NA
5681NANA-20.4427NA
57106NANA-12.4844NA
58113NANA15.849NA
5986NANA27.6094NA
60131NANA-16.901NA



Parameters (Session):
par1 = additive ; par2 = 12 ;
Parameters (R input):
par1 = additive ; par2 = 12 ;
R code (references can be found in the software module):
par2 <- as.numeric(par2)
x <- ts(x,freq=par2)
m <- decompose(x,type=par1)
m$figure
bitmap(file='test1.png')
plot(m)
dev.off()
mylagmax <- length(x)/2
bitmap(file='test2.png')
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()
bitmap(file='test3.png')
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()
bitmap(file='test4.png')
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()
load(file='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,signif(m$trend[i]+m$seasonal[i],6)) else a<-table.element(a,signif(m$trend[i]*m$seasonal[i],6))
a<-table.element(a,signif(m$trend[i],6))
a<-table.element(a,signif(m$seasonal[i],6))
a<-table.element(a,signif(m$random[i],6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')