Home » date » 2010 » Dec » 22 »

*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: Wed, 22 Dec 2010 10:41:46 +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/22/t1293014428k6x4n4d6hqvtj53.htm/, Retrieved Wed, 22 Dec 2010 11:40:32 +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/22/t1293014428k6x4n4d6hqvtj53.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 «
162556 162556 1081 1081 213118 213118 230380558 6282929 29790 29790 309 309 81767 81767 25266003 4324047 87550 87550 458 458 153198 153198 70164684 4108272 84738 0 588 0 -26007 0 -15292116 -1212617 54660 54660 299 299 126942 126942 37955658 1485329 42634 42634 156 156 157214 157214 24525384 1779876 40949 0 481 0 129352 0 62218312 1367203 42312 42312 323 323 234817 234817 75845891 2519076 37704 37704 452 452 60448 60448 27322496 912684 16275 16275 109 109 47818 47818 5212162 1443586 25830 0 115 0 245546 0 28237790 1220017 12679 0 110 0 48020 0 5282200 984885 18014 18014 239 239 -1710 -1710 -408690 1457425 43556 0 247 0 32648 0 8064056 -572920 24524 24524 497 497 95350 95350 47388950 929144 6532 0 103 0 151352 0 15589256 1151176 7123 0 109 0 288170 0 31410530 790090 20813 20813 502 502 114337 114337 57397174 774497 37597 37597 248 248 37884 37884 9395232 990576 17821 0 373 0 122844 0 45820812 454195 12988 12988 119 119 82340 82340 9798460 876607 22330 22330 84 84 79801 79801 6703284 711969 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 time22 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.7658
R-squared0.5865
RMSE287379.1411


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
162829292800348.6253482580.375
243240472800348.6251523698.375
341082722800348.6251307923.375
4-1212617381828-1594445
514853292800348.625-1315019.625
617798762800348.625-1020472.625
71367203802777564426
825190762800348.625-281272.625
99126842800348.625-1887664.625
1014435863818281061758
111220017802777417240
12984885381828603057
1314574253818281075597
14-572920381828-954748
15929144802777126367
161151176706603.625444572.375
17790090706603.62583486.375
18774497802777-28280
199905762800348.625-1809772.625
20454195385829.19047619068365.8095238095
21876607498898.76377708.24
22711969802777-90808
23702380706603.625-4223.625
24264449385829.190476190-121380.190476190
25450033385829.19047619064203.8095238095
26541063381828159235
27588864381828207036
28-37216263925.818181818-301141.818181818
29783310263925.818181818519384.181818182
3046735938182885531
31688779498898.76189880.24
32608419498898.76109520.24
33696348498898.76197449.24
34597793498898.7698894.24
35821730706603.625115126.375
36377934802777-424843
37651939385829.190476190266109.809523810
38697458498898.76198559.24
39700368706603.625-6235.625
40225986385829.190476190-159843.190476190
41348695385829.190476190-37134.1904761905
42373683385829.190476190-12146.1904761905
43501709385829.190476190115879.809523810
44413743385829.19047619027913.8095238095
45379825263925.818181818115899.181818182
46336260498898.76-162638.76
47636765706603.625-69838.625
48481231498898.76-17667.76
49469107385829.19047619083277.8095238095
50211928263925.818181818-51997.8181818182
51563925498898.7665026.24
52511939498898.7613040.24
53521016706603.625-185587.625
54543856498898.7644957.24
55329304706603.625-377299.625
56423262263925.818181818159336.181818182
57509665263925.818181818245739.181818182
58455881385829.19047619070051.8095238095
59367772385829.190476190-18057.1904761905
60406339498898.76-92559.76
61493408498898.76-5490.76000000001
62232942331959.363636364-99017.3636363636
63416002498898.76-82896.76
64337430498898.76-161468.76
65361517263925.81818181897591.1818181818
66360962385829.190476190-24867.1904761905
67235561385829.190476190-150268.190476190
68408247498898.76-90651.76
69450296385829.19047619064466.8095238095
70418799498898.76-80099.76
71247405263925.818181818-16520.8181818182
72378519263925.818181818114593.181818182
73326638385829.190476190-59191.1904761905
74328233331959.363636364-3726.36363636365
75386225385829.190476190395.809523809527
76283662331959.363636364-48297.3636363636
77370225385829.190476190-15604.1904761905
78269236331959.363636364-62723.3636363636
79365732331959.36363636433772.6363636364
80420383385829.19047619034553.8095238095
81345811331959.36363636413851.6363636364
82431809498898.76-67089.76
83418876385829.19047619033046.8095238095
84297476315048.708333333-17572.7083333333
85416776385829.19047619030946.8095238095
86357257263925.81818181893331.1818181818
87458343385829.19047619072513.8095238095
88388386385829.1904761902556.80952380953
89358934385829.190476190-26895.1904761905
90407560385829.19047619021730.8095238095
91392558385829.1904761906728.80952380953
92373177498898.76-125721.76
93428370263925.818181818164444.181818182
94369419498898.76-129479.76
95358649331959.36363636426689.6363636364
96376641263925.818181818112715.181818182
97467427385829.19047619081597.8095238095
98364885331959.36363636432925.6363636364
99436230385829.19047619050400.8095238095
100329118331272.142857143-2154.14285714284
101317365331959.363636364-14594.3636363636
102286849385829.190476190-98980.1904761905
103376685385829.190476190-9144.19047619047
104407198385829.19047619021368.8095238095
105377772331959.36363636445812.6363636364
106271483331959.363636364-60476.3636363636
107153661263925.818181818-110264.818181818
108513294498898.7614395.24
109324881385829.190476190-60948.1904761905
110264512263925.818181818586.181818181823
111420968331959.36363636489008.6363636364
112129302263925.818181818-134623.818181818
113191521385829.190476190-194308.190476190
114268673263925.8181818184747.18181818182
115353179331272.14285714321906.8571428572
116354624331959.36363636422664.6363636364
117363713385829.190476190-22116.1904761905
118456657385829.19047619070827.8095238095
119211742263925.818181818-52183.8181818182
120338381331959.3636363646421.63636363635
121418530385829.19047619032700.8095238095
122351483331959.36363636419523.6363636364
123372928385829.190476190-12901.1904761905
124485538498898.76-13360.76
125279268263925.81818181815342.1818181818
126219060263925.818181818-44865.8181818182
127325560325559.7050359710.294964028755203
128325314324683631
129322046331959.363636364-9913.36363636365
130325560325559.7050359710.294964028755203
131325599324683916
132377028331959.36363636445068.6363636364
133325560325559.7050359710.294964028755203
134323850324683-833
135325560325559.7050359710.294964028755203
136331514321470.10526315810043.8947368421
137325632324683949
138325560325559.7050359710.294964028755203
139325560325559.7050359710.294964028755203
140325560325559.7050359710.294964028755203
141322265321470.105263158794.894736842078
142325560325559.7050359710.294964028755203
143325906315048.70833333310857.2916666667
1443259853246831302
145346145331959.36363636414185.6363636364
146325898321470.1052631584427.89473684208
147325560325559.7050359710.294964028755203
148325356325735.857142857-379.857142857159
149325560325559.7050359710.294964028755203
150325930325735.857142857194.142857142841
151318020315048.7083333332971.29166666669
152326389331959.363636364-5570.36363636365
153325560325559.7050359710.294964028755203
154302925315048.708333333-12123.7083333333
155325540325735.857142857-195.857142857159
156325560325559.7050359710.294964028755203
157325560325559.7050359710.294964028755203
158326736326495241
159340580329643.28571428610936.7142857143
160325560325559.7050359710.294964028755203
161325560325559.7050359710.294964028755203
162325560325559.7050359710.294964028755203
163325560325559.7050359710.294964028755203
164331828331959.363636364-131.363636363647
165323299331959.363636364-8660.36363636365
166325560325559.7050359710.294964028755203
167325560325559.7050359710.294964028755203
168387722331959.36363636455762.6363636364
169325560325559.7050359710.294964028755203
170325560325559.7050359710.294964028755203
171325560325559.7050359710.294964028755203
172324598326495-1897
173325560325559.7050359710.294964028755203
174328726329643.285714286-917.285714285739
175325560325559.7050359710.294964028755203
176325043324683360
177325560325559.7050359710.294964028755203
178325806331272.142857143-5466.14285714284
179325560325559.7050359710.294964028755203
180325560325559.7050359710.294964028755203
181387732331959.36363636455772.6363636364
182349729331272.14285714318456.8571428572
183332202331959.363636364242.636363636353
184305442331272.142857143-25830.1428571428
1853295373264953042
186327055331272.142857143-4217.14285714284
187356245331959.36363636424285.6363636364
188328451329643.285714286-1192.28571428574
189307062324038-16976
190325560325559.7050359710.294964028755203
191331345321470.1052631589874.89473684208
192325560325559.7050359710.294964028755203
193331824329643.2857142862180.71428571426
194325560325559.7050359710.294964028755203
1953256853246831002
196325560325559.7050359710.294964028755203
197404480498898.76-94418.76
198325560325559.7050359710.294964028755203
199325560325559.7050359710.294964028755203
200318314385829.190476190-67515.1904761905
201325560325559.7050359710.294964028755203
202325560325559.7050359710.294964028755203
203325560325559.7050359710.294964028755203
204311807331959.363636364-20152.3636363636
205337724385829.190476190-48105.1904761905
206326431326495-64
2073275563240383518
208325560325559.7050359710.294964028755203
209356850331959.36363636424890.6363636364
210325560325559.7050359710.294964028755203
211325560325559.7050359710.294964028755203
212325560325559.7050359710.294964028755203
213322741331959.363636364-9218.36363636365
214310902331959.363636364-21057.3636363636
215324295315048.7083333339246.29166666669
216325560325559.7050359710.294964028755203
217326156325735.857142857420.142857142841
218326960331959.363636364-4999.36363636365
219325560325559.7050359710.294964028755203
220333411331959.3636363641451.63636363635
221297761321470.105263158-23709.1052631579
222325560325559.7050359710.294964028755203
223325536325735.857142857-199.857142857159
224325560325559.7050359710.294964028755203
225325762325735.85714285726.1428571428405
226327957331959.363636364-4002.36363636365
227325560325559.7050359710.294964028755203
228325560325559.7050359710.294964028755203
229318521324038-5517
230325560325559.7050359710.294964028755203
231319775329643.285714286-9868.28571428574
232325560325559.7050359710.294964028755203
233325560325559.7050359710.294964028755203
234332128331959.363636364168.636363636353
235325560325559.7050359710.294964028755203
236325486325559.705035971-73.7050359712448
237325560325559.7050359710.294964028755203
238325838321470.1052631584367.89473684208
239325560325559.7050359710.294964028755203
240325560325559.7050359710.294964028755203
241325560325559.7050359710.294964028755203
2423317673264955272
243325560325559.7050359710.294964028755203
244324523321470.1052631583052.89473684208
245339995263925.81818181876069.1818181818
246325560325559.7050359710.294964028755203
247325560325559.7050359710.294964028755203
248319582326495-6913
249325560325559.7050359710.294964028755203
250325560325559.7050359710.294964028755203
251307245321470.105263158-14225.1052631579
252325560325559.7050359710.294964028755203
253317967324038-6071
254331488331959.363636364-471.363636363647
255335452385829.190476190-50377.1904761905
256325560325559.7050359710.294964028755203
257334184321470.10526315812713.8947368421
258313213331959.363636364-18746.3636363636
259325560325559.7050359710.294964028755203
260325560325559.7050359710.294964028755203
261325560325559.7050359710.294964028755203
262325560325559.7050359710.294964028755203
263348678331959.36363636416718.6363636364
264328727331959.363636364-3232.36363636365
265325560325559.7050359710.294964028755203
266325560325559.7050359710.294964028755203
267325560325559.7050359710.294964028755203
268387978331959.36363636456018.6363636364
269325560325559.7050359710.294964028755203
27033670432403812666
271325560325559.7050359710.294964028755203
272325560325559.7050359710.294964028755203
273325560325559.7050359710.294964028755203
274322076324683-2607
275325560325559.7050359710.294964028755203
276334272331959.3636363642312.63636363635
277338197331959.3636363646237.63636363635
278325560325559.7050359710.294964028755203
279321024331959.363636364-10935.3636363636
280322145331959.363636364-9814.36363636365
281325560325559.7050359710.294964028755203
282325560325559.7050359710.294964028755203
283323351331959.363636364-8608.36363636365
284325560325559.7050359710.294964028755203
285327748331959.363636364-4211.36363636365
286325560325559.7050359710.294964028755203
287325560325559.7050359710.294964028755203
2883281573264951662
289325560325559.7050359710.294964028755203
290311594331959.363636364-20365.3636363636
291325560325559.7050359710.294964028755203
292335962331959.3636363644002.63636363635
293372426385829.190476190-13403.1904761905
294325560325559.7050359710.294964028755203
295319844321470.105263158-1626.10526315792
296355822331959.36363636423862.6363636364
297325560325559.7050359710.294964028755203
298325560325559.7050359710.294964028755203
299325560325559.7050359710.294964028755203
300325560325559.7050359710.294964028755203
301324047324683-636
302311464321470.105263158-10006.1052631579
303325560325559.7050359710.294964028755203
304325560325559.7050359710.294964028755203
305353417331959.36363636421457.6363636364
306325590325559.70503597130.2949640287552
307325560325559.7050359710.294964028755203
308328576331272.142857143-2696.14285714284
309326126331959.363636364-5833.36363636365
310325560325559.7050359710.294964028755203
311325560325559.7050359710.294964028755203
312369376385829.190476190-16453.1904761905
313325560325559.7050359710.294964028755203
3143320133264955518
315325871325735.857142857135.142857142841
316342165331959.36363636410205.6363636364
317324967321470.1052631583496.89473684208
318314832331959.363636364-17127.3636363636
319325557325559.705035971-2.70503597124480
320325560325559.7050359710.294964028755203
321325560325559.7050359710.294964028755203
322325560325559.7050359710.294964028755203
323325560325559.7050359710.294964028755203
324325560325559.7050359710.294964028755203
325325560325559.7050359710.294964028755203
326322649324683-2034
327325560325559.7050359710.294964028755203
328325560325559.7050359710.294964028755203
329325560325559.7050359710.294964028755203
330325560325559.7050359710.294964028755203
331325560325559.7050359710.294964028755203
332325560325559.7050359710.294964028755203
333325560325559.7050359710.294964028755203
334324598321470.1052631583127.89473684208
335325567325559.7050359717.2949640287552
336325560325559.7050359710.294964028755203
337324005324683-678
338325560325559.7050359710.294964028755203
3393257483246831065
340323385321470.1052631581914.89473684208
341315409331959.363636364-16550.3636363636
342325560325559.7050359710.294964028755203
343325560325559.7050359710.294964028755203
344325560325559.7050359710.294964028755203
345325560325559.7050359710.294964028755203
346325560325559.7050359710.294964028755203
347312275321470.105263158-9195.10526315792
348325560325559.7050359710.294964028755203
349325560325559.7050359710.294964028755203
350325560325559.7050359710.294964028755203
351320576321470.105263158-894.105263157922
352325246324683563
353332961315048.70833333317912.2916666667
354323010329643.285714286-6633.28571428574
355325560325559.7050359710.294964028755203
356325560325559.7050359710.294964028755203
357345253331959.36363636413293.6363636364
358325560325559.7050359710.294964028755203
359325560325559.7050359710.294964028755203
360325560325559.7050359710.294964028755203
361325559325559.705035971-0.705035971244797
362325560325559.7050359710.294964028755203
363325560325559.7050359710.294964028755203
364319634326495-6861
365319951321470.105263158-1519.10526315792
366325560325559.7050359710.294964028755203
367325560325559.7050359710.294964028755203
368325560325559.7050359710.294964028755203
369325560325559.7050359710.294964028755203
370325560325559.7050359710.294964028755203
371325560325559.7050359710.294964028755203
372318519331959.363636364-13440.3636363636
37334322232403819184
374317234324038-6804
375325560325559.7050359710.294964028755203
376325560325559.7050359710.294964028755203
377314025331959.363636364-17934.3636363636
378320249315048.7083333335200.29166666669
379325560325559.7050359710.294964028755203
380325560325559.7050359710.294964028755203
381325560325559.7050359710.294964028755203
382349365331959.36363636417405.6363636364
383289197331959.363636364-42762.3636363636
384325560325559.7050359710.294964028755203
385329245331959.363636364-2714.36363636365
386240869263925.818181818-23056.8181818182
387327182321470.1052631585711.89473684208
388322876315048.7083333337827.29166666669
389323117321470.1052631581646.89473684208
390306351331959.363636364-25608.3636363636
391335137329643.2857142865493.71428571426
392308271315048.708333333-6777.70833333331
393301731315048.708333333-13317.7083333333
394382409315048.70833333367360.2916666667
395279230498898.76-219668.76
396298731315048.708333333-16317.7083333333
397243650263925.818181818-20275.8181818182
398532682498898.7633783.24
399319771315048.7083333334722.29166666669
400171493263925.818181818-92432.8181818182
401347262315048.70833333332213.2916666667
402343945315048.70833333328896.2916666667
403311874315048.708333333-3174.70833333331
404302211331959.363636364-29748.3636363636
405316708315048.7083333331659.29166666669
406333463331959.3636363641503.63636363635
407344282331959.36363636412322.6363636364
408319635315048.7083333334586.29166666669
409301186315048.708333333-13862.7083333333
410300381315048.708333333-14667.7083333333
411318765331959.363636364-13194.3636363636
412286146263925.81818181822220.1818181818
413306844331959.363636364-25115.3636363636
414307705263925.81818181843779.1818181818
415312448315048.708333333-2600.70833333331
416299715315048.708333333-15333.7083333333
417373399263925.818181818109473.181818182
418299446331959.363636364-32513.3636363636
419325586331959.363636364-6373.36363636365
420291221315048.708333333-23827.7083333333
421261173315048.708333333-53875.7083333333
422255027263925.818181818-8898.81818181818
423-78375263925.818181818-342300.818181818
424-58143263925.818181818-322068.818181818
425227033263925.818181818-36892.8181818182
426235098263925.818181818-28827.8181818182
42721267263925.818181818-242658.818181818
428238675802777-564102
429197687263925.818181818-66238.8181818182
43041834138182836513
431-297706381828-679534
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/2rgkq1293014483.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/2rgkq1293014483.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/3rgkq1293014483.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/3rgkq1293014483.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/4jp1b1293014483.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293014428k6x4n4d6hqvtj53/4jp1b1293014483.ps (open in new window)


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