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:27:58 +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/t1292959594sw9rypifomfmtov.htm/, Retrieved Tue, 21 Dec 2010 20:26:35 +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/t1292959594sw9rypifomfmtov.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 807 213118 6282154 131182692 34643609608 171986226 29790 444 81767 4321023 13226760 2435838930 36304548 87550 412 153198 4111912 36070600 13412484900 63117576 84738 428 -26007 223193 36267864 -2203781166 -11130996 54660 315 126942 1491348 17217900 6938649720 39986730 42634 168 157214 1629616 7162512 6702661676 26411952 40949 263 129352 1398893 10769587 5296835048 34019576 45187 267 234817 1926517 12064929 10610675779 62696139 37704 228 60448 983660 8596512 2279131392 13782144 16275 129 47818 1443586 2099475 778237950 6168522 25830 104 245546 1073089 2686320 6342453180 25536784 12679 122 48020 984885 1546838 608845580 5858440 18014 393 -1710 1405225 7079502 -30803940 -672030 43556 190 32648 227132 8275640 1422016288 6203120 24811 280 95350 929118 6947080 2365728850 26698000 6575 63 151352 1071292 414225 995139400 9535176 7123 102 288170 638830 726546 2052634910 29393340 21950 265 114337 856956 5816750 2509697150 30299305 37597 234 37884 992426 8797698 1424324748 8864856 17821 277 1228 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 time10 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Goodness of Fit
Correlation0.7221
R-squared0.5215
RMSE297467.042


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
162821542339778.33942375.7
243210232339778.31981244.7
341119122339778.31772133.7
4223193491791.181818182-268598.181818182
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
131405225491791.181818182913433.818181818
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
28209458267847.518518519-58389.5185185185
29786690267847.518518519518842.481481481
30439798553455.80952381-113657.809523809
31688779398818.8289960.2
32574339553455.8095238120883.1904761905
33741409553455.80952381187953.190476191
34597793398818.8198974.2
35644190553455.8095238190734.1904761905
36377934553455.80952381-175521.809523809
37640273553455.8095238186817.1904761905
38697458553455.80952381144002.190476191
39550608491791.18181818258816.8181818182
40207393491791.181818182-284398.181818182
41301607553455.80952381-251848.809523809
42345783553455.80952381-207672.809523809
43501749491791.1818181829957.81818181818
44379983553455.80952381-173472.809523809
45387475267847.518518519119627.481481481
46377305398818.8-21513.8
47370837553455.80952381-182618.809523809
48430866553455.80952381-122589.809523809
49469107553455.80952381-84348.8095238095
50194493267847.518518519-73354.5185185185
51530670491791.18181818238878.8181818182
52518365553455.80952381-35090.8095238095
53491303553455.80952381-62152.8095238095
54527021398818.8128202.2
55233773553455.80952381-319682.809523809
56405972267847.518518519138124.481481481
57652925378225.375274699.625
58446211398818.847392.2
59341340398818.8-57478.8
60387699553455.80952381-165756.809523809
61493408553455.80952381-60047.8095238095
62146494305290.6875-158796.6875
63414462398818.815643.2
64364304553455.80952381-189151.809523809
65355178267847.51851851987330.4814814815
66357760553455.80952381-195695.809523809
67261216305290.6875-44074.6875
68397144398818.8-1674.79999999999
69374943398818.8-23875.8
70424898491791.181818182-66893.1818181818
71202055267847.518518519-65792.5185185185
72378525267847.518518519110677.481481481
73310768398818.8-88050.8
74325738305290.687520447.3125
75394510398818.8-4308.79999999999
76247060305290.6875-58230.6875
77368078398818.8-30740.8
78236761305290.6875-68529.6875
79312378305290.68757087.3125
80339836398818.8-58982.8
81347385305290.687542094.3125
82426280398818.827461.2
83352850398818.8-45968.8
84301881378225.375-76344.375
85377516398818.8-21302.8
86357312267847.51851851989464.4814814815
87458343491791.181818182-33448.1818181818
88354228398818.8-44590.8
89308636398818.8-90182.8
90386212398818.8-12606.8
91393343398818.8-5475.79999999999
92378509267847.518518519110661.481481481
93452469267847.518518519184621.481481481
94364839553455.80952381-188616.809523809
95358649378225.375-19576.375
96376641267847.518518519108793.481481481
97429112398818.830293.2
98330546305290.687525255.3125
99403560398818.84741.20000000001
100317892305290.687512601.3125
101307528305290.68752237.3125
102235133398818.8-163685.8
103299243398818.8-99575.8
104314073398818.8-84745.8
105368186305290.687562895.3125
106269661305290.6875-35629.6875
107125390267847.518518519-142457.518518519
108510834398818.8112015.2
109321896553455.80952381-231559.809523809
110249898305290.6875-55392.6875
111408881305290.6875103590.3125
112158492267847.518518519-109355.518518519
113292154267847.51851851924306.4814814815
114289513260725.37528787.625
115378049305290.687572758.3125
116343466305290.687538175.3125
117332743305290.687527452.3125
118442882398818.844063.2
119214215260725.375-46510.375
120315688305290.687510397.3125
121375195553455.80952381-178260.809523809
122334280305290.687528989.3125
123355864491791.181818182-135927.181818182
124480382398818.881563.2
125353058260725.37592332.625
126217193260725.375-43532.375
127315380314858.418269231521.581730769249
128314533314858.418269231-325.418269230751
129318056314858.4182692313197.58173076925
130315380314858.418269231521.581730769249
131314353314858.418269231-505.418269230751
132369448305290.687564157.3125
133315380314858.418269231521.581730769249
134312846314858.418269231-2012.41826923075
135312075305290.68756784.3125
136315009314858.418269231150.581730769249
137318903314858.4182692314044.58173076925
138314887314858.41826923128.5817307692487
139314913305290.68759622.3125
140315380314858.418269231521.581730769249
141325506314858.41826923110647.5817307692
142315380314858.418269231521.581730769249
143298568305290.6875-6722.6875
144315834314858.418269231975.581730769249
145329784305290.687524493.3125
146312878314858.418269231-1980.41826923075
147315380314858.418269231521.581730769249
148314987314858.418269231128.581730769249
149325249314858.41826923110390.5817307692
150315877314858.4182692311018.58173076925
151291650305290.6875-13640.6875
152305959305290.6875668.3125
153315380314858.418269231521.581730769249
154297765305290.6875-7525.6875
155315245314858.418269231386.581730769249
156315380314858.418269231521.581730769249
157315380314858.418269231521.581730769249
158315236314858.418269231377.581730769249
159336425314858.41826923121566.5817307692
160315380314858.418269231521.581730769249
161315380314858.418269231521.581730769249
162315380314858.418269231521.581730769249
163315380314858.418269231521.581730769249
164306268305290.6875977.3125
165302187305290.6875-3103.6875
166314882314858.41826923123.5817307692487
167315380314858.418269231521.581730769249
168382712378225.3754486.625
169341570267847.51851851973722.4814814815
170315380314858.418269231521.581730769249
171315380314858.418269231521.581730769249
172312412314858.418269231-2446.41826923075
173315380314858.418269231521.581730769249
174309596314858.418269231-5262.41826923075
175315380314858.418269231521.581730769249
176315547314858.418269231688.581730769249
177313267491791.181818182-178524.181818182
178316176314858.4182692311317.58173076925
179315380314858.418269231521.581730769249
180315380314858.418269231521.581730769249
181359335305290.687554044.3125
182330068305290.687524777.3125
183314289305290.68758998.3125
184297413305290.6875-7877.6875
185314806314858.418269231-52.4182692307513
186333210305290.687527919.3125
187352108305290.687546817.3125
188313332314858.418269231-1526.41826923075
189291787314858.418269231-23071.4182692308
190315380314858.418269231521.581730769249
191318745314858.4182692313886.58173076925
192315380314858.418269231521.581730769249
193315366314858.418269231507.581730769249
194315380314858.418269231521.581730769249
195315688314858.418269231829.581730769249
196315380314858.418269231521.581730769249
197409642553455.80952381-143813.809523809
198315380314858.418269231521.581730769249
199315380314858.418269231521.581730769249
200269587305290.6875-35703.6875
201315380314858.418269231521.581730769249
202315380314858.418269231521.581730769249
203315380314858.418269231521.581730769249
204300962314858.418269231-13896.4182692308
205325479398818.8-73339.8
206316155314858.4182692311296.58173076925
207318574314858.4182692313715.58173076925
208315380314858.418269231521.581730769249
209343613378225.375-34612.375
210306948314858.418269231-7910.41826923075
211315380314858.418269231521.581730769249
212315380314858.418269231521.581730769249
213330059314858.41826923115200.5817307692
214288985305290.6875-16305.6875
215304485305290.6875-805.6875
216315380314858.418269231521.581730769249
217315688314858.418269231829.581730769249
218317736314858.4182692312877.58173076925
219315380314858.418269231521.581730769249
220322331305290.687517040.3125
221296656314858.418269231-18202.4182692308
222315380314858.418269231521.581730769249
223315354314858.418269231495.581730769249
224312161305290.68756870.3125
225315576314858.418269231717.581730769249
226314922314858.41826923163.5817307692487
227314551314858.418269231-307.418269230751
228315380314858.418269231521.581730769249
229312339314858.418269231-2519.41826923075
230315380314858.418269231521.581730769249
231298700314858.418269231-16158.4182692308
232321376305290.687516085.3125
233315380314858.418269231521.581730769249
234303230314858.418269231-11628.4182692308
235315380314858.418269231521.581730769249
236315487314858.418269231628.581730769249
237315380314858.418269231521.581730769249
238315793314858.418269231934.581730769249
239315380314858.418269231521.581730769249
240315380314858.418269231521.581730769249
241315380314858.418269231521.581730769249
242312887314858.418269231-1971.41826923075
243315380314858.418269231521.581730769249
244315637314858.418269231778.581730769249
245324385260725.37563659.625
246315380314858.418269231521.581730769249
247315380314858.418269231521.581730769249
248308989314858.418269231-5869.41826923075
249315380314858.418269231521.581730769249
250315380314858.418269231521.581730769249
251296702314858.418269231-18156.4182692308
252315380314858.418269231521.581730769249
253307322314858.418269231-7536.41826923075
254304376305290.6875-914.6875
255253588267847.518518519-14259.5185185185
256315380314858.418269231521.581730769249
257309560314858.418269231-5298.41826923075
258298466378225.375-79759.375
259315380314858.418269231521.581730769249
260315380314858.418269231521.581730769249
261315380314858.418269231521.581730769249
262315380314858.418269231521.581730769249
263343929339229.4285714294699.57142857142
264331955314858.41826923117096.5817307692
265315380314858.418269231521.581730769249
266315380314858.418269231521.581730769249
267315380314858.418269231521.581730769249
268381180339229.42857142941950.5714285714
269315380314858.418269231521.581730769249
270331420339229.428571429-7809.42857142858
271315380314858.418269231521.581730769249
272315380314858.418269231521.581730769249
273315380314858.418269231521.581730769249
274310201314858.418269231-4657.41826923075
275315380314858.418269231521.581730769249
276320016314858.4182692315157.58173076925
277320398314858.4182692315539.58173076925
278315380314858.418269231521.581730769249
279291841305290.6875-13449.6875
280310670339229.428571429-28559.4285714286
281315380314858.418269231521.581730769249
282315380314858.418269231521.581730769249
283313491314858.418269231-1367.41826923075
284315380314858.418269231521.581730769249
285331323339229.428571429-7906.42857142858
286315380314858.418269231521.581730769249
287319210305290.687513919.3125
288318098314858.4182692313239.58173076925
289315380314858.418269231521.581730769249
290292754314858.418269231-22104.4182692308
291315380314858.418269231521.581730769249
292325176314858.41826923110317.5817307692
293365959305290.687560668.3125
294315380314858.418269231521.581730769249
295302409314858.418269231-12449.4182692308
296340968314858.41826923126109.5817307692
297315380314858.418269231521.581730769249
298315380314858.418269231521.581730769249
299315380314858.418269231521.581730769249
300315380314858.418269231521.581730769249
301313164314858.418269231-1694.41826923075
302301164314858.418269231-13694.4182692308
303315380314858.418269231521.581730769249
304315380314858.418269231521.581730769249
305344425314858.41826923129566.5817307692
306315394314858.418269231535.581730769249
307315380314858.418269231521.581730769249
308316647314858.4182692311788.58173076925
309309836314858.418269231-5022.41826923075
310315380314858.418269231521.581730769249
311315380314858.418269231521.581730769249
312346611398818.8-52207.8
313315380314858.418269231521.581730769249
314322031314858.4182692317172.58173076925
315315656314858.418269231797.581730769249
316339445339229.428571429215.57142857142
317314964314858.418269231105.581730769249
318297141314858.418269231-17717.4182692308
319315372314858.418269231513.581730769249
320315380314858.418269231521.581730769249
321315380314858.418269231521.581730769249
322315380314858.418269231521.581730769249
323315380314858.418269231521.581730769249
324315380314858.418269231521.581730769249
325315380314858.418269231521.581730769249
326312502314858.418269231-2356.41826923075
327315380314858.418269231521.581730769249
328315380314858.418269231521.581730769249
329315380314858.418269231521.581730769249
330315380314858.418269231521.581730769249
331315380314858.418269231521.581730769249
332315380314858.418269231521.581730769249
333315380314858.418269231521.581730769249
334313729314858.418269231-1129.41826923075
335315388314858.418269231529.581730769249
336315371314858.418269231512.581730769249
337296139305290.6875-9151.6875
338315380314858.418269231521.581730769249
339313880314858.418269231-978.418269230751
340317698314858.4182692312839.58173076925
341295580314858.418269231-19278.4182692308
342315380314858.418269231521.581730769249
343315380314858.418269231521.581730769249
344315380314858.418269231521.581730769249
345308256305290.68752965.3125
346315380314858.418269231521.581730769249
347303677314858.418269231-11181.4182692308
348315380314858.418269231521.581730769249
349315380314858.418269231521.581730769249
350319369305290.687514078.3125
351318690314858.4182692313831.58173076925
352314049314858.418269231-809.418269230751
353325699305290.687520408.3125
354314210314858.418269231-648.418269230751
355315380314858.418269231521.581730769249
356315380314858.418269231521.581730769249
357322378305290.687517087.3125
358315380314858.418269231521.581730769249
359315380314858.418269231521.581730769249
360315380314858.418269231521.581730769249
361315398314858.418269231539.581730769249
362315380314858.418269231521.581730769249
363315380314858.418269231521.581730769249
364308336305290.68753045.3125
365316386314858.4182692311527.58173076925
366315380314858.418269231521.581730769249
367315380314858.418269231521.581730769249
368315380314858.418269231521.581730769249
369315380314858.418269231521.581730769249
370315553314858.418269231694.581730769249
371315380314858.418269231521.581730769249
372323361305290.687518070.3125
373336639339229.428571429-2590.42857142858
374307424314858.418269231-7434.41826923075
375315380314858.418269231521.581730769249
376315380314858.418269231521.581730769249
377295370314858.418269231-19488.4182692308
378322340305290.687517049.3125
379319864305290.687514573.3125
380315380314858.418269231521.581730769249
381315380314858.418269231521.581730769249
382317291305290.687512000.3125
383280398378225.375-97827.375
384315380314858.418269231521.581730769249
385317330314858.4182692312471.58173076925
386238125260725.375-22600.375
387327071314858.41826923112212.5817307692
388309038305290.68753747.3125
389314210314858.418269231-648.418269230751
390307930305290.68752639.3125
391322327314858.4182692317468.58173076925
392292136305290.6875-13154.6875
393263276305290.6875-42014.6875
394367655305290.687562364.3125
395283910260725.37523184.625
396283587305290.6875-21703.6875
397243650267847.518518519-24197.5185185185
398438493491791.181818182-53298.1818181818
399296261305290.6875-9029.6875
400230621267847.518518519-37226.5185185185
401304252305290.6875-1038.6875
402333505305290.687528214.3125
403296919305290.6875-8371.6875
404278990305290.6875-26300.6875
405276898305290.6875-28392.6875
406327007305290.687521716.3125
407317046305290.687511755.3125
408304555305290.6875-735.6875
409298096305290.6875-7194.6875
410231861305290.6875-73429.6875
411309422305290.68754131.3125
412286963267847.51851851919115.4814814815
413269753305290.6875-35537.6875
414448243267847.518518519180395.481481481
415165404260725.375-95321.375
416204325305290.6875-100965.6875
417407159378225.37528933.625
418290476305290.6875-14814.6875
419275311305290.6875-29979.6875
420246541305290.6875-58749.6875
421253468305290.6875-51822.6875
422240897267847.518518519-26950.5185185185
423-83265267847.518518519-351112.518518519
424-42143267847.518518519-309990.518518519
425272713305290.6875-32577.6875
426215362267847.518518519-52485.5185185185
42742754267847.518518519-225093.518518519
4283062752339778.3-2033503.3
429253537553455.80952381-299918.809523809
430372631553455.80952381-180824.809523809
431-7170267847.518518519-275017.518518519
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292959594sw9rypifomfmtov/2qvpc1292959664.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292959594sw9rypifomfmtov/2qvpc1292959664.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292959594sw9rypifomfmtov/40m6f1292959664.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292959594sw9rypifomfmtov/40m6f1292959664.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