Home » date » 2010 » Dec » 21 »

Recursive partioning ws10

*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, 21 Dec 2010 11:57:35 +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/21/t1292932924i87rx86zt3xs6ur.htm/, Retrieved Tue, 21 Dec 2010 13:02:25 +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/21/t1292932924i87rx86zt3xs6ur.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 «
4321023 29790 444 81767 1 1 4111912 87550 412 153198 1 1 223193 84738 428 -26007 0 1 1491348 54660 315 126942 1 1 1629616 42634 168 157214 1 0 1398893 40949 263 129352 0 1 1926517 45187 267 234817 1 0 983660 37704 228 60448 1 1 1443586 16275 129 47818 1 1 1073089 25830 104 245546 0 1 984885 12679 122 48020 0 1 1405225 18014 393 -1710 1 1 227132 43556 190 32648 0 1 929118 24811 280 95350 1 1 1071292 6575 63 151352 0 0 638830 7123 102 288170 0 0 856956 21950 265 114337 1 1 992426 37597 234 37884 1 1 444477 17821 277 122844 0 1 857217 12988 73 82340 1 1 711969 22330 67 79801 1 0 702380 13326 103 165548 0 0 358589 16189 290 116384 0 1 297978 7146 83 134028 0 1 585715 15824 56 63838 0 1 657954 27664 236 74996 1 1 209458 11920 73 31080 0 1 786690 8568 34 32168 0 1 439798 14416 139 49857 0 1 688779 3369 26 87161 1 1 574339 11819 70 106113 1 1 741409 6984 40 80570 1 0 597793 4519 42 102129 1 1 644190 2220 12 301670 0 1 377934 18562 211 102313 0 1 640273 10327 74 88577 0 1 697458 53 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 time19 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Goodness of Fit
Correlation0.661
R-squared0.437
RMSE242501.1618


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
143210231587931.909090912733091.09090909
241119121587931.909090912523980.09090909
32231931587931.90909091-1364738.90909091
414913481587931.90909091-96583.9090909092
51629616686454.736842105943161.263157895
613988931587931.90909091-189038.909090909
719265171587931.90909091338585.090909091
8983660686454.736842105297205.263157895
91443586686454.736842105757131.263157895
101073089686454.736842105386634.263157895
11984885686454.736842105298430.263157895
1214052251587931.90909091-182706.909090909
13227132686454.736842105-459322.736842105
149291181587931.90909091-658813.909090909
151071292436863.25862069634428.74137931
16638830436863.25862069201966.741379310
178569561587931.90909091-730975.909090909
18992426686454.736842105305971.263157895
194444771587931.90909091-1143454.90909091
20857217686454.736842105170762.263157895
21711969686454.73684210525514.2631578947
22702380686454.73684210515925.2631578947
233585891587931.90909091-1229342.90909091
24297978436863.25862069-138885.258620690
25585715686454.736842105-100739.736842105
26657954686454.736842105-28500.7368421053
27209458311459.00877193-102001.008771930
28786690311459.00877193475230.99122807
29439798686454.736842105-246656.736842105
30688779436863.25862069251915.74137931
31574339436863.25862069137475.741379310
32741409311459.00877193429949.99122807
33597793436863.25862069160929.741379310
34644190436863.25862069207326.741379310
35377934686454.736842105-308520.736842105
36640273436863.25862069203409.741379310
37697458436863.25862069260594.741379310
38550608436863.25862069113744.741379310
39207393311459.00877193-104066.008771930
40301607436863.25862069-135256.258620690
41345783686454.736842105-340671.736842105
42501749436863.2586206964885.7413793103
43379983436863.25862069-56880.2586206897
44387475311459.0087719376015.9912280702
45377305436863.25862069-59558.2586206897
46370837436863.25862069-66026.2586206897
47430866436863.25862069-5997.25862068968
48469107436863.2586206932243.7413793103
49194493311459.00877193-116966.008771930
50530670436863.2586206993806.7413793103
51518365436863.2586206981501.7413793103
52491303436863.2586206954439.7413793103
53527021436863.2586206990157.7413793103
54233773436863.25862069-203090.258620690
55405972311459.0087719394512.9912280702
56652925311459.00877193341465.99122807
57446211436863.258620699347.74137931032
58341340436863.25862069-95523.2586206897
59387699436863.25862069-49164.2586206897
60493408436863.2586206956544.7413793103
61146494311459.00877193-164965.00877193
62414462436863.25862069-22401.2586206897
63364304311459.0087719352844.9912280702
64355178311459.0087719343718.9912280702
65357760686454.736842105-328694.736842105
66261216311459.00877193-50243.0087719298
67397144436863.25862069-39719.2586206897
68374943436863.25862069-61920.2586206897
69424898436863.25862069-11965.2586206897
70202055311459.00877193-109404.008771930
71378525311459.0087719367065.9912280702
72310768436863.25862069-126095.258620690
73325738311459.0087719314278.9912280702
74394510436863.25862069-42353.2586206897
75247060311459.00877193-64399.0087719298
76368078436863.25862069-68785.2586206897
77236761311459.00877193-74698.0087719298
78312378311459.00877193918.991228070168
79339836436863.25862069-97027.2586206897
80347385311459.0087719335925.9912280702
81426280436863.25862069-10583.2586206897
82352850436863.25862069-84013.2586206897
83301881311459.00877193-9578.00877192983
84377516436863.25862069-59347.2586206897
85357312311459.0087719345852.9912280702
86458343436863.2586206921479.7413793103
87354228436863.25862069-82635.2586206897
88308636436863.25862069-128227.258620690
89386212436863.25862069-50651.2586206897
90393343436863.25862069-43520.2586206897
91378509311459.0087719367049.9912280702
92452469311459.00877193141009.99122807
93364839436863.25862069-72024.2586206897
94358649311459.0087719347189.9912280702
95376641311459.0087719365181.9912280702
96429112436863.25862069-7751.25862068968
97330546311459.0087719319086.9912280702
98403560436863.25862069-33303.2586206897
99317892311459.008771936432.99122807017
100307528311459.00877193-3931.00877192983
101235133436863.25862069-201730.258620690
102299243436863.25862069-137620.258620690
103314073436863.25862069-122790.258620690
104368186311459.0087719356726.9912280702
105269661311459.00877193-41798.0087719298
106125390311459.00877193-186069.008771930
107510834436863.2586206973970.7413793103
108321896436863.25862069-114967.258620690
109249898311459.00877193-61561.0087719298
110408881311459.0087719397421.9912280702
111158492311459.00877193-152967.00877193
112292154311459.00877193-19305.0087719298
113289513311459.00877193-21946.0087719298
114378049311459.0087719366589.9912280702
115343466311459.0087719332006.9912280702
116332743311459.0087719321283.9912280702
117442882436863.258620696018.74137931032
118214215311459.00877193-97244.0087719298
119315688311459.008771934228.99122807017
120375195436863.25862069-61668.2586206897
121334280311459.0087719322820.9912280702
122355864436863.25862069-80999.2586206897
123480382436863.2586206943518.7413793103
124353058311459.0087719341598.9912280702
125217193311459.00877193-94266.0087719298
126315380311459.008771933920.99122807017
127314533311459.008771933073.99122807017
128318056311459.008771936596.99122807017
129315380311459.008771933920.99122807017
130314353311459.008771932893.99122807017
131369448311459.0087719357988.9912280702
132315380311459.008771933920.99122807017
133312846311459.008771931386.99122807017
134312075311459.00877193615.991228070168
135315009311459.008771933549.99122807017
136318903311459.008771937443.99122807017
137314887311459.008771933427.99122807017
138314913311459.008771933453.99122807017
139315380311459.008771933920.99122807017
140325506311459.0087719314046.9912280702
141315380311459.008771933920.99122807017
142298568311459.00877193-12891.0087719298
143315834311459.008771934374.99122807017
144329784311459.0087719318324.9912280702
145312878311459.008771931418.99122807017
146315380311459.008771933920.99122807017
147314987311459.008771933527.99122807017
148325249311459.0087719313789.9912280702
149315877311459.008771934417.99122807017
150291650311459.00877193-19809.0087719298
151305959311459.00877193-5500.00877192983
152315380311459.008771933920.99122807017
153297765311459.00877193-13694.0087719298
154315245311459.008771933785.99122807017
155315380311459.008771933920.99122807017
156315380311459.008771933920.99122807017
157315236311459.008771933776.99122807017
158336425311459.0087719324965.9912280702
159315380311459.008771933920.99122807017
160315380311459.008771933920.99122807017
161315380311459.008771933920.99122807017
162315380311459.008771933920.99122807017
163306268311459.00877193-5191.00877192983
164302187311459.00877193-9272.00877192983
165314882311459.008771933422.99122807017
166315380311459.008771933920.99122807017
167382712311459.0087719371252.9912280702
168341570311459.0087719330110.9912280702
169315380311459.008771933920.99122807017
170315380311459.008771933920.99122807017
171312412311459.00877193952.991228070168
172315380311459.008771933920.99122807017
173309596311459.00877193-1863.00877192983
174315380311459.008771933920.99122807017
175315547311459.008771934087.99122807017
176313267311459.008771931807.99122807017
177316176311459.008771934716.99122807017
178315380311459.008771933920.99122807017
179315380311459.008771933920.99122807017
180359335311459.0087719347875.9912280702
181330068311459.0087719318608.9912280702
182314289311459.008771932829.99122807017
183297413311459.00877193-14046.0087719298
184314806311459.008771933346.99122807017
185333210311459.0087719321750.9912280702
186352108311459.0087719340648.9912280702
187313332311459.008771931872.99122807017
188291787311459.00877193-19672.0087719298
189315380311459.008771933920.99122807017
190318745311459.008771937285.99122807017
191315380311459.008771933920.99122807017
192315366311459.008771933906.99122807017
193315380311459.008771933920.99122807017
194315688311459.008771934228.99122807017
195315380311459.008771933920.99122807017
196409642436863.25862069-27221.2586206897
197315380311459.008771933920.99122807017
198315380311459.008771933920.99122807017
199269587311459.00877193-41872.0087719298
200315380311459.008771933920.99122807017
201315380311459.008771933920.99122807017
202315380311459.008771933920.99122807017
203300962311459.00877193-10497.0087719298
204325479436863.25862069-111384.258620690
205316155311459.008771934695.99122807017
206318574311459.008771937114.99122807017
207315380311459.008771933920.99122807017
208343613311459.0087719332153.9912280702
209306948311459.00877193-4511.00877192983
210315380311459.008771933920.99122807017
211315380311459.008771933920.99122807017
212330059311459.0087719318599.9912280702
213288985311459.00877193-22474.0087719298
214304485311459.00877193-6974.00877192983
215315380311459.008771933920.99122807017
216315688311459.008771934228.99122807017
217317736311459.008771936276.99122807017
218315380311459.008771933920.99122807017
219322331311459.0087719310871.9912280702
220296656311459.00877193-14803.0087719298
221315380311459.008771933920.99122807017
222315354311459.008771933894.99122807017
223312161311459.00877193701.991228070168
224315576311459.008771934116.99122807017
225314922311459.008771933462.99122807017
226314551311459.008771933091.99122807017
227315380311459.008771933920.99122807017
228312339311459.00877193879.991228070168
229315380311459.008771933920.99122807017
230298700311459.00877193-12759.0087719298
231321376311459.008771939916.99122807017
232315380311459.008771933920.99122807017
233303230311459.00877193-8229.00877192983
234315380311459.008771933920.99122807017
235315487311459.008771934027.99122807017
236315380311459.008771933920.99122807017
237315793311459.008771934333.99122807017
238315380311459.008771933920.99122807017
239315380311459.008771933920.99122807017
240315380311459.008771933920.99122807017
241312887311459.008771931427.99122807017
242315380311459.008771933920.99122807017
243315637311459.008771934177.99122807017
244324385311459.0087719312925.9912280702
245315380311459.008771933920.99122807017
246315380311459.008771933920.99122807017
247308989311459.00877193-2470.00877192983
248315380311459.008771933920.99122807017
249315380311459.008771933920.99122807017
250296702311459.00877193-14757.0087719298
251315380311459.008771933920.99122807017
252307322311459.00877193-4137.00877192983
253304376311459.00877193-7083.00877192983
254253588311459.00877193-57871.0087719298
255315380311459.008771933920.99122807017
256309560311459.00877193-1899.00877192983
257298466311459.00877193-12993.0087719298
258315380311459.008771933920.99122807017
259315380311459.008771933920.99122807017
260315380311459.008771933920.99122807017
261315380311459.008771933920.99122807017
262343929311459.0087719332469.9912280702
263331955311459.0087719320495.9912280702
264315380311459.008771933920.99122807017
265315380311459.008771933920.99122807017
266315380311459.008771933920.99122807017
267381180311459.0087719369720.9912280702
268315380311459.008771933920.99122807017
269331420311459.0087719319960.9912280702
270315380311459.008771933920.99122807017
271315380311459.008771933920.99122807017
272315380311459.008771933920.99122807017
273310201311459.00877193-1258.00877192983
274315380311459.008771933920.99122807017
275320016311459.008771938556.99122807017
276320398311459.008771938938.99122807017
277315380311459.008771933920.99122807017
278291841311459.00877193-19618.0087719298
279310670311459.00877193-789.008771929832
280315380311459.008771933920.99122807017
281315380311459.008771933920.99122807017
282313491311459.008771932031.99122807017
283315380311459.008771933920.99122807017
284331323311459.0087719319863.9912280702
285315380311459.008771933920.99122807017
286319210311459.008771937750.99122807017
287318098311459.008771936638.99122807017
288315380311459.008771933920.99122807017
289292754311459.00877193-18705.0087719298
290315380311459.008771933920.99122807017
291325176311459.0087719313716.9912280702
292365959311459.0087719354499.9912280702
293315380311459.008771933920.99122807017
294302409311459.00877193-9050.00877192983
295340968311459.0087719329508.9912280702
296315380311459.008771933920.99122807017
297315380311459.008771933920.99122807017
298315380311459.008771933920.99122807017
299315380311459.008771933920.99122807017
300313164311459.008771931704.99122807017
301301164311459.00877193-10295.0087719298
302315380311459.008771933920.99122807017
303315380311459.008771933920.99122807017
304344425311459.0087719332965.9912280702
305315394311459.008771933934.99122807017
306315380311459.008771933920.99122807017
307316647311459.008771935187.99122807017
308309836311459.00877193-1623.00877192983
309315380311459.008771933920.99122807017
310315380311459.008771933920.99122807017
311346611436863.25862069-90252.2586206897
312315380311459.008771933920.99122807017
313322031311459.0087719310571.9912280702
314315656311459.008771934196.99122807017
315339445311459.0087719327985.9912280702
316314964311459.008771933504.99122807017
317297141311459.00877193-14318.0087719298
318315372311459.008771933912.99122807017
319315380311459.008771933920.99122807017
320315380311459.008771933920.99122807017
321315380311459.008771933920.99122807017
322315380311459.008771933920.99122807017
323315380311459.008771933920.99122807017
324315380311459.008771933920.99122807017
325312502311459.008771931042.99122807017
326315380311459.008771933920.99122807017
327315380311459.008771933920.99122807017
328315380311459.008771933920.99122807017
329315380311459.008771933920.99122807017
330315380311459.008771933920.99122807017
331315380311459.008771933920.99122807017
332315380311459.008771933920.99122807017
333313729311459.008771932269.99122807017
334315388311459.008771933928.99122807017
335315371311459.008771933911.99122807017
336296139311459.00877193-15320.0087719298
337315380311459.008771933920.99122807017
338313880311459.008771932420.99122807017
339317698311459.008771936238.99122807017
340295580311459.00877193-15879.0087719298
341315380311459.008771933920.99122807017
342315380311459.008771933920.99122807017
343315380311459.008771933920.99122807017
344308256311459.00877193-3203.00877192983
345315380311459.008771933920.99122807017
346303677311459.00877193-7782.00877192983
347315380311459.008771933920.99122807017
348315380311459.008771933920.99122807017
349319369311459.008771937909.99122807017
350318690311459.008771937230.99122807017
351314049311459.008771932589.99122807017
352325699311459.0087719314239.9912280702
353314210311459.008771932750.99122807017
354315380311459.008771933920.99122807017
355315380311459.008771933920.99122807017
356322378311459.0087719310918.9912280702
357315380311459.008771933920.99122807017
358315380311459.008771933920.99122807017
359315380311459.008771933920.99122807017
360315398311459.008771933938.99122807017
361315380311459.008771933920.99122807017
362315380311459.008771933920.99122807017
363308336311459.00877193-3123.00877192983
364316386311459.008771934926.99122807017
365315380311459.008771933920.99122807017
366315380311459.008771933920.99122807017
367315380311459.008771933920.99122807017
368315380311459.008771933920.99122807017
369315553311459.008771934093.99122807017
370315380311459.008771933920.99122807017
371323361311459.0087719311901.9912280702
372336639311459.0087719325179.9912280702
373307424311459.00877193-4035.00877192983
374315380311459.008771933920.99122807017
375315380311459.008771933920.99122807017
376295370311459.00877193-16089.0087719298
377322340311459.0087719310880.9912280702
378319864311459.008771938404.99122807017
379315380311459.008771933920.99122807017
380315380311459.008771933920.99122807017
381317291311459.008771935831.99122807017
382280398311459.00877193-31061.0087719298
383315380311459.008771933920.99122807017
384317330311459.008771935870.99122807017
385238125311459.00877193-73334.0087719298
386327071311459.0087719315611.9912280702
387309038311459.00877193-2421.00877192983
388314210311459.008771932750.99122807017
389307930311459.00877193-3529.00877192983
390322327311459.0087719310867.9912280702
391292136311459.00877193-19323.0087719298
392263276311459.00877193-48183.0087719298
393367655311459.0087719356195.9912280702
394283910311459.00877193-27549.0087719298
395283587311459.00877193-27872.0087719298
396243650311459.00877193-67809.0087719298
397438493436863.258620691629.74137931032
398296261311459.00877193-15198.0087719298
399230621311459.00877193-80838.0087719298
400304252311459.00877193-7207.00877192983
401333505311459.0087719322045.9912280702
402296919311459.00877193-14540.0087719298
403278990311459.00877193-32469.0087719298
404276898311459.00877193-34561.0087719298
405327007311459.0087719315547.9912280702
406317046311459.008771935586.99122807017
407304555311459.00877193-6904.00877192983
408298096311459.00877193-13363.0087719298
409231861311459.00877193-79598.0087719298
410309422311459.00877193-2037.00877192983
411286963311459.00877193-24496.0087719298
412269753311459.00877193-41706.0087719298
413448243311459.00877193136783.99122807
414165404311459.00877193-146055.00877193
415204325311459.00877193-107134.008771930
416407159311459.0087719395699.9912280702
417290476311459.00877193-20983.0087719298
418275311311459.00877193-36148.0087719298
419246541311459.00877193-64918.0087719298
420253468311459.00877193-57991.0087719298
421240897311459.00877193-70562.0087719298
422-83265311459.00877193-394724.00877193
423-42143311459.00877193-353602.00877193
424272713311459.00877193-38746.0087719298
425215362311459.00877193-96097.0087719298
42642754311459.00877193-268705.00877193
427306275686454.736842105-380179.736842105
428253537311459.00877193-57922.0087719298
429372631686454.736842105-313823.736842105
430-7170686454.736842105-693624.736842105
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/24qtn1292932635.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/24qtn1292932635.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/3xha71292932635.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/3xha71292932635.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/4p9ra1292932635.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292932924i87rx86zt3xs6ur/4p9ra1292932635.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = none ; par3 = 6 ; par4 = no ;
 
Parameters (R input):
par1 = 1 ; par2 = none ; par3 = 6 ; par4 = no ;
 
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