Home » date » 2010 » Dec » 28 »

berekening 8

*The author of this computation has been verified*
R Software Module: /rwasp_regression_trees1.wasp (opens new window with default values)
Title produced by software: Recursive Partitioning (Regression Trees)
Date of computation: Tue, 28 Dec 2010 13:49:51 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0.htm/, Retrieved Tue, 28 Dec 2010 14:48:48 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
1 1595 17 60720 319369 0 5565 47 94355 493408 0 601 6 60720 319210 1 188 11 77655 381180 1 7146 105 134028 297978 0 1135 17 62285 290476 1 450 8 59325 292136 1 34 8 60630 314353 1 133 14 65990 339445 1 119 6 59118 303677 0 2053 53 100423 397144 0 4036 63 100269 424898 1 0 0 60720 315380 1 4655 393 60720 341570 1 131 11 61808 308989 1 1766 73 60438 305959 1 312 14 58598 318690 1 448 40 59781 323361 1 115 13 60945 318903 1 60 10 61124 314049 1 0 0 60720 315380 1 364 35 47705 298466 1 0 0 60720 315380 0 1442 118 121173 438493 0 1389 9 57530 378049 1 149 5 62041 313332 1 2212 14 60720 319864 0 7489 322 136996 430866 1 0 0 60720 315380 1 402 26 84990 332743 0 7419 29 63255 286963 1 0 0 60720 315380 1 307 15 58856 331955 0 1134 162 146216 527021 0 7561 87 82425 364304 1 5131 71 86111 292154 1 9 6 60835 314987 1 2264 24 55174 272713 1 40949 481 129352 1398893 0 4980 91 113521 409642 1 272 8 112995 429112 1 757 19 45689 382712 1 1424 94 131116 374943 1 0 0 60720 315380 0 37 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time11 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Goodness of Fit
Correlation0.6588
R-squared0.434
RMSE323514.9255


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
1319369311459.008771937909.99122807017
2493408436863.2586206956544.7413793103
3319210311459.008771937750.99122807017
4381180311459.0087719369720.9912280702
5297978436863.25862069-138885.258620690
6290476311459.00877193-20983.0087719298
7292136311459.00877193-19323.0087719298
8314353311459.008771932893.99122807017
9339445311459.0087719327985.9912280702
10303677311459.00877193-7782.00877192983
11397144436863.25862069-39719.2586206897
12424898436863.25862069-11965.2586206897
13315380311459.008771933920.99122807017
14341570311459.0087719330110.9912280702
15308989311459.00877193-2470.00877192983
16305959311459.00877193-5500.00877192983
17318690311459.008771937230.99122807017
18323361311459.0087719311901.9912280702
19318903311459.008771937443.99122807017
20314049311459.008771932589.99122807017
21315380311459.008771933920.99122807017
22298466311459.00877193-12993.0087719298
23315380311459.008771933920.99122807017
24438493436863.258620691629.74137931032
25378049311459.0087719366589.9912280702
26313332311459.008771931872.99122807017
27319864311459.008771938404.99122807017
28430866436863.25862069-5997.25862068968
29315380311459.008771933920.99122807017
30332743311459.0087719321283.9912280702
31286963311459.00877193-24496.0087719298
32315380311459.008771933920.99122807017
33331955311459.0087719320495.9912280702
34527021436863.2586206990157.7413793103
35364304311459.0087719352844.9912280702
36292154311459.00877193-19305.0087719298
37314987311459.008771933527.99122807017
38272713311459.00877193-38746.0087719298
3913988931991179.08333333-592286.083333333
40409642436863.25862069-27221.2586206897
41429112436863.25862069-7751.25862068968
42382712311459.0087719371252.9912280702
43374943436863.25862069-61920.2586206897
44315380311459.008771933920.99122807017
45297413311459.00877193-14046.0087719298
46304252311459.00877193-7207.00877192983
47315380311459.008771933920.99122807017
48309596311459.00877193-1863.00877192983
49377305436863.25862069-59558.2586206897
50386212436863.25862069-50651.2586206897
51657954678836.631578947-20882.6315789474
52368186311459.0087719356726.9912280702
53269753311459.00877193-41706.0087719298
54585715678836.631578947-93121.6315789474
551071292436863.25862069634428.74137931
569924261991179.08333333-998753.083333333
57315371311459.008771933911.99122807017
58249898311459.00877193-61561.0087719298
59357312311459.0087719345852.9912280702
60315380311459.008771933920.99122807017
61315380311459.008771933920.99122807017
62364839436863.25862069-72024.2586206897
63230621311459.00877193-80838.0087719298
64315877311459.008771934417.99122807017
65125390311459.00877193-186069.00877193
66314882311459.008771933422.99122807017
67370837436863.25862069-66026.2586206897
68330068311459.0087719318608.9912280702
69324385311459.0087719312925.9912280702
70315380311459.008771933920.99122807017
711443586678836.631578947764749.368421053
72253537311459.00877193-57922.0087719298
7343210231991179.083333332329843.91666667
74315380311459.008771933920.99122807017
75352108311459.0087719340648.9912280702
76330059311459.0087719318599.9912280702
77340968311459.0087719329508.9912280702
78317736311459.008771936276.99122807017
79209458311459.00877193-102001.008771930
8014913481991179.08333333-499831.083333333
81314887311459.008771933427.99122807017
82315380311459.008771933920.99122807017
83315380311459.008771933920.99122807017
84353058311459.0087719341598.9912280702
85315380311459.008771933920.99122807017
86315380311459.008771933920.99122807017
87314533311459.008771933073.99122807017
88315354311459.008771933894.99122807017
89302187311459.00877193-9272.00877192983
90336639311459.0087719325179.9912280702
91315380311459.008771933920.99122807017
92296702311459.00877193-14757.0087719298
931073089678836.631578947394252.368421053
94146494311459.00877193-164965.008771930
95325249311459.0087719313789.9912280702
96331420311459.0087719319960.9912280702
97315380311459.008771933920.99122807017
98314922311459.008771933462.99122807017
99320016311459.008771938556.99122807017
100280398311459.00877193-31061.0087719298
101452469311459.00877193141009.991228070
102301164311459.00877193-10295.0087719298
103317330311459.008771935870.99122807017
104315576311459.008771934116.99122807017
105315380311459.008771933920.99122807017
106-7170678836.631578947-686006.631578947
107322331311459.0087719310871.9912280702
10816296161991179.08333333-361563.083333333
109292754311459.00877193-18705.0087719298
110318056311459.008771936596.99122807017
111355178311459.0087719343718.9912280702
112204325311459.00877193-107134.008771930
113315380311459.008771933920.99122807017
114317046311459.008771935586.99122807017
115315380311459.008771933920.99122807017
116309560311459.00877193-1899.00877192983
117414462436863.25862069-22401.2586206897
118857217678836.631578947178380.368421053
119697458436863.25862069260594.741379310
120530670436863.2586206993806.7413793103
121238125311459.00877193-73334.0087719298
122315380311459.008771933920.99122807017
123741409311459.00877193429949.99122807
124393343436863.25862069-43520.2586206897
125372631678836.631578947-306205.631578947
126315380311459.008771933920.99122807017
127317291311459.008771935831.99122807017
128315380311459.008771933920.99122807017
1293062751991179.08333333-1684904.08333333
130317892311459.008771936432.99122807017
131334280311459.0087719322820.9912280702
132315380311459.008771933920.99122807017
133315380311459.008771933920.99122807017
134315380311459.008771933920.99122807017
135314210311459.008771932750.99122807017
136306948311459.00877193-4511.00877192983
137315380311459.008771933920.99122807017
138320398311459.008771938938.99122807017
139315380311459.008771933920.99122807017
140315380311459.008771933920.99122807017
141501749436863.2586206964885.7413793103
142202055311459.00877193-109404.008771930
143315380311459.008771933920.99122807017
144315380311459.008771933920.99122807017
145333210311459.0087719321750.9912280702
146315380311459.008771933920.99122807017
147322340311459.0087719310880.9912280702
148369448311459.0087719357988.9912280702
149291841311459.00877193-19618.0087719298
150315380311459.008771933920.99122807017
151315380311459.008771933920.99122807017
152296919311459.00877193-14540.0087719298
153315380311459.008771933920.99122807017
154309038311459.00877193-2421.00877192983
155246541311459.00877193-64918.0087719298
156289513311459.00877193-21946.0087719298
157344425311459.0087719332965.9912280702
158315380311459.008771933920.99122807017
159314210311459.008771932750.99122807017
160480382436863.2586206943518.7413793103
161315009311459.008771933549.99122807017
162315380311459.008771933920.99122807017
163312878311459.008771931418.99122807017
164322031311459.0087719310571.9912280702
165315380311459.008771933920.99122807017
166597793436863.25862069160929.741379310
167315380311459.008771933920.99122807017
168315688311459.008771934228.99122807017
169378525311459.0087719367065.9912280702
170312378311459.00877193918.991228070168
171403560436863.25862069-33303.2586206897
172510834436863.2586206973970.7413793103
173214215311459.00877193-97244.0087719298
174235133436863.25862069-201730.258620690
175343613311459.0087719332153.9912280702
176365959311459.0087719354499.9912280702
177315380311459.008771933920.99122807017
178314551311459.008771933091.99122807017
179303230311459.00877193-8229.00877192983
180315380311459.008771933920.99122807017
181469107436863.2586206932243.7413793103
182354228436863.25862069-82635.2586206897
183315380311459.008771933920.99122807017
184315380311459.008771933920.99122807017
185315380311459.008771933920.99122807017
186315394311459.008771933934.99122807017
187312412311459.00877193952.991228070168
188333505311459.0087719322045.9912280702
1892231931991179.08333333-1767986.08333333
190315380311459.008771933920.99122807017
191315656311459.008771934196.99122807017
192296261311459.00877193-15198.0087719298
193315380311459.008771933920.99122807017
194336425311459.0087719324965.9912280702
195359335311459.0087719347875.9912280702
196315380311459.008771933920.99122807017
197308636436863.25862069-128227.258620690
198158492311459.00877193-152967.008771930
199315380311459.008771933920.99122807017
200315380311459.008771933920.99122807017
201711969678836.63157894733132.3684210526
202315380311459.008771933920.99122807017
203315380311459.008771933920.99122807017
204306268311459.00877193-5191.00877192983
205315380311459.008771933920.99122807017
206442882436863.258620696018.74137931032
207378509311459.0087719367049.9912280702
208315380311459.008771933920.99122807017
209346611436863.25862069-90252.2586206897
210314289311459.008771932829.99122807017
211856956678836.631578947178119.368421053
212217193311459.00877193-94266.0087719298
213315366311459.008771933906.99122807017
214307930311459.00877193-3529.00877192983
215702380678836.63157894723543.3684210526
216194493311459.00877193-116966.008771930
217316155311459.008771934695.99122807017
218315380311459.008771933920.99122807017
219330546311459.0087719319086.9912280702
220394510436863.25862069-42353.2586206897
221312846311459.008771931386.99122807017
222315380311459.008771933920.99122807017
223296139311459.00877193-15320.0087719298
224295580311459.00877193-15879.0087719298
225297765311459.00877193-13694.0087719298
226377934678836.631578947-300902.631578947
227315380311459.008771933920.99122807017
228638830436863.25862069201966.741379310
229304376311459.00877193-7083.00877192983
230307424311459.00877193-4035.00877192983
231644190436863.25862069207326.741379310
232295370311459.00877193-16089.0087719298
233574339436863.25862069137475.741379310
234315380311459.008771933920.99122807017
235310201311459.00877193-1258.00877192983
236327007311459.0087719315547.9912280702
237343466311459.0087719332006.9912280702
238315380311459.008771933920.99122807017
239315380311459.008771933920.99122807017
240318098311459.008771936638.99122807017
241448243311459.00877193136783.991228070
242325738311459.0087719314278.9912280702
243315380311459.008771933920.99122807017
244312161311459.00877193701.991228070168
245243650311459.00877193-67809.0087719298
246407159311459.0087719395699.9912280702
247315380311459.008771933920.99122807017
248317698311459.008771936238.99122807017
249315380311459.008771933920.99122807017
250312502311459.008771931042.99122807017
251315380311459.008771933920.99122807017
252322378311459.0087719310918.9912280702
253315380311459.008771933920.99122807017
254315380311459.008771933920.99122807017
255315380311459.008771933920.99122807017
256315380311459.008771933920.99122807017
257315380311459.008771933920.99122807017
258315380311459.008771933920.99122807017
259640273436863.25862069203409.741379310
260345783678836.631578947-333053.631578947
261652925311459.00877193341465.99122807
262439798678836.631578947-239038.631578947
263278990311459.00877193-32469.0087719298
264339836436863.25862069-97027.2586206897
265240897311459.00877193-70562.0087719298
266315380311459.008771933920.99122807017
267297141311459.00877193-14318.0087719298
268315380311459.008771933920.99122807017
269331323311459.0087719319863.9912280702
270313880311459.008771932420.99122807017
271315380311459.008771933920.99122807017
272315380311459.008771933920.99122807017
273309422311459.00877193-2037.00877192983
274315245311459.008771933785.99122807017
275405972311459.0087719394512.9912280702
276300962311459.00877193-10497.0087719298
277316176311459.008771934716.99122807017
278302409311459.00877193-9050.00877192983
279283587311459.00877193-27872.0087719298
280263276311459.00877193-48183.0087719298
281312075311459.00877193615.991228070168
282308336311459.00877193-3123.00877192983
283315380311459.008771933920.99122807017
284298700311459.00877193-12759.0087719298
285315372311459.008771933912.99122807017
286318745311459.008771937285.99122807017
287315380311459.008771933920.99122807017
288408881311459.0087719397421.9912280702
289786690311459.00877193475230.99122807
290-83265311459.00877193-394724.00877193
291315380311459.008771933920.99122807017
292321376311459.008771939916.99122807017
293315380311459.008771933920.99122807017
294276898311459.00877193-34561.0087719298
295315547311459.008771934087.99122807017
296315487311459.008771934027.99122807017
297315380311459.008771933920.99122807017
2981405225678836.631578947726388.368421053
299315380311459.008771933920.99122807017
300315380311459.008771933920.99122807017
3019836601991179.08333333-1007519.08333333
302318574311459.008771937114.99122807017
303310768436863.25862069-126095.258620690
304312887311459.008771931427.99122807017
305312339311459.00877193879.991228070168
306314964311459.008771933504.99122807017
307379983436863.25862069-56880.2586206897
308315380311459.008771933920.99122807017
309315380311459.008771933920.99122807017
310315398311459.008771933938.99122807017
311315380311459.008771933920.99122807017
312253588311459.00877193-57871.0087719298
313316647311459.008771935187.99122807017
314315688311459.008771934228.99122807017
315310670311459.00877193-789.008771929832
316165404311459.00877193-146055.008771930
31741119121991179.083333332120732.91666667
318291650311459.00877193-19809.0087719298
319315380311459.008771933920.99122807017
320253468311459.00877193-57991.0087719298
321315688311459.008771934228.99122807017
322325699311459.0087719314239.9912280702
323446211436863.258620699347.74137931032
324315380311459.008771933920.99122807017
325368078436863.25862069-68785.2586206897
326315380311459.008771933920.99122807017
327352850436863.25862069-84013.2586206897
32862821541991179.083333334290974.91666667
3292271321991179.08333333-1764047.08333333
330283910311459.00877193-27549.0087719298
331236761311459.00877193-74698.0087719298
332315380311459.008771933920.99122807017
333315380311459.008771933920.99122807017
334550608436863.25862069113744.741379310
335307528311459.00877193-3931.00877192983
336315380311459.008771933920.99122807017
337355864436863.25862069-80999.2586206897
338358589678836.631578947-320247.631578947
339315380311459.008771933920.99122807017
340315380311459.008771933920.99122807017
341375195436863.25862069-61668.2586206897
342288985311459.00877193-22474.0087719298
343315380311459.008771933920.99122807017
344458343436863.2586206921479.7413793103
345315380311459.008771933920.99122807017
346269587311459.00877193-41872.0087719298
347315236311459.008771933776.99122807017
34842754311459.00877193-268705.00877193
349315380311459.008771933920.99122807017
350308256311459.00877193-3203.00877192983
351315380311459.008771933920.99122807017
352315380311459.008771933920.99122807017
353313164311459.008771931704.99122807017
354315380311459.008771933920.99122807017
355269661311459.00877193-41798.0087719298
356315380311459.008771933920.99122807017
357315380311459.008771933920.99122807017
358315380311459.008771933920.99122807017
359315380311459.008771933920.99122807017
360518365436863.2586206981501.7413793103
361233773436863.25862069-203090.258620690
362301881311459.00877193-9578.00877192983
363298568311459.00877193-12891.0087719298
364325479436863.25862069-111384.258620690
365325506311459.0087719314046.9912280702
366984885678836.631578947306048.368421053
367313267311459.008771931807.99122807017
368315793311459.008771934333.99122807017
369315380311459.008771933920.99122807017
370215362311459.00877193-96097.0087719298
371314073436863.25862069-122790.258620690
372298096311459.00877193-13363.0087719298
373325176311459.0087719313716.9912280702
374207393311459.00877193-104066.008771930
375314806311459.008771933346.99122807017
376341340436863.25862069-95523.2586206897
377426280436863.25862069-10583.2586206897
378929118678836.631578947250281.368421053
379307322311459.00877193-4137.00877192983
380315380311459.008771933920.99122807017
381387475311459.0087719376015.9912280702
382291787311459.00877193-19672.0087719298
383247060311459.00877193-64399.0087719298
384329784311459.0087719318324.9912280702
385315834311459.008771934374.99122807017
386304555311459.00877193-6904.00877192983
387376641311459.0087719365181.9912280702
388315380311459.008771933920.99122807017
389315380311459.008771933920.99122807017
390315380311459.008771933920.99122807017
391315380311459.008771933920.99122807017
392315380311459.008771933920.99122807017
393357760678836.631578947-321076.631578947
394315637311459.008771934177.99122807017
395315380311459.008771933920.99122807017
396315380311459.008771933920.99122807017
397315380311459.008771933920.99122807017
398315380311459.008771933920.99122807017
399327071311459.0087719315611.9912280702
400377516436863.25862069-59347.2586206897
401299243436863.25862069-137620.258620690
402387699436863.25862069-49164.2586206897
403309836311459.00877193-1623.00877192983
404444477678836.631578947-234359.631578947
405322327311459.0087719310867.9912280702
406314913311459.008771933453.99122807017
407315553311459.008771934093.99122807017
408688779436863.25862069251915.741379310
409321896436863.25862069-114967.258620690
410301607436863.25862069-135256.258620690
411304485311459.00877193-6974.00877192983
412315380311459.008771933920.99122807017
413315380311459.008771933920.99122807017
414231861311459.00877193-79598.0087719298
415347385311459.0087719335925.9912280702
416316386311459.008771934926.99122807017
417491303436863.2586206954439.7413793103
418261216311459.00877193-50243.0087719298
419315388311459.008771933928.99122807017
420315380311459.008771933920.99122807017
421313729311459.008771932269.99122807017
422358649311459.0087719347189.9912280702
42319265171991179.08333333-64662.0833333333
424296656311459.00877193-14803.0087719298
425275311311459.00877193-36148.0087719298
426-42143311459.00877193-353602.00877193
427315380311459.008771933920.99122807017
428343929311459.0087719332469.9912280702
429367655311459.0087719356195.9912280702
430315380311459.008771933920.99122807017
431313491311459.008771932031.99122807017
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/2zymj1293544177.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/2zymj1293544177.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/3zymj1293544177.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/3zymj1293544177.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/4spl41293544177.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t12935441289srk8f63xrgurj0/4spl41293544177.ps (open in new window)


 
Parameters (Session):
par1 = 5 ; par2 = none ; par4 = no ; par5 = 1 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
 
