Home » date » 2008 » May » 30 »

opgave9(oefening2)

R Software Module: rwasp_decompose.wasp (opens new window with default values)
Title produced by software: Classical Decomposition
Date of computation: Fri, 30 May 2008 02:40:02 -0600
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf.htm/, Retrieved Fri, 30 May 2008 08:40:56 +0000
 
User-defined keywords:
Inleiding tot kwantitatief onderzoek
 
Dataseries X:
» Textbox « » Textfile « » CSV «
107,5 107,5 113,3 107,8 104,5 105,1 104,2 106,6 103,8 107,7 106,4 110 113,2 113,9 112 113,9 113,1 111,7 110,7 113,5 114 112,7 112,2 115,8 118,4 118,8 123,9 118 120,2 118,7 119,8 124,8 121,3 120,2 118,3 129,6 130,2 127,19 133,1 129,12 123,28 123,36 124,13 126,96 127,14 123,7 123,67 130,19 134,01 124,96 129,96 128,32 132,38 126,25 128,91 131,42 129,44 126,86 126,71 131,63 132,78 126,61 132,84 123,14 128,13 125,49 126,48 130,86 127,32 126,56 126,64 129,26 126,47 135,38 135,5 132,22 122,62 125,16 128,5 133,86 128,87 125,07 125,25 132,16 130,24
 
Text written by user:
Kara Van den Acker
 
Output produced by software:


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time13 seconds
R Server'George Udny Yule' @ 72.249.76.132


