Home » date » 2010 » Dec » 21 »

*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 14:59:48 +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/t1292943507ago2a80urdfvs6w.htm/, Retrieved Tue, 21 Dec 2010 15:58:31 +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/t1292943507ago2a80urdfvs6w.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 1081 213118 6282929 1 309 81767 4324047 1 458 153198 4108272 0 588 -26007 -1212617 1 299 126942 1485329 1 156 157214 1779876 0 481 129352 1367203 1 323 234817 2519076 1 452 60448 912684 1 109 47818 1443586 0 115 245546 1220017 0 110 48020 984885 1 239 -1710 1457425 0 247 32648 -572920 1 497 95350 929144 0 103 151352 1151176 0 109 288170 790090 1 502 114337 774497 1 248 37884 990576 0 373 122844 454195 1 119 82340 876607 1 84 79801 711969 0 102 165548 702380 0 295 116384 264449 0 105 134028 450033 0 64 63838 541063 1 267 74996 588864 0 129 31080 -37216 0 37 32168 783310 0 361 49857 467359 1 28 87161 688779 1 85 106113 608419 1 44 80570 696348 1 49 102129 597793 0 22 301670 821730 0 155 102313 377934 0 91 88577 651939 1 81 112477 697458 1 79 191778 700368 0 145 79804 225986 0 816 128294 348695 0 61 96448 373683 0 226 93811 501709 0 105 117520 413743 0 62 69159 379825 1 24 101792 336260 1 26 210568 636765 1 322 136996 481231 0 84 121920 469107 0 33 76403 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 time17 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.5446
R-squared0.2966
RMSE374807.3694


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
162829291573533.733333334709395.26666667
243240471573533.733333332750513.26666667
341082721573533.733333332534738.26666667
4-12126171573533.73333333-2786150.73333333
514853291573533.73333333-88204.7333333334
61779876808308.818181818971567.181818182
713672031573533.73333333-206330.733333333
825190761573533.73333333945542.266666667
99126841573533.73333333-660849.733333333
101443586620208.315789474823377.684210526
111220017808308.818181818411708.181818182
12984885340884.565217391644000.434782609
131457425620208.315789474837216.684210526
14-572920340884.565217391-913804.565217391
159291441573533.73333333-644389.733333333
161151176808308.818181818342867.181818182
17790090808308.818181818-18218.8181818182
187744971573533.73333333-799036.733333333
19990576620208.315789474370367.684210526
204541951573533.73333333-1119338.73333333
21876607620208.315789474256398.684210526
22711969620208.31578947491760.6842105263
23702380808308.818181818-105928.818181818
24264449340884.565217391-76435.5652173913
25450033340884.565217391109148.434782609
26541063324328.925324675216734.074675325
27588864620208.315789474-31344.3157894737
28-37216340884.565217391-378100.565217391
29783310295013.541666667488296.458333333
304673591573533.73333333-1106174.73333333
31688779417845.838709677270933.161290323
32608419620208.315789474-11789.3157894737
33696348324328.925324675372019.074675325
34597793417845.838709677179947.161290323
35821730808308.81818181813421.1818181818
36377934340884.56521739137049.4347826087
37651939340884.565217391311054.434782609
38697458620208.31578947477249.6842105263
39700368808308.818181818-107940.818181818
40225986340884.565217391-114898.565217391
413486951573533.73333333-1224838.73333333
42373683417845.838709677-44162.8387096774
43501709340884.565217391160824.434782609
44413743340884.56521739172858.4347826087
45379825324328.92532467555496.0746753247
46336260417845.838709677-81585.8387096774
47636765808308.818181818-171543.818181818
484812311573533.73333333-1092302.73333333
49469107340884.565217391128222.434782609
50211928324328.925324675-112400.925324675
51563925620208.315789474-56283.3157894737
52511939620208.315789474-108269.315789474
53521016808308.818181818-287292.818181818
54543856620208.315789474-76352.3157894737
55329304808308.818181818-479004.818181818
56423262340884.56521739182377.4347826087
57509665295013.541666667214651.458333333
58455881417845.83870967738035.1612903226
59367772340884.56521739126887.4347826087
60406339620208.315789474-213869.315789474
61493408417845.83870967775562.1612903226
62232942324328.925324675-91386.9253246753
63416002417845.838709677-1843.83870967739
64337430620208.315789474-282778.315789474
65361517324328.92532467537188.0746753247
663609621573533.73333333-1212571.73333333
67235561324328.925324675-88767.9253246753
68408247417845.838709677-9598.8387096774
69450296340884.565217391109411.434782609
70418799417845.838709677953.161290322605
71247405295013.541666667-47608.5416666667
72378519295013.54166666783505.4583333333
73326638417845.838709677-91207.8387096774
74328233324328.9253246753904.07467532466
75386225417845.838709677-31620.8387096774
76283662324328.925324675-40666.9253246753
77370225417845.838709677-47620.8387096774
78269236324328.925324675-55092.9253246753
79365732340884.56521739124847.4347826087
80420383620208.315789474-199825.315789474
81345811324328.92532467521482.0746753247
82431809417845.83870967713963.1612903226
83418876417845.8387096771030.16129032261
84297476295013.5416666672462.45833333331
85416776417845.838709677-1069.83870967739
86357257324328.92532467532928.0746753247
87458343340884.565217391117458.434782609
88388386417845.838709677-29459.8387096774
89358934417845.838709677-58911.8387096774
90407560417845.838709677-10285.8387096774
91392558417845.838709677-25287.8387096774
92373177324328.92532467548848.0746753247
93428370340884.56521739187485.4347826087
94369419417845.838709677-48426.8387096774
95358649295013.54166666763635.4583333333
96376641324328.92532467552312.0746753247
97467427417845.83870967749581.1612903226
98364885620208.315789474-255323.315789474
99436230417845.83870967718384.1612903226
100329118324328.9253246754789.07467532466
101317365324328.925324675-6963.92532467534
102286849417845.838709677-130996.838709677
103376685417845.838709677-41160.8387096774
104407198417845.838709677-10647.8387096774
105377772324328.92532467553443.0746753247
106271483324328.925324675-52845.9253246753
107153661324328.925324675-170667.925324675
108513294417845.83870967795448.1612903226
109324881417845.838709677-92964.8387096774
110264512324328.925324675-59816.9253246753
111420968324328.92532467596639.0746753247
112129302295013.541666667-165711.541666667
113191521324328.925324675-132807.925324675
114268673324328.925324675-55655.9253246753
115353179324328.92532467528850.0746753247
116354624324328.92532467530295.0746753247
117363713324328.92532467539384.0746753247
118456657417845.83870967738811.1612903226
119211742324328.925324675-112586.925324675
120338381324328.92532467514052.0746753247
121418530340884.56521739177645.4347826087
122351483324328.92532467527154.0746753247
123372928340884.56521739132043.4347826087
124485538417845.83870967767692.1612903226
125279268324328.925324675-45060.9253246753
126219060324328.925324675-105268.925324675
127325560324328.9253246751231.07467532466
128325314324328.925324675985.074675324664
129322046324328.925324675-2282.92532467534
130325560324328.9253246751231.07467532466
131325599324328.9253246751270.07467532466
132377028295013.54166666782014.4583333333
133325560324328.9253246751231.07467532466
134323850324328.925324675-478.925324675336
135325560324328.9253246751231.07467532466
136331514324328.9253246757185.07467532466
137325632324328.9253246751303.07467532466
138325560324328.9253246751231.07467532466
139325560324328.9253246751231.07467532466
140325560324328.9253246751231.07467532466
141322265324328.925324675-2063.92532467534
142325560324328.9253246751231.07467532466
143325906324328.9253246751577.07467532466
144325985324328.9253246751656.07467532466
145346145324328.92532467521816.0746753247
146325898324328.9253246751569.07467532466
147325560324328.9253246751231.07467532466
148325356324328.9253246751027.07467532466
149325560324328.9253246751231.07467532466
150325930324328.9253246751601.07467532466
151318020324328.925324675-6308.92532467534
152326389324328.9253246752060.07467532466
153325560324328.9253246751231.07467532466
154302925324328.925324675-21403.9253246753
155325540324328.9253246751211.07467532466
156325560324328.9253246751231.07467532466
157325560324328.9253246751231.07467532466
158326736324328.9253246752407.07467532466
159340580324328.92532467516251.0746753247
160325560324328.9253246751231.07467532466
161325560324328.9253246751231.07467532466
162325560324328.9253246751231.07467532466
163325560324328.9253246751231.07467532466
164331828324328.9253246757499.07467532466
165323299324328.925324675-1029.92532467534
166325560324328.9253246751231.07467532466
167325560324328.9253246751231.07467532466
168387722295013.54166666792708.4583333333
169325560324328.9253246751231.07467532466
170325560324328.9253246751231.07467532466
171325560324328.9253246751231.07467532466
172324598324328.925324675269.074675324664
173325560324328.9253246751231.07467532466
174328726324328.9253246754397.07467532466
175325560324328.9253246751231.07467532466
176325043324328.925324675714.074675324664
177325560324328.9253246751231.07467532466
178325806324328.9253246751477.07467532466
179325560324328.9253246751231.07467532466
180325560324328.9253246751231.07467532466
181387732324328.92532467563403.0746753247
182349729324328.92532467525400.0746753247
183332202295013.54166666737188.4583333333
184305442324328.925324675-18886.9253246753
185329537324328.9253246755208.07467532466
186327055324328.9253246752726.07467532466
187356245324328.92532467531916.0746753247
188328451324328.9253246754122.07467532466
189307062324328.925324675-17266.9253246753
190325560324328.9253246751231.07467532466
191331345324328.9253246757016.07467532466
192325560324328.9253246751231.07467532466
193331824324328.9253246757495.07467532466
194325560324328.9253246751231.07467532466
195325685324328.9253246751356.07467532466
196325560324328.9253246751231.07467532466
197404480417845.838709677-13365.8387096774
198325560324328.9253246751231.07467532466
199325560324328.9253246751231.07467532466
200318314324328.925324675-6014.92532467534
201325560324328.9253246751231.07467532466
202325560324328.9253246751231.07467532466
203325560324328.9253246751231.07467532466
204311807295013.54166666716793.4583333333
205337724417845.838709677-80121.8387096774
206326431324328.9253246752102.07467532466
207327556324328.9253246753227.07467532466
208325560324328.9253246751231.07467532466
209356850295013.54166666761836.4583333333
210325560324328.9253246751231.07467532466
211325560324328.9253246751231.07467532466
212325560324328.9253246751231.07467532466
213322741324328.925324675-1587.92532467534
214310902324328.925324675-13426.9253246753
215324295324328.925324675-33.925324675336
216325560324328.9253246751231.07467532466
217326156324328.9253246751827.07467532466
218326960324328.9253246752631.07467532466
219325560324328.9253246751231.07467532466
220333411324328.9253246759082.07467532466
221297761324328.925324675-26567.9253246753
222325560324328.9253246751231.07467532466
223325536324328.9253246751207.07467532466
224325560324328.9253246751231.07467532466
225325762324328.9253246751433.07467532466
226327957324328.9253246753628.07467532466
227325560324328.9253246751231.07467532466
228325560324328.9253246751231.07467532466
229318521324328.925324675-5807.92532467534
230325560324328.9253246751231.07467532466
231319775324328.925324675-4553.92532467534
232325560324328.9253246751231.07467532466
233325560324328.9253246751231.07467532466
234332128324328.9253246757799.07467532466
235325560324328.9253246751231.07467532466
236325486324328.9253246751157.07467532466
237325560324328.9253246751231.07467532466
238325838324328.9253246751509.07467532466
239325560324328.9253246751231.07467532466
240325560324328.9253246751231.07467532466
241325560324328.9253246751231.07467532466
242331767324328.9253246757438.07467532466
243325560324328.9253246751231.07467532466
244324523324328.925324675194.074675324664
245339995324328.92532467515666.0746753247
246325560324328.9253246751231.07467532466
247325560324328.9253246751231.07467532466
248319582324328.925324675-4746.92532467534
249325560324328.9253246751231.07467532466
250325560324328.9253246751231.07467532466
251307245295013.54166666712231.4583333333
252325560324328.9253246751231.07467532466
253317967324328.925324675-6361.92532467534
254331488324328.9253246757159.07467532466
255335452340884.565217391-5432.5652173913
256325560324328.9253246751231.07467532466
257334184295013.54166666739170.4583333333
258313213295013.54166666718199.4583333333
259325560324328.9253246751231.07467532466
260325560324328.9253246751231.07467532466
261325560324328.9253246751231.07467532466
262325560324328.9253246751231.07467532466
263348678324328.92532467524349.0746753247
264328727324328.9253246754398.07467532466
265325560324328.9253246751231.07467532466
266325560324328.9253246751231.07467532466
267325560324328.9253246751231.07467532466
268387978324328.92532467563649.0746753247
269325560324328.9253246751231.07467532466
270336704324328.92532467512375.0746753247
271325560324328.9253246751231.07467532466
272325560324328.9253246751231.07467532466
273325560324328.9253246751231.07467532466
274322076324328.925324675-2252.92532467534
275325560324328.9253246751231.07467532466
276334272324328.9253246759943.07467532466
277338197324328.92532467513868.0746753247
278325560324328.9253246751231.07467532466
279321024620208.315789474-299184.315789474
280322145324328.925324675-2183.92532467534
281325560324328.9253246751231.07467532466
282325560324328.9253246751231.07467532466
283323351324328.925324675-977.925324675336
284325560324328.9253246751231.07467532466
285327748324328.9253246753419.07467532466
286325560324328.9253246751231.07467532466
287325560324328.9253246751231.07467532466
288328157324328.9253246753828.07467532466
289325560324328.9253246751231.07467532466
290311594295013.54166666716580.4583333333
291325560324328.9253246751231.07467532466
292335962324328.92532467511633.0746753247
293372426324328.92532467548097.0746753247
294325560324328.9253246751231.07467532466
295319844324328.925324675-4484.92532467534
296355822324328.92532467531493.0746753247
297325560324328.9253246751231.07467532466
298325560324328.9253246751231.07467532466
299325560324328.9253246751231.07467532466
300325560324328.9253246751231.07467532466
301324047324328.925324675-281.925324675336
302311464324328.925324675-12864.9253246753
303325560324328.9253246751231.07467532466
304325560324328.9253246751231.07467532466
305353417324328.92532467529088.0746753247
306325590324328.9253246751261.07467532466
307325560324328.9253246751231.07467532466
308328576324328.9253246754247.07467532466
309326126295013.54166666731112.4583333333
310325560324328.9253246751231.07467532466
311325560324328.9253246751231.07467532466
312369376340884.56521739128491.4347826087
313325560324328.9253246751231.07467532466
314332013324328.9253246757684.07467532466
315325871324328.9253246751542.07467532466
316342165324328.92532467517836.0746753247
317324967324328.925324675638.074675324664
318314832324328.925324675-9496.92532467534
319325557324328.9253246751228.07467532466
320325560324328.9253246751231.07467532466
321325560324328.9253246751231.07467532466
322325560324328.9253246751231.07467532466
323325560324328.9253246751231.07467532466
324325560324328.9253246751231.07467532466
325325560324328.9253246751231.07467532466
326322649324328.925324675-1679.92532467534
327325560324328.9253246751231.07467532466
328325560324328.9253246751231.07467532466
329325560324328.9253246751231.07467532466
330325560324328.9253246751231.07467532466
331325560324328.9253246751231.07467532466
332325560324328.9253246751231.07467532466
333325560324328.9253246751231.07467532466
334324598324328.925324675269.074675324664
335325567324328.9253246751238.07467532466
336325560324328.9253246751231.07467532466
337324005324328.925324675-323.925324675336
338325560324328.9253246751231.07467532466
339325748324328.9253246751419.07467532466
340323385324328.925324675-943.925324675336
341315409324328.925324675-8919.92532467534
342325560324328.9253246751231.07467532466
343325560324328.9253246751231.07467532466
344325560324328.9253246751231.07467532466
345325560324328.9253246751231.07467532466
346325560324328.9253246751231.07467532466
347312275324328.925324675-12053.9253246753
348325560324328.9253246751231.07467532466
349325560324328.9253246751231.07467532466
350325560324328.9253246751231.07467532466
351320576324328.925324675-3752.92532467534
352325246324328.925324675917.074675324664
353332961324328.9253246758632.07467532466
354323010324328.925324675-1318.92532467534
355325560324328.9253246751231.07467532466
356325560324328.9253246751231.07467532466
357345253324328.92532467520924.0746753247
358325560324328.9253246751231.07467532466
359325560324328.9253246751231.07467532466
360325560324328.9253246751231.07467532466
361325559324328.9253246751230.07467532466
362325560324328.9253246751231.07467532466
363325560324328.9253246751231.07467532466
364319634324328.925324675-4694.92532467534
365319951324328.925324675-4377.92532467534
366325560324328.9253246751231.07467532466
367325560324328.9253246751231.07467532466
368325560324328.9253246751231.07467532466
369325560324328.9253246751231.07467532466
370325560324328.9253246751231.07467532466
371325560324328.9253246751231.07467532466
372318519324328.925324675-5809.92532467534
373343222324328.92532467518893.0746753247
374317234324328.925324675-7094.92532467534
375325560324328.9253246751231.07467532466
376325560324328.9253246751231.07467532466
377314025324328.925324675-10303.9253246753
378320249324328.925324675-4079.92532467534
379325560324328.9253246751231.07467532466
380325560324328.9253246751231.07467532466
381325560324328.9253246751231.07467532466
382349365324328.92532467525036.0746753247
383289197295013.541666667-5816.54166666669
384325560324328.9253246751231.07467532466
385329245324328.9253246754916.07467532466
386240869324328.925324675-83459.9253246753
387327182324328.9253246752853.07467532466
388322876324328.925324675-1452.92532467534
389323117324328.925324675-1211.92532467534
390306351324328.925324675-17977.9253246753
391335137324328.92532467510808.0746753247
392308271324328.925324675-16057.9253246753
393301731324328.925324675-22597.9253246753
394382409324328.92532467558080.0746753247
395279230324328.925324675-45098.9253246753
396298731324328.925324675-25597.9253246753
397243650295013.541666667-51363.5416666667
398532682620208.315789474-87526.3157894737
399319771324328.925324675-4557.92532467534
400171493620208.315789474-448715.315789474
401347262324328.92532467522933.0746753247
402343945324328.92532467519616.0746753247
403311874324328.925324675-12454.9253246753
404302211324328.925324675-22117.9253246753
405316708324328.925324675-7620.92532467534
406333463324328.9253246759134.07467532466
407344282324328.92532467519953.0746753247
408319635324328.925324675-4693.92532467534
409301186324328.925324675-23142.9253246753
410300381324328.925324675-23947.9253246753
411318765324328.925324675-5563.92532467534
412286146324328.925324675-38182.9253246753
413306844324328.925324675-17484.9253246753
414307705324328.925324675-16623.9253246753
415312448324328.925324675-11880.9253246753
416299715324328.925324675-24613.9253246753
417373399295013.54166666778385.4583333333
418299446324328.925324675-24882.9253246753
419325586324328.9253246751257.07467532466
420291221324328.925324675-33107.9253246753
421261173324328.925324675-63155.9253246753
422255027324328.925324675-69301.9253246753
423-78375295013.541666667-373388.541666667
424-58143295013.541666667-353156.541666667
425227033295013.541666667-67980.5416666667
426235098620208.315789474-385110.315789474
42721267295013.541666667-273746.541666667
428238675808308.818181818-569633.818181818
429197687324328.925324675-126641.925324675
430418341340884.56521739177456.4347826087
431-297706340884.565217391-638590.565217391
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292943507ago2a80urdfvs6w/2h43n1292943568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292943507ago2a80urdfvs6w/2h43n1292943568.ps (open in new window)


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


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


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