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 19:39:59 +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/t1292960384pw59oiem2gatm2t.htm/, Retrieved Tue, 21 Dec 2010 20:39:48 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/21/t1292960384pw59oiem2gatm2t.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 «
6282154 131182692 34643609608 171986226 4321023 13226760 2435838930 36304548 4111912 36070600 13412484900 63117576 223193 36267864 -2203781166 -11130996 1491348 17217900 6938649720 39986730 1629616 7162512 6702661676 26411952 1398893 10769587 5296835048 34019576 1926517 12064929 10610675779 62696139 983660 8596512 2279131392 13782144 1443586 2099475 778237950 6168522 1073089 2686320 6342453180 25536784 984885 1546838 608845580 5858440 1405225 7079502 -30803940 -672030 227132 8275640 1422016288 6203120 929118 6947080 2365728850 26698000 1071292 414225 995139400 9535176 638830 726546 2052634910 29393340 856956 5816750 2509697150 30299305 992426 8797698 1424324748 8864856 444477 4936417 2189202924 34027788 857217 948124 1069431920 6010820 711969 1496110 1781956330 5346667 702380 1372578 2206092648 17051444 358589 4694810 1884140576 33751360 297978 593118 957764088 11124324 585715 886144 1010172512 3574928 657954 6528704 2074689344 17699056 209458 870160 370473600 2268840 786690 291312 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 time43 seconds
R Server'George Udny Yule' @ 72.249.76.132