Parameters (R input):
par1 = 5 ; par2 = none ; par4 = no ; par5 = 1 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
 
R code (references can be found in the software module):
library(party)
library(Hmisc)
par1 <- as.numeric(par1)
par3 <- as.numeric(par3)
x <- data.frame(t(y))
is.data.frame(x)
x <- x[!is.na(x[,par1]),]
k <- length(x[1,])
n <- length(x[,1])
colnames(x)[par1]
x[,par1]
if (par2 == 'kmeans') {
cl <- kmeans(x[,par1], par3)
print(cl)
clm <- matrix(cbind(cl$centers,1:par3),ncol=2)
clm <- clm[sort.list(clm[,1]),]
for (i in 1:par3) {
cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='')
}
cl$cluster <- as.factor(cl$cluster)
print(cl$cluster)
x[,par1] <- cl$cluster
}
if (par2 == 'quantiles') {
x[,par1] <- cut2(x[,par1],g=par3)
}
if (par2 == 'hclust') {
hc <- hclust(dist(x[,par1])^2, 'cen')
print(hc)
memb <- cutree(hc, k = par3)
dum <- c(mean(x[memb==1,par1]))
for (i in 2:par3) {
dum <- c(dum, mean(x[memb==i,par1]))
}
hcm <- matrix(cbind(dum,1:par3),ncol=2)
hcm <- hcm[sort.list(hcm[,1]),]
for (i in 1:par3) {
memb[memb==hcm[i,2]] <- paste('C',i,sep='')
}
memb <- as.factor(memb)
print(memb)
x[,par1] <- memb
}
if (par2=='equal') {
ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep=''))
x[,par1] <- as.factor(ed)
}
table(x[,par1])
colnames(x)
colnames(x)[par1]
x[,par1]
if (par2 == 'none') {
m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x)
}
load(file='createtable')
if (par2 != 'none') {
m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x)
if (par4=='yes') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'',1,TRUE)
a<-table.element(a,'Prediction (training)',par3+1,TRUE)
a<-table.element(a,'Prediction (testing)',par3+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Actual',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE)
a<-table.element(a,'CV',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE)
a<-table.element(a,'CV',1,TRUE)
a<-table.row.end(a)
for (i in 1:10) {
ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1))
m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,])
if (i==1) {
m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,])
m.ct.i.actu <- x[ind==1,par1]
m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,])
m.ct.x.actu <- x[ind==2,par1]
} else {
m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,]))
m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1])
m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,]))
m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1])
}
}
print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred))
numer <- 0
for (i in 1:par3) {
print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,]))
numer <- numer + m.ct.i.tab[i,i]
}
print(m.ct.i.cp <- numer / sum(m.ct.i.tab))
print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred))
numer <- 0
for (i in 1:par3) {
print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,]))
numer <- numer + m.ct.x.tab[i,i]
}
print(m.ct.x.cp <- numer / sum(m.ct.x.tab))
for (i in 1:par3) {
a<-table.row.start(a)
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj])
a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4))
for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj])
a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4))
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a,'Overall',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,'-')
a<-table.element(a,round(m.ct.i.cp,4))
for (jjj in 1:par3) a<-table.element(a,'-')
a<-table.element(a,round(m.ct.x.cp,4))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
}
}
m
bitmap(file='test1.png')
plot(m)
dev.off()
bitmap(file='test1a.png')
plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response')
dev.off()
if (par2 == 'none') {
forec <- predict(m)
result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec))
colnames(result) <- c('Actuals','Forecasts','Residuals')
print(result)
}
if (par2 != 'none') {
print(cbind(as.factor(x[,par1]),predict(m)))
myt <- table(as.factor(x[,par1]),predict(m))
print(myt)
}
bitmap(file='test2.png')
if(par2=='none') {
op <- par(mfrow=c(2,2))
plot(density(result$Actuals),main='Kernel Density Plot of Actuals')
plot(density(result$Residuals),main='Kernel Density Plot of Residuals')
plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals')
plot(density(result$Forecasts),main='Kernel Density Plot of Predictions')
par(op)
}
if(par2!='none') {
plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted')
}
dev.off()
if (par2 == 'none') {
detcoef <- cor(result$Forecasts,result$Actuals)
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goodness of Fit',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Correlation',1,TRUE)
a<-table.element(a,round(detcoef,4))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'R-squared',1,TRUE)
a<-table.element(a,round(detcoef*detcoef,4))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'RMSE',1,TRUE)
a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#',header=TRUE)
a<-table.element(a,'Actuals',header=TRUE)
a<-table.element(a,'Forecasts',header=TRUE)
a<-table.element(a,'Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(result$Actuals)) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,result$Actuals[i])
a<-table.element(a,result$Forecasts[i])
a<-table.element(a,result$Residuals[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
}
if (par2 != 'none') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'',1,TRUE)
for (i in 1:par3) {
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
}
a<-table.row.end(a)
for (i in 1:par3) {
a<-table.row.start(a)
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
for (j in 1:par3) {
a<-table.element(a,myt[i,j])
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.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