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 12:34:10 +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/t1292934903k990b3lc9hbsohq.htm/, Retrieved Tue, 21 Dec 2010 13:35:10 +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/t1292934903k990b3lc9hbsohq.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 162556 1081 213118 6282929 1 29790 309 81767 4324047 1 87550 458 153198 4108272 0 84738 588 -26007 -1212617 1 54660 299 126942 1485329 1 42634 156 157214 1779876 0 40949 481 129352 1367203 1 42312 323 234817 2519076 1 37704 452 60448 912684 1 16275 109 47818 1443586 0 25830 115 245546 1220017 0 12679 110 48020 984885 1 18014 239 -1710 1457425 0 43556 247 32648 -572920 1 24524 497 95350 929144 0 6532 103 151352 1151176 0 7123 109 288170 790090 1 20813 502 114337 774497 1 37597 248 37884 990576 0 17821 373 122844 454195 1 12988 119 82340 876607 1 22330 84 79801 711969 0 13326 102 165548 702380 0 16189 295 116384 264449 0 7146 105 134028 450033 0 15824 64 63838 541063 1 26088 267 74996 588864 0 11326 129 31080 -37216 0 8568 37 32168 783310 0 14416 361 49857 467359 1 3369 28 87161 688779 1 11819 85 106113 608419 1 6620 44 80570 696348 1 4519 49 102129 597793 0 2220 22 301670 821730 0 18562 155 102313 377934 0 10327 91 88577 651939 1 5336 81 112477 697458 1 2365 79 191778 70 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 time37 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.5876
R-squared0.3453
RMSE361609.4815


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
162829291851927.54431001.5
243240471851927.52472119.5
341082721851927.52256344.5
4-12126171851927.5-3064544.5
514853291851927.5-366598.5
617798761851927.5-72051.5
713672031851927.5-484724.5
825190761851927.5667148.5
99126841851927.5-939243.5
101443586662903.65780682.35
111220017662903.65557113.35
12984885662903.65321981.35
131457425662903.65794521.35
14-5729201851927.5-2424847.5
15929144662903.65266240.35
161151176707207443969
1779009070720782883
18774497662903.65111593.35
199905761851927.5-861351.5
20454195662903.65-208708.65
21876607662903.65213703.35
22711969662903.6549065.35
23702380662903.6539476.35
24264449662903.65-398454.65
25450033412084.72413793137948.275862069
26541063662903.65-121840.65
27588864662903.65-74039.65
28-37216277262.666666667-314478.666666667
29783310277262.666666667506047.333333333
30467359662903.65-195544.65
31688779479017.380952381209761.619047619
32608419662903.65-54484.65
33696348277262.666666667419085.333333333
34597793479017.380952381118775.619047619
35821730707207114523
36377934662903.65-284969.65
37651939412084.724137931239854.275862069
38697458479017.380952381218440.619047619
39700368707207-6839
40225986277262.666666667-51276.6666666667
41348695412084.724137931-63389.724137931
42373683662903.65-289220.65
43501709412084.72413793189624.275862069
44413743412084.7241379311658.27586206899
45379825277262.666666667102562.333333333
46336260479017.380952381-142757.380952381
47636765707207-70442
48481231479017.3809523812213.61904761905
49469107412084.72413793157022.275862069
50211928277262.666666667-65334.6666666667
51563925479017.38095238184907.619047619
52511939479017.38095238132921.6190476191
53521016707207-186191
54543856479017.38095238164838.619047619
55329304707207-377903
56423262277262.666666667145999.333333333
57509665277262.666666667232402.333333333
58455881412084.72413793143796.275862069
59367772412084.724137931-44312.724137931
60406339479017.380952381-72678.380952381
61493408479017.38095238114390.6190476191
62232942326042.386138614-93100.3861386139
63416002479017.380952381-63015.380952381
64337430277262.66666666760167.3333333333
65361517277262.66666666784254.3333333333
66360962662903.65-301941.65
67235561326042.386138614-90481.3861386139
68408247479017.380952381-70770.380952381
69450296412084.72413793138211.275862069
70418799479017.380952381-60218.380952381
71247405277262.666666667-29857.6666666667
72378519277262.666666667101256.333333333
73326638412084.724137931-85446.724137931
74328233326042.3861386142190.61386138614
75386225412084.724137931-25859.724137931
76283662326042.386138614-42380.3861386139
77370225412084.724137931-41859.724137931
78269236326042.386138614-56806.3861386139
79365732326042.38613861439689.6138613861
80420383479017.380952381-58634.380952381
81345811326042.38613861419768.6138613861
82431809479017.380952381-47208.3809523809
83418876412084.7241379316791.27586206899
84297476326042.386138614-28566.3861386139
85416776412084.7241379314691.27586206899
86357257277262.66666666779994.3333333333
87458343412084.72413793146258.275862069
88388386412084.724137931-23698.724137931
89358934412084.724137931-53150.724137931
90407560412084.724137931-4524.72413793101
91392558412084.724137931-19526.724137931
92373177277262.66666666795914.3333333333
93428370277262.666666667151107.333333333
94369419479017.380952381-109598.380952381
95358649326042.38613861432606.6138613861
96376641277262.66666666799378.3333333333
97467427412084.72413793155342.275862069
98364885326042.38613861438842.6138613861
99436230412084.72413793124145.275862069
100329118326042.3861386143075.61386138614
101317365326042.386138614-8677.38613861386
102286849412084.724137931-125235.724137931
103376685412084.724137931-35399.724137931
104407198412084.724137931-4886.72413793101
105377772326042.38613861451729.6138613861
106271483326042.386138614-54559.3861386139
107153661277262.666666667-123601.666666667
108513294479017.38095238134276.6190476191
109324881412084.724137931-87203.724137931
110264512277262.666666667-12750.6666666667
111420968326042.38613861494925.6138613861
112129302277262.666666667-147960.666666667
113191521277262.666666667-85741.6666666667
114268673277262.666666667-8589.66666666669
115353179326042.38613861427136.6138613861
116354624326042.38613861428581.6138613861
117363713326042.38613861437670.6138613861
118456657412084.72413793144572.275862069
119211742277262.666666667-65520.6666666667
120338381326042.38613861412338.6138613861
121418530412084.7241379316445.27586206899
122351483326042.38613861425440.6138613861
123372928412084.724137931-39156.724137931
124485538479017.3809523816520.61904761905
125279268277262.6666666672005.33333333331
126219060277262.666666667-58202.6666666667
127325560326042.386138614-482.38613861386
128325314326042.386138614-728.38613861386
129322046326042.386138614-3996.38613861386
130325560326042.386138614-482.38613861386
131325599326042.386138614-443.386138613860
132377028326042.38613861450985.6138613861
133325560326042.386138614-482.38613861386
134323850326042.386138614-2192.38613861386
135325560326042.386138614-482.38613861386
136331514326042.3861386145471.61386138614
137325632326042.386138614-410.38613861386
138325560326042.386138614-482.38613861386
139325560326042.386138614-482.38613861386
140325560326042.386138614-482.38613861386
141322265326042.386138614-3777.38613861386
142325560326042.386138614-482.38613861386
143325906326042.386138614-136.386138613860
144325985326042.386138614-57.3861386138597
145346145326042.38613861420102.6138613861
146325898326042.386138614-144.386138613860
147325560326042.386138614-482.38613861386
148325356326042.386138614-686.38613861386
149325560326042.386138614-482.38613861386
150325930326042.386138614-112.386138613860
151318020326042.386138614-8022.38613861386
152326389326042.386138614346.613861386140
153325560326042.386138614-482.38613861386
154302925326042.386138614-23117.3861386139
155325540326042.386138614-502.38613861386
156325560326042.386138614-482.38613861386
157325560326042.386138614-482.38613861386
158326736326042.386138614693.61386138614
159340580326042.38613861414537.6138613861
160325560326042.386138614-482.38613861386
161325560326042.386138614-482.38613861386
162325560326042.386138614-482.38613861386
163325560326042.386138614-482.38613861386
164331828326042.3861386145785.61386138614
165323299326042.386138614-2743.38613861386
166325560326042.386138614-482.38613861386
167325560326042.386138614-482.38613861386
168387722326042.38613861461679.6138613861
169325560326042.386138614-482.38613861386
170325560326042.386138614-482.38613861386
171325560326042.386138614-482.38613861386
172324598326042.386138614-1444.38613861386
173325560326042.386138614-482.38613861386
174328726326042.3861386142683.61386138614
175325560326042.386138614-482.38613861386
176325043326042.386138614-999.38613861386
177325560326042.386138614-482.38613861386
178325806326042.386138614-236.386138613860
179325560326042.386138614-482.38613861386
180325560326042.386138614-482.38613861386
181387732326042.38613861461689.6138613861
182349729326042.38613861423686.6138613861
183332202326042.3861386146159.61386138614
184305442326042.386138614-20600.3861386139
185329537326042.3861386143494.61386138614
186327055326042.3861386141012.61386138614
187356245326042.38613861430202.6138613861
188328451326042.3861386142408.61386138614
189307062326042.386138614-18980.3861386139
190325560326042.386138614-482.38613861386
191331345326042.3861386145302.61386138614
192325560326042.386138614-482.38613861386
193331824326042.3861386145781.61386138614
194325560326042.386138614-482.38613861386
195325685326042.386138614-357.386138613860
196325560326042.386138614-482.38613861386
197404480479017.380952381-74537.380952381
198325560326042.386138614-482.38613861386
199325560326042.386138614-482.38613861386
200318314326042.386138614-7728.38613861386
201325560326042.386138614-482.38613861386
202325560326042.386138614-482.38613861386
203325560326042.386138614-482.38613861386
204311807326042.386138614-14235.3861386139
205337724479017.380952381-141293.380952381
206326431326042.386138614388.613861386140
207327556326042.3861386141513.61386138614
208325560326042.386138614-482.38613861386
209356850326042.38613861430807.6138613861
210325560326042.386138614-482.38613861386
211325560326042.386138614-482.38613861386
212325560326042.386138614-482.38613861386
213322741326042.386138614-3301.38613861386
214310902326042.386138614-15140.3861386139
215324295326042.386138614-1747.38613861386
216325560326042.386138614-482.38613861386
217326156326042.386138614113.613861386140
218326960326042.386138614917.61386138614
219325560326042.386138614-482.38613861386
220333411326042.3861386147368.61386138614
221297761326042.386138614-28281.3861386139
222325560326042.386138614-482.38613861386
223325536326042.386138614-506.38613861386
224325560326042.386138614-482.38613861386
225325762326042.386138614-280.386138613860
226327957326042.3861386141914.61386138614
227325560326042.386138614-482.38613861386
228325560326042.386138614-482.38613861386
229318521326042.386138614-7521.38613861386
230325560326042.386138614-482.38613861386
231319775326042.386138614-6267.38613861386
232325560326042.386138614-482.38613861386
233325560326042.386138614-482.38613861386
234332128326042.3861386146085.61386138614
235325560326042.386138614-482.38613861386
236325486326042.386138614-556.38613861386
237325560326042.386138614-482.38613861386
238325838326042.386138614-204.386138613860
239325560326042.386138614-482.38613861386
240325560326042.386138614-482.38613861386
241325560326042.386138614-482.38613861386
242331767326042.3861386145724.61386138614
243325560326042.386138614-482.38613861386
244324523326042.386138614-1519.38613861386
245339995277262.66666666762732.3333333333
246325560326042.386138614-482.38613861386
247325560326042.386138614-482.38613861386
248319582326042.386138614-6460.38613861386
249325560326042.386138614-482.38613861386
250325560326042.386138614-482.38613861386
251307245326042.386138614-18797.3861386139
252325560326042.386138614-482.38613861386
253317967326042.386138614-8075.38613861386
254331488326042.3861386145445.61386138614
255335452326042.3861386149409.61386138614
256325560326042.386138614-482.38613861386
257334184326042.3861386148141.61386138614
258313213326042.386138614-12829.3861386139
259325560326042.386138614-482.38613861386
260325560326042.386138614-482.38613861386
261325560326042.386138614-482.38613861386
262325560326042.386138614-482.38613861386
263348678326042.38613861422635.6138613861
264328727326042.3861386142684.61386138614
265325560326042.386138614-482.38613861386
266325560326042.386138614-482.38613861386
267325560326042.386138614-482.38613861386
268387978326042.38613861461935.6138613861
269325560326042.386138614-482.38613861386
270336704326042.38613861410661.6138613861
271325560326042.386138614-482.38613861386
272325560326042.386138614-482.38613861386
273325560326042.386138614-482.38613861386
274322076326042.386138614-3966.38613861386
275325560326042.386138614-482.38613861386
276334272326042.3861386148229.61386138614
277338197326042.38613861412154.6138613861
278325560326042.386138614-482.38613861386
279321024326042.386138614-5018.38613861386
280322145326042.386138614-3897.38613861386
281325560326042.386138614-482.38613861386
282325560326042.386138614-482.38613861386
283323351326042.386138614-2691.38613861386
284325560326042.386138614-482.38613861386
285327748326042.3861386141705.61386138614
286325560326042.386138614-482.38613861386
287325560326042.386138614-482.38613861386
288328157326042.3861386142114.61386138614
289325560326042.386138614-482.38613861386
290311594326042.386138614-14448.3861386139
291325560326042.386138614-482.38613861386
292335962326042.3861386149919.61386138614
293372426326042.38613861446383.6138613861
294325560326042.386138614-482.38613861386
295319844326042.386138614-6198.38613861386
296355822326042.38613861429779.6138613861
297325560326042.386138614-482.38613861386
298325560326042.386138614-482.38613861386
299325560326042.386138614-482.38613861386
300325560326042.386138614-482.38613861386
301324047326042.386138614-1995.38613861386
302311464326042.386138614-14578.3861386139
303325560326042.386138614-482.38613861386
304325560326042.386138614-482.38613861386
305353417326042.38613861427374.6138613861
306325590326042.386138614-452.38613861386
307325560326042.386138614-482.38613861386
308328576326042.3861386142533.61386138614
309326126326042.38613861483.6138613861403
310325560326042.386138614-482.38613861386
311325560326042.386138614-482.38613861386
312369376412084.724137931-42708.724137931
313325560326042.386138614-482.38613861386
314332013326042.3861386145970.61386138614
315325871326042.386138614-171.386138613860
316342165326042.38613861416122.6138613861
317324967326042.386138614-1075.38613861386
318314832326042.386138614-11210.3861386139
319325557326042.386138614-485.38613861386
320325560326042.386138614-482.38613861386
321325560326042.386138614-482.38613861386
322325560326042.386138614-482.38613861386
323325560326042.386138614-482.38613861386
324325560326042.386138614-482.38613861386
325325560326042.386138614-482.38613861386
326322649326042.386138614-3393.38613861386
327325560326042.386138614-482.38613861386
328325560326042.386138614-482.38613861386
329325560326042.386138614-482.38613861386
330325560326042.386138614-482.38613861386
331325560326042.386138614-482.38613861386
332325560326042.386138614-482.38613861386
333325560326042.386138614-482.38613861386
334324598326042.386138614-1444.38613861386
335325567326042.386138614-475.38613861386
336325560326042.386138614-482.38613861386
337324005326042.386138614-2037.38613861386
338325560326042.386138614-482.38613861386
339325748326042.386138614-294.386138613860
340323385326042.386138614-2657.38613861386
341315409326042.386138614-10633.3861386139
342325560326042.386138614-482.38613861386
343325560326042.386138614-482.38613861386
344325560326042.386138614-482.38613861386
345325560326042.386138614-482.38613861386
346325560326042.386138614-482.38613861386
347312275326042.386138614-13767.3861386139
348325560326042.386138614-482.38613861386
349325560326042.386138614-482.38613861386
350325560326042.386138614-482.38613861386
351320576326042.386138614-5466.38613861386
352325246326042.386138614-796.38613861386
353332961326042.3861386146918.61386138614
354323010326042.386138614-3032.38613861386
355325560326042.386138614-482.38613861386
356325560326042.386138614-482.38613861386
357345253326042.38613861419210.6138613861
358325560326042.386138614-482.38613861386
359325560326042.386138614-482.38613861386
360325560326042.386138614-482.38613861386
361325559326042.386138614-483.38613861386
362325560326042.386138614-482.38613861386
363325560326042.386138614-482.38613861386
364319634326042.386138614-6408.38613861386
365319951326042.386138614-6091.38613861386
366325560326042.386138614-482.38613861386
367325560326042.386138614-482.38613861386
368325560326042.386138614-482.38613861386
369325560326042.386138614-482.38613861386
370325560326042.386138614-482.38613861386
371325560326042.386138614-482.38613861386
372318519326042.386138614-7523.38613861386
373343222326042.38613861417179.6138613861
374317234326042.386138614-8808.38613861386
375325560326042.386138614-482.38613861386
376325560326042.386138614-482.38613861386
377314025326042.386138614-12017.3861386139
378320249326042.386138614-5793.38613861386
379325560326042.386138614-482.38613861386
380325560326042.386138614-482.38613861386
381325560326042.386138614-482.38613861386
382349365326042.38613861423322.6138613861
383289197326042.386138614-36845.3861386139
384325560326042.386138614-482.38613861386
385329245326042.3861386143202.61386138614
386240869277262.666666667-36393.6666666667
387327182326042.3861386141139.61386138614
388322876326042.386138614-3166.38613861386
389323117326042.386138614-2925.38613861386
390306351326042.386138614-19691.3861386139
391335137326042.3861386149094.61386138614
392308271326042.386138614-17771.3861386139
393301731326042.386138614-24311.3861386139
394382409326042.38613861456366.6138613861
395279230277262.6666666671967.33333333331
396298731326042.386138614-27311.3861386139
397243650277262.666666667-33612.6666666667
398532682479017.38095238153664.6190476191
399319771326042.386138614-6271.38613861386
400171493277262.666666667-105769.666666667
401347262326042.38613861421219.6138613861
402343945326042.38613861417902.6138613861
403311874326042.386138614-14168.3861386139
404302211326042.386138614-23831.3861386139
405316708326042.386138614-9334.38613861386
406333463326042.3861386147420.61386138614
407344282326042.38613861418239.6138613861
408319635326042.386138614-6407.38613861386
409301186326042.386138614-24856.3861386139
410300381326042.386138614-25661.3861386139
411318765326042.386138614-7277.38613861386
412286146277262.6666666678883.33333333331
413306844326042.386138614-19198.3861386139
414307705277262.66666666730442.3333333333
415312448326042.386138614-13594.3861386139
416299715326042.386138614-26327.3861386139
417373399277262.66666666796136.3333333333
418299446326042.386138614-26596.3861386139
419325586326042.386138614-456.38613861386
420291221326042.386138614-34821.3861386139
421261173326042.386138614-64869.3861386139
422255027277262.666666667-22235.6666666667
423-78375277262.666666667-355637.666666667
424-58143277262.666666667-335405.666666667
425227033277262.666666667-50229.6666666667
426235098277262.666666667-42164.6666666667
42721267277262.666666667-255995.666666667
4282386751851927.5-1613252.5
429197687277262.666666667-79575.6666666667
430418341662903.65-244562.65
431-297706662903.65-960609.65
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934903k990b3lc9hbsohq/2alx61292934812.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934903k990b3lc9hbsohq/2alx61292934812.ps (open in new window)


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


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


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