Goodness of Fit
Correlation0.7176
R-squared0.5149
RMSE299497.7444


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
162821542339778.33942375.7
243210232339778.31981244.7
341119122339778.31772133.7
4223193314478.457575758-91285.4575757576
514913482339778.3-848430.3
616296162339778.3-710162.3
713988932339778.3-940885.3
819265172339778.3-413261.3
9983660553455.80952381430204.190476191
101443586553455.80952381890130.19047619
1110730892339778.3-1266689.3
12984885553455.80952381431429.190476191
131405225314478.4575757581090746.54242424
14227132553455.80952381-326323.809523809
15929118553455.80952381375662.190476191
161071292553455.80952381517836.190476191
17638830553455.8095238185374.1904761905
188569562339778.3-1482822.3
19992426553455.80952381438970.190476191
20444477553455.80952381-108978.809523809
21857217553455.80952381303761.190476191
22711969553455.80952381158513.190476191
23702380553455.80952381148924.190476191
24358589553455.80952381-194866.809523809
25297978553455.80952381-255477.809523809
26585715553455.8095238132259.1904761905
27657954553455.80952381104498.190476191
28209458372005.653061224-162547.653061224
29786690314478.457575758472211.542424242
30439798553455.80952381-113657.809523809
31688779372005.653061224316773.346938776
32574339553455.8095238120883.1904761905
33741409553455.80952381187953.190476191
34597793372005.653061224225787.346938776
35644190553455.8095238190734.1904761905
36377934553455.80952381-175521.809523809
37640273553455.8095238186817.1904761905
38697458553455.80952381144002.190476191
39550608372005.653061224178602.346938776
40207393372005.653061224-164612.653061224
41301607553455.80952381-251848.809523809
42345783553455.80952381-207672.809523809
43501749372005.653061224129743.346938776
44379983553455.80952381-173472.809523809
45387475372005.65306122415469.3469387755
46377305372005.6530612245299.3469387755
47370837553455.80952381-182618.809523809
48430866553455.80952381-122589.809523809
49469107553455.80952381-84348.8095238095
50194493372005.653061224-177512.653061224
51530670372005.653061224158664.346938776
52518365553455.80952381-35090.8095238095
53491303553455.80952381-62152.8095238095
54527021372005.653061224155015.346938776
55233773553455.80952381-319682.809523809
56405972372005.65306122433966.3469387755
57652925314478.457575758338446.542424242
58446211372005.65306122474205.3469387755
59341340372005.653061224-30665.6530612245
60387699553455.80952381-165756.809523809
61493408553455.80952381-60047.8095238095
62146494314478.457575758-167984.457575758
63414462372005.65306122442456.3469387755
64364304553455.80952381-189151.809523809
65355178372005.653061224-16827.6530612245
66357760553455.80952381-195695.809523809
67261216314478.457575758-53262.4575757576
68397144372005.65306122425138.3469387755
69374943372005.6530612242937.34693877550
70424898372005.65306122452892.3469387755
71202055314478.457575758-112423.457575758
72378525314478.45757575864046.5424242424
73310768372005.653061224-61237.6530612245
74325738314478.45757575811259.5424242424
75394510372005.65306122422504.3469387755
76247060314478.457575758-67418.4575757576
77368078372005.653061224-3927.6530612245
78236761314478.457575758-77717.4575757576
79312378372005.653061224-59627.6530612245
80339836314478.45757575825357.5424242424
81347385314478.45757575832906.5424242424
82426280372005.65306122454274.3469387755
83352850372005.653061224-19155.6530612245
84301881314478.457575758-12597.4575757576
85377516314478.45757575863037.5424242424
86357312372005.653061224-14693.6530612245
87458343372005.65306122486337.3469387755
88354228314478.45757575839749.5424242424
89308636372005.653061224-63369.6530612245
90386212314478.45757575871733.5424242424
91393343372005.65306122421337.3469387755
92378509372005.6530612246503.3469387755
93452469372005.65306122480463.3469387755
94364839553455.80952381-188616.809523809
95358649314478.45757575844170.5424242424
96376641314478.45757575862162.5424242424
97429112314478.457575758114633.542424242
98330546314478.45757575816067.5424242424
99403560372005.65306122431554.3469387755
100317892314478.4575757583413.54242424242
101307528372005.653061224-64477.6530612245
102235133314478.457575758-79345.4575757576
103299243372005.653061224-72762.6530612245
104314073314478.457575758-405.457575757580
105368186314478.45757575853707.5424242424
106269661314478.457575758-44817.4575757576
107125390372005.653061224-246615.653061224
108510834314478.457575758196355.542424242
109321896553455.80952381-231559.809523809
110249898314478.457575758-64580.4575757576
111408881314478.45757575894402.5424242424
112158492314478.457575758-155986.457575758
113292154372005.653061224-79851.6530612245
114289513314478.457575758-24965.4575757576
115378049314478.45757575863570.5424242424
116343466314478.45757575828987.5424242424
117332743314478.45757575818264.5424242424
118442882314478.457575758128403.542424242
119214215314478.457575758-100263.457575758
120315688314478.4575757581209.54242424242
121375195553455.80952381-178260.809523809
122334280314478.45757575819801.5424242424
123355864372005.653061224-16141.6530612245
124480382372005.653061224108376.346938776
125353058314478.45757575838579.5424242424
126217193314478.457575758-97285.4575757576
127315380314478.457575758901.54242424242
128314533314478.45757575854.5424242424197
129318056314478.4575757583577.54242424242
130315380314478.457575758901.54242424242
131314353314478.457575758-125.457575757580
132369448314478.45757575854969.5424242424
133315380314478.457575758901.54242424242
134312846314478.457575758-1632.45757575758
135312075314478.457575758-2403.45757575758
136315009314478.457575758530.54242424242
137318903314478.4575757584424.54242424242
138314887314478.457575758408.54242424242
139314913314478.457575758434.542424242420
140315380314478.457575758901.54242424242
141325506314478.45757575811027.5424242424
142315380314478.457575758901.54242424242
143298568314478.457575758-15910.4575757576
144315834314478.4575757581355.54242424242
145329784314478.45757575815305.5424242424
146312878314478.457575758-1600.45757575758
147315380314478.457575758901.54242424242
148314987314478.457575758508.54242424242
149325249314478.45757575810770.5424242424
150315877314478.4575757581398.54242424242
151291650314478.457575758-22828.4575757576
152305959372005.653061224-66046.6530612245
153315380314478.457575758901.54242424242
154297765314478.457575758-16713.4575757576
155315245314478.457575758766.54242424242
156315380314478.457575758901.54242424242
157315380314478.457575758901.54242424242
158315236314478.457575758757.54242424242
159336425314478.45757575821946.5424242424
160315380314478.457575758901.54242424242
161315380314478.457575758901.54242424242
162315380314478.457575758901.54242424242
163315380314478.457575758901.54242424242
164306268314478.457575758-8210.45757575758
165302187314478.457575758-12291.4575757576
166314882314478.457575758403.542424242420
167315380314478.457575758901.54242424242
168382712314478.45757575868233.5424242424
169341570372005.653061224-30435.6530612245
170315380314478.457575758901.54242424242
171315380314478.457575758901.54242424242
172312412314478.457575758-2066.45757575758
173315380314478.457575758901.54242424242
174309596314478.457575758-4882.45757575758
175315380314478.457575758901.54242424242
176315547314478.4575757581068.54242424242
177313267372005.653061224-58738.6530612245
178316176314478.4575757581697.54242424242
179315380314478.457575758901.54242424242
180315380314478.457575758901.54242424242
181359335314478.45757575844856.5424242424
182330068314478.45757575815589.5424242424
183314289314478.457575758-189.457575757580
184297413314478.457575758-17065.4575757576
185314806314478.457575758327.54242424242
186333210314478.45757575818731.5424242424
187352108314478.45757575837629.5424242424
188313332314478.457575758-1146.45757575758
189291787314478.457575758-22691.4575757576
190315380314478.457575758901.54242424242
191318745314478.4575757584266.54242424242
192315380314478.457575758901.54242424242
193315366314478.457575758887.54242424242
194315380314478.457575758901.54242424242
195315688314478.4575757581209.54242424242
196315380314478.457575758901.54242424242
197409642553455.80952381-143813.809523809
198315380314478.457575758901.54242424242
199315380314478.457575758901.54242424242
200269587314478.457575758-44891.4575757576
201315380314478.457575758901.54242424242
202315380314478.457575758901.54242424242
203315380314478.457575758901.54242424242
204300962314478.457575758-13516.4575757576
205325479314478.45757575811000.5424242424
206316155314478.4575757581676.54242424242
207318574314478.4575757584095.54242424242
208315380314478.457575758901.54242424242
209343613314478.45757575829134.5424242424
210306948314478.457575758-7530.45757575758
211315380314478.457575758901.54242424242
212315380314478.457575758901.54242424242
213330059314478.45757575815580.5424242424
214288985314478.457575758-25493.4575757576
215304485314478.457575758-9993.45757575758
216315380314478.457575758901.54242424242
217315688314478.4575757581209.54242424242
218317736314478.4575757583257.54242424242
219315380314478.457575758901.54242424242
220322331314478.4575757587852.54242424242
221296656314478.457575758-17822.4575757576
222315380314478.457575758901.54242424242
223315354314478.457575758875.54242424242
224312161314478.457575758-2317.45757575758
225315576314478.4575757581097.54242424242
226314922314478.457575758443.542424242420
227314551314478.45757575872.5424242424197
228315380314478.457575758901.54242424242
229312339314478.457575758-2139.45757575758
230315380314478.457575758901.54242424242
231298700314478.457575758-15778.4575757576
232321376314478.4575757586897.54242424242
233315380314478.457575758901.54242424242
234303230314478.457575758-11248.4575757576
235315380314478.457575758901.54242424242
236315487314478.4575757581008.54242424242
237315380314478.457575758901.54242424242
238315793314478.4575757581314.54242424242
239315380314478.457575758901.54242424242
240315380314478.457575758901.54242424242
241315380314478.457575758901.54242424242
242312887314478.457575758-1591.45757575758
243315380314478.457575758901.54242424242
244315637314478.4575757581158.54242424242
245324385314478.4575757589906.54242424242
246315380314478.457575758901.54242424242
247315380314478.457575758901.54242424242
248308989314478.457575758-5489.45757575758
249315380314478.457575758901.54242424242
250315380314478.457575758901.54242424242
251296702314478.457575758-17776.4575757576
252315380314478.457575758901.54242424242
253307322314478.457575758-7156.45757575758
254304376372005.653061224-67629.6530612245
255253588372005.653061224-118417.653061224
256315380314478.457575758901.54242424242
257309560314478.457575758-4918.45757575758
258298466314478.457575758-16012.4575757576
259315380314478.457575758901.54242424242
260315380314478.457575758901.54242424242
261315380314478.457575758901.54242424242
262315380314478.457575758901.54242424242
263343929314478.45757575829450.5424242424
264331955314478.45757575817476.5424242424
265315380314478.457575758901.54242424242
266315380314478.457575758901.54242424242
267315380314478.457575758901.54242424242
268381180314478.45757575866701.5424242424
269315380314478.457575758901.54242424242
270331420314478.45757575816941.5424242424
271315380314478.457575758901.54242424242
272315380314478.457575758901.54242424242
273315380314478.457575758901.54242424242
274310201314478.457575758-4277.45757575758
275315380314478.457575758901.54242424242
276320016314478.4575757585537.54242424242
277320398314478.4575757585919.54242424242
278315380314478.457575758901.54242424242
279291841314478.457575758-22637.4575757576
280310670314478.457575758-3808.45757575758
281315380314478.457575758901.54242424242
282315380314478.457575758901.54242424242
283313491314478.457575758-987.45757575758
284315380314478.457575758901.54242424242
285331323314478.45757575816844.5424242424
286315380314478.457575758901.54242424242
287319210314478.4575757584731.54242424242
288318098314478.4575757583619.54242424242
289315380314478.457575758901.54242424242
290292754314478.457575758-21724.4575757576
291315380314478.457575758901.54242424242
292325176314478.45757575810697.5424242424
293365959314478.45757575851480.5424242424
294315380314478.457575758901.54242424242
295302409314478.457575758-12069.4575757576
296340968314478.45757575826489.5424242424
297315380314478.457575758901.54242424242
298315380314478.457575758901.54242424242
299315380314478.457575758901.54242424242
300315380314478.457575758901.54242424242
301313164314478.457575758-1314.45757575758
302301164314478.457575758-13314.4575757576
303315380314478.457575758901.54242424242
304315380314478.457575758901.54242424242
305344425314478.45757575829946.5424242424
306315394314478.457575758915.54242424242
307315380314478.457575758901.54242424242
308316647314478.4575757582168.54242424242
309309836314478.457575758-4642.45757575758
310315380314478.457575758901.54242424242
311315380314478.457575758901.54242424242
312346611372005.653061224-25394.6530612245
313315380314478.457575758901.54242424242
314322031314478.4575757587552.54242424242
315315656314478.4575757581177.54242424242
316339445314478.45757575824966.5424242424
317314964314478.457575758485.54242424242
318297141314478.457575758-17337.4575757576
319315372314478.457575758893.54242424242
320315380314478.457575758901.54242424242
321315380314478.457575758901.54242424242
322315380314478.457575758901.54242424242
323315380314478.457575758901.54242424242
324315380314478.457575758901.54242424242
325315380314478.457575758901.54242424242
326312502314478.457575758-1976.45757575758
327315380314478.457575758901.54242424242
328315380314478.457575758901.54242424242
329315380314478.457575758901.54242424242
330315380314478.457575758901.54242424242
331315380314478.457575758901.54242424242
332315380314478.457575758901.54242424242
333315380314478.457575758901.54242424242
334313729314478.457575758-749.45757575758
335315388314478.457575758909.54242424242
336315371314478.457575758892.54242424242
337296139314478.457575758-18339.4575757576
338315380314478.457575758901.54242424242
339313880314478.457575758-598.45757575758
340317698314478.4575757583219.54242424242
341295580314478.457575758-18898.4575757576
342315380314478.457575758901.54242424242
343315380314478.457575758901.54242424242
344315380314478.457575758901.54242424242
345308256314478.457575758-6222.45757575758
346315380314478.457575758901.54242424242
347303677314478.457575758-10801.4575757576
348315380314478.457575758901.54242424242
349315380314478.457575758901.54242424242
350319369314478.4575757584890.54242424242
351318690314478.4575757584211.54242424242
352314049314478.457575758-429.45757575758
353325699314478.45757575811220.5424242424
354314210314478.457575758-268.457575757580
355315380314478.457575758901.54242424242
356315380314478.457575758901.54242424242
357322378314478.4575757587899.54242424242
358315380314478.457575758901.54242424242
359315380314478.457575758901.54242424242
360315380314478.457575758901.54242424242
361315398314478.457575758919.54242424242
362315380314478.457575758901.54242424242
363315380314478.457575758901.54242424242
364308336314478.457575758-6142.45757575758
365316386314478.4575757581907.54242424242
366315380314478.457575758901.54242424242
367315380314478.457575758901.54242424242
368315380314478.457575758901.54242424242
369315380314478.457575758901.54242424242
370315553314478.4575757581074.54242424242
371315380314478.457575758901.54242424242
372323361314478.4575757588882.54242424242
373336639314478.45757575822160.5424242424
374307424314478.457575758-7054.45757575758
375315380314478.457575758901.54242424242
376315380314478.457575758901.54242424242
377295370314478.457575758-19108.4575757576
378322340314478.4575757587861.54242424242
379319864314478.4575757585385.54242424242
380315380314478.457575758901.54242424242
381315380314478.457575758901.54242424242
382317291314478.4575757582812.54242424242
383280398314478.457575758-34080.4575757576
384315380314478.457575758901.54242424242
385317330314478.4575757582851.54242424242
386238125314478.457575758-76353.4575757576
387327071314478.45757575812592.5424242424
388309038314478.457575758-5440.45757575758
389314210314478.457575758-268.457575757580
390307930314478.457575758-6548.45757575758
391322327314478.4575757587848.54242424242
392292136314478.457575758-22342.4575757576
393263276314478.457575758-51202.4575757576
394367655314478.45757575853176.5424242424
395283910314478.457575758-30568.4575757576
396283587314478.457575758-30891.4575757576
397243650314478.457575758-70828.4575757576
398438493372005.65306122466487.3469387755
399296261314478.457575758-18217.4575757576
400230621314478.457575758-83857.4575757576
401304252314478.457575758-10226.4575757576
402333505314478.45757575819026.5424242424
403296919314478.457575758-17559.4575757576
404278990314478.457575758-35488.4575757576
405276898314478.457575758-37580.4575757576
406327007314478.45757575812528.5424242424
407317046314478.4575757582567.54242424242
408304555314478.457575758-9923.45757575758
409298096314478.457575758-16382.4575757576
410231861314478.457575758-82617.4575757576
411309422372005.653061224-62583.6530612245
412286963314478.457575758-27515.4575757576
413269753314478.457575758-44725.4575757576
414448243372005.65306122476237.3469387755
415165404314478.457575758-149074.457575758
416204325314478.457575758-110153.457575758
417407159314478.45757575892680.5424242424
418290476314478.457575758-24002.4575757576
419275311314478.457575758-39167.4575757576
420246541314478.457575758-67937.4575757576
421253468314478.457575758-61010.4575757576
422240897372005.653061224-131108.653061224
423-83265314478.457575758-397743.457575758
424-42143314478.457575758-356621.457575758
425272713314478.457575758-41765.4575757576
426215362372005.653061224-156643.653061224
42742754314478.457575758-271724.457575758
4283062752339778.3-2033503.3
429253537553455.80952381-299918.809523809
430372631553455.80952381-180824.809523809
431-7170314478.457575758-321648.457575758
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292960384pw59oiem2gatm2t/2b3r31292960354.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292960384pw59oiem2gatm2t/2b3r31292960354.ps (open in new window)


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


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


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