Classical Decomposition by Moving Averages
tObservationsFitTrendSeasonalRandom
1107.5NANA3.97399305555556NA
2107.5NANA0.160159722222218NA
3113.3NANA3.82999305555555NA
4107.8NANA-0.387173611111118NA
5104.5NANA0.208993055555552NA
6105.1NANA-2.43817361111111NA
7104.2105.465576388889107.270833333333-1.80525694444444-1.26557638888887
8106.6109.184159722222107.7751.40915972222222-2.58415972222221
9103.8107.353826388889107.9875-0.633673611111113-3.55382638888888
10107.7105.369326388889108.1875-2.818173611111112.33067361111114
11106.4105.249826388889108.8-3.550173611111111.15017361111111
12110111.483659722222109.4333333333332.05032638888890-1.4836597222222
13113.2113.953159722222109.9791666666673.97399305555556-0.753159722222222
14113.9110.697659722222110.53750.1601597222222183.20234027777779
15112115.079993055556111.253.82999305555555-3.07999305555553
16113.9111.496159722222111.883333333333-0.3871736111111182.40384027777779
17113.1112.542326388889112.3333333333330.2089930555555520.557673611111113
18111.7110.378493055556112.816666666667-2.438173611111111.32150694444447
19110.7111.469743055556113.275-1.80525694444444-0.769743055555537
20113.5115.104993055556113.6958333333331.40915972222222-1.60499305555552
21114113.762159722222114.395833333333-0.6336736111111130.237840277777778
22112.7112.244326388889115.0625-2.818173611111110.455673611111109
23112.2111.978993055556115.529166666667-3.550173611111110.221006944444454
24115.8118.166993055556116.1166666666672.05032638888890-2.36699305555554
25118.4120.761493055556116.78753.97399305555556-2.36149305555554
26118.8117.797659722222117.63750.1601597222222181.00234027777776
27123.9122.242493055556118.41253.829993055555551.65750694444445
28118118.641993055556119.029166666667-0.387173611111118-0.641993055555545
29120.2119.804826388889119.5958333333330.2089930555555520.395173611111105
30118.7117.986826388889120.425-2.438173611111110.713173611111117
31119.8119.686409722222121.491666666667-1.805256944444440.113590277777789
32124.8123.742076388889122.3329166666671.409159722222221.05792361111112
33121.3122.432159722222123.065833333333-0.633673611111113-1.13215972222220
34120.2121.094326388889123.9125-2.81817361111111-0.894326388888885
35118.3120.953993055556124.504166666667-3.55017361111111-2.65399305555553
36129.6126.876993055556124.8266666666672.050326388888902.72300694444445
37130.2129.175243055556125.201253.973993055555561.02475694444445
38127.19125.631826388889125.4716666666670.1601597222222181.55817361111113
39133.1129.634993055556125.8053.829993055555553.46500694444447
40129.12125.806993055556126.194166666667-0.3871736111111183.31300694444445
41123.28126.772743055556126.563750.208993055555552-3.49274305555554
42123.36124.373909722222126.812083333333-2.43817361111111-1.01390972222221
43124.13125.190159722222126.995416666667-1.80525694444444-1.06015972222224
44126.96128.470409722222127.061251.40915972222222-1.51040972222222
45127.14126.203826388889126.8375-0.6336736111111130.936173611111101
46123.7123.855159722222126.673333333333-2.81817361111111-0.155159722222209
47123.67123.468993055556127.019166666667-3.550173611111110.20100694444443
48130.19129.569076388889127.518752.050326388888900.620923611111124
49134.01131.812326388889127.8383333333333.973993055555562.19767361111113
50124.96128.383493055556128.2233333333330.160159722222218-3.42349305555553
51129.96132.334993055556128.5053.82999305555555-2.37499305555554
52128.32128.345326388889128.7325-0.387173611111118-0.0253263888888853
53132.38129.199826388889128.9908333333330.2089930555555523.18017361111114
54126.25126.739326388889129.1775-2.43817361111111-0.489326388888884
55128.91127.380993055556129.18625-1.805256944444441.52900694444446
56131.42130.612909722222129.203751.409159722222220.807090277777775
57129.44128.758826388889129.3925-0.6336736111111130.68117361111112
58126.86126.478493055556129.296666666667-2.818173611111110.381506944444453
59126.71125.353576388889128.90375-3.550173611111111.35642361111113
60131.63130.745326388889128.6952.050326388888900.88467361111114
61132.78132.536076388889128.5620833333333.973993055555560.243923611111143
62126.61128.597659722222128.43750.160159722222218-1.98765972222222
63132.84132.155826388889128.3258333333333.829993055555550.684173611111106
64123.14127.837826388889128.225-0.387173611111118-4.69782638888887
65128.13128.418576388889128.2095833333330.208993055555552-0.288576388888870
66125.49125.669743055556128.107916666667-2.43817361111111-0.179743055555548
67126.48125.940993055556127.74625-1.805256944444440.539006944444466
68130.86129.257909722222127.848751.409159722222221.60209027777779
69127.32127.691326388889128.325-0.633673611111113-0.371326388888889
70126.56125.995993055556128.814166666667-2.818173611111110.564006944444458
71126.64125.412743055556128.962916666667-3.550173611111111.22725694444446
72129.26130.769909722222128.7195833333332.05032638888890-1.50990972222220
73126.47132.763993055556128.793.97399305555556-6.29399305555556
74135.38129.159326388889128.9991666666670.1601597222222186.22067361111112
75135.5133.018743055556129.188753.829993055555552.48125694444448
76132.22128.804076388889129.19125-0.3871736111111183.41592361111111
77122.62129.280243055556129.071250.208993055555552-6.66024305555551
78125.16126.695993055556129.134166666667-2.43817361111111-1.53599305555555
79128.5127.606826388889129.412083333333-1.805256944444440.89317361111111
80133.86NANA1.40915972222222NA
81128.87NANA-0.633673611111113NA
82125.07NANA-2.81817361111111NA
83125.25NANA-3.55017361111111NA
84132.16NANA2.05032638888890NA
85130.24NANANANA
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/1c7791212136788.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/1c7791212136788.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/2p55i1212136788.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/2p55i1212136788.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/3x1pc1212136788.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/3x1pc1212136788.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/4pr9g1212136788.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/May/30/t12121368503owbbuwxn5g5nqf/4pr9g1212136788.ps (open in new window)


 
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,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='mytable.tab')
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by