Home » date » 2010 » Dec » 21 »

orders ws10

*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:25: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/t1292934237u5fvzphop5pqyzi.htm/, Retrieved Tue, 21 Dec 2010 13:24:07 +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/t1292934237u5fvzphop5pqyzi.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 «
4321023 29790 444 81767 1 1 4111912 87550 412 153198 1 1 223193 84738 428 -26007 0 1 1491348 54660 315 126942 1 1 1629616 42634 168 157214 1 0 1398893 40949 263 129352 0 1 1926517 45187 267 234817 1 0 983660 37704 228 60448 1 1 1443586 16275 129 47818 1 1 1073089 25830 104 245546 0 1 984885 12679 122 48020 0 1 1405225 18014 393 -1710 1 1 227132 43556 190 32648 0 1 929118 24811 280 95350 1 1 1071292 6575 63 151352 0 0 638830 7123 102 288170 0 0 856956 21950 265 114337 1 1 992426 37597 234 37884 1 1 444477 17821 277 122844 0 1 857217 12988 73 82340 1 1 711969 22330 67 79801 1 0 702380 13326 103 165548 0 0 358589 16189 290 116384 0 1 297978 7146 83 134028 0 1 585715 15824 56 63838 0 1 657954 27664 236 74996 1 1 209458 11920 73 31080 0 1 786690 8568 34 32168 0 1 439798 14416 139 49857 0 1 688779 3369 26 87161 1 1 574339 11819 70 106113 1 1 741409 6984 40 80570 1 0 597793 4519 42 102129 1 1 644190 2220 12 301670 0 1 377934 18562 211 102313 0 1 640273 10327 74 88577 0 1 697458 53 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 time18 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.871
R-squared0.7586
RMSE31.6689


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
1444250.636363636364193.363636363636
2412250.636363636364161.363636363636
3428250.636363636364177.363636363636
4315250.63636363636464.3636363636364
5168250.636363636364-82.6363636363636
6263250.63636363636412.3636363636364
7267250.63636363636416.3636363636364
8228250.636363636364-22.6363636363636
9129250.636363636364-121.636363636364
10104250.636363636364-146.636363636364
1112277.836734693877544.1632653061225
12393250.636363636364142.363636363636
13190250.636363636364-60.6363636363636
14280250.63636363636429.3636363636364
156377.8367346938775-14.8367346938775
1610277.836734693877524.1632653061225
17265250.63636363636414.3636363636364
18234250.636363636364-16.6363636363636
19277250.63636363636426.3636363636364
207377.8367346938775-4.83673469387755
2167250.636363636364-183.636363636364
2210377.836734693877525.1632653061225
23290250.63636363636439.3636363636364
248377.83673469387755.16326530612245
255677.8367346938775-21.8367346938775
26236250.636363636364-14.6363636363636
277377.8367346938775-4.83673469387755
283477.8367346938775-43.8367346938775
2913977.836734693877561.1632653061225
302638.0735294117647-12.0735294117647
317077.8367346938775-7.83673469387755
324077.8367346938775-37.8367346938775
334277.8367346938775-35.8367346938775
341238.0735294117647-26.0735294117647
35211250.636363636364-39.6363636363636
367477.8367346938775-3.83673469387755
378077.83673469387752.16326530612245
388338.073529411764744.9264705882353
3913177.836734693877553.1632653061225
4020377.8367346938775125.163265306122
415677.8367346938775-21.8367346938775
428977.836734693877511.1632653061225
438877.836734693877510.1632653061225
443977.8367346938775-38.8367346938775
452538.0735294117647-13.0735294117647
464977.8367346938775-28.8367346938775
4714977.836734693877571.1632653061225
485877.8367346938775-19.8367346938775
494138.07352941176472.9264705882353
509038.073529411764751.9264705882353
5113677.836734693877558.1632653061225
529777.836734693877519.1632653061225
536320.823529411764742.1764705882353
5411477.836734693877536.1632653061225
557738.073529411764738.9264705882353
56638.0735294117647-32.0735294117647
574777.8367346938775-30.8367346938775
585138.073529411764712.9264705882353
598577.83673469387757.16326530612245
604377.8367346938775-34.8367346938775
613238.0735294117647-6.0735294117647
622538.0735294117647-13.0735294117647
637777.8367346938775-0.836734693877546
645438.073529411764715.9264705882353
6525177.8367346938775173.163265306122
661511.80869565217393.19130434782609
674438.07352941176475.9264705882353
687338.073529411764734.9264705882353
698577.83673469387757.16326530612245
704938.073529411764710.9264705882353
713877.8367346938775-39.8367346938775
723538.0735294117647-3.0735294117647
73911.8086956521739-2.80869565217391
743438.0735294117647-4.0735294117647
752038.0735294117647-18.0735294117647
762920.82352941176478.1764705882353
771111.8086956521739-0.808695652173913
785238.073529411764713.9264705882353
791311.80869565217391.19130434782609
802938.0735294117647-9.0735294117647
816677.8367346938775-11.8367346938775
823320.823529411764712.1764705882353
831511.80869565217393.19130434782609
841520.8235294117647-5.82352941176471
856877.8367346938775-9.83673469387755
8610038.073529411764761.9264705882353
871320.8235294117647-7.8235294117647
884538.07352941176476.9264705882353
891420.8235294117647-6.82352941176471
903638.0735294117647-2.07352941176470
914038.07352941176471.92647058823530
926838.073529411764729.9264705882353
932977.8367346938775-48.8367346938775
944338.07352941176474.9264705882353
953038.0735294117647-8.0735294117647
96920.8235294117647-11.8235294117647
972238.0735294117647-16.0735294117647
981938.0735294117647-19.0735294117647
99938.0735294117647-29.0735294117647
1003111.808695652173919.1913043478261
1011911.80869565217397.19130434782609
1025538.073529411764716.9264705882353
103811.8086956521739-3.80869565217391
1042838.0735294117647-10.0735294117647
1052911.808695652173917.1913043478261
1064838.07352941176479.9264705882353
1071638.0735294117647-22.0735294117647
1084777.8367346938775-30.8367346938775
1092038.0735294117647-18.0735294117647
1102220.82352941176471.17647058823529
1113338.0735294117647-5.0735294117647
1124477.8367346938775-33.8367346938775
1131338.0735294117647-25.0735294117647
114638.0735294117647-32.0735294117647
1153538.0735294117647-3.0735294117647
116811.8086956521739-3.80869565217391
1171738.0735294117647-21.0735294117647
1181138.0735294117647-27.0735294117647
1192111.80869565217399.19130434782609
1209277.836734693877514.1632653061225
1211211.80869565217390.191304347826087
12211238.073529411764773.9264705882353
1232538.0735294117647-13.0735294117647
1241738.0735294117647-21.0735294117647
1252338.0735294117647-15.0735294117647
12600.170940170940171-0.170940170940171
127104.928571428571435.07142857142857
1282311.808695652173911.1913043478261
12900.170940170940171-0.170940170940171
13074.928571428571432.07142857142857
1312538.0735294117647-13.0735294117647
13210.1709401709401710.829059829059829
133204.9285714285714315.0714285714286
134411.8086956521739-7.80869565217391
135411.8086956521739-7.80869565217391
136104.928571428571435.07142857142857
13714.92857142857143-3.92857142857143
138411.8086956521739-7.80869565217391
13900.170940170940171-0.170940170940171
140811.8086956521739-3.80869565217391
14100.170940170940171-0.170940170940171
1421111.8086956521739-0.808695652173913
14344.92857142857143-0.92857142857143
1441511.80869565217393.19130434782609
145911.8086956521739-2.80869565217391
14600.170940170940171-0.170940170940171
14774.928571428571432.07142857142857
148211.8086956521739-9.80869565217391
14904.92857142857143-4.92857142857143
150711.8086956521739-4.80869565217391
1514638.07352941176477.9264705882353
15250.1709401709401714.82905982905983
153711.8086956521739-4.80869565217391
15424.92857142857143-2.92857142857143
15500.170940170940171-0.170940170940171
15600.170940170940171-0.170940170940171
15724.92857142857143-2.92857142857143
158511.8086956521739-6.80869565217391
15900.170940170940171-0.170940170940171
16000.170940170940171-0.170940170940171
16100.170940170940171-0.170940170940171
16200.170940170940171-0.170940170940171
163711.8086956521739-4.80869565217391
1642411.808695652173912.1913043478261
16514.92857142857143-3.92857142857143
16600.170940170940171-0.170940170940171
1671820.8235294117647-2.82352941176471
1685577.8367346938775-22.8367346938775
16900.170940170940171-0.170940170940171
17000.170940170940171-0.170940170940171
17134.92857142857143-1.92857142857143
17200.170940170940171-0.170940170940171
173911.8086956521739-2.80869565217391
17400.170940170940171-0.170940170940171
175811.8086956521739-3.80869565217391
17611311.8086956521739101.191304347826
17704.92857142857143-4.92857142857143
17800.170940170940171-0.170940170940171
17900.170940170940171-0.170940170940171
1801920.8235294117647-1.82352941176471
1811111.8086956521739-0.808695652173913
1822538.0735294117647-13.0735294117647
1831611.80869565217394.19130434782609
18454.928571428571430.0714285714285712
1851111.8086956521739-0.808695652173913
1862338.0735294117647-15.0735294117647
187611.8086956521739-5.80869565217391
188511.8086956521739-6.80869565217391
18900.170940170940171-0.170940170940171
190711.8086956521739-4.80869565217391
19100.170940170940171-0.170940170940171
192711.8086956521739-4.80869565217391
19300.170940170940171-0.170940170940171
19434.92857142857143-1.92857142857143
19500.170940170940171-0.170940170940171
1968977.836734693877511.1632653061225
19700.170940170940171-0.170940170940171
19800.170940170940171-0.170940170940171
1991911.80869565217397.19130434782609
20000.170940170940171-0.170940170940171
20100.170940170940171-0.170940170940171
20200.170940170940171-0.170940170940171
2031211.80869565217390.191304347826087
2041211.80869565217390.191304347826087
20554.928571428571430.0714285714285712
20624.92857142857143-2.92857142857143
20700.170940170940171-0.170940170940171
2082620.82352941176475.17647058823529
209311.8086956521739-8.80869565217391
21000.170940170940171-0.170940170940171
21100.170940170940171-0.170940170940171
2121111.8086956521739-0.808695652173913
2131011.8086956521739-1.80869565217391
214511.8086956521739-6.80869565217391
21520.1709401709401711.82905982905983
21664.928571428571431.07142857142857
217711.8086956521739-4.80869565217391
21820.1709401709401711.82905982905983
2192838.0735294117647-10.0735294117647
220311.8086956521739-8.80869565217391
22100.170940170940171-0.170940170940171
22214.92857142857143-3.92857142857143
2232011.80869565217398.19130434782609
22414.92857142857143-3.92857142857143
2252211.808695652173910.1913043478261
22694.928571428571434.07142857142857
22700.170940170940171-0.170940170940171
228211.8086956521739-9.80869565217391
22900.170940170940171-0.170940170940171
230711.8086956521739-4.80869565217391
231911.8086956521739-2.80869565217391
23200.170940170940171-0.170940170940171
2331311.80869565217391.19130434782609
23400.170940170940171-0.170940170940171
23504.92857142857143-4.92857142857143
23600.170940170940171-0.170940170940171
23764.928571428571431.07142857142857
23800.170940170940171-0.170940170940171
23900.170940170940171-0.170940170940171
24000.170940170940171-0.170940170940171
24134.92857142857143-1.92857142857143
24200.170940170940171-0.170940170940171
24374.928571428571432.07142857142857
244238.0735294117647-36.0735294117647
24500.170940170940171-0.170940170940171
24600.170940170940171-0.170940170940171
2471511.80869565217393.19130434782609
24800.170940170940171-0.170940170940171
24900.170940170940171-0.170940170940171
250911.8086956521739-2.80869565217391
25100.170940170940171-0.170940170940171
252111.8086956521739-10.8086956521739
2533811.808695652173926.1913043478261
2545738.073529411764718.9264705882353
25500.170940170940171-0.170940170940171
256711.8086956521739-4.80869565217391
2572611.808695652173914.1913043478261
25800.170940170940171-0.170940170940171
25900.170940170940171-0.170940170940171
26000.170940170940171-0.170940170940171
26100.170940170940171-0.170940170940171
2621320.8235294117647-7.8235294117647
2631011.8086956521739-1.80869565217391
26400.170940170940171-0.170940170940171
26500.170940170940171-0.170940170940171
26600.170940170940171-0.170940170940171
267920.8235294117647-11.8235294117647
26800.170940170940171-0.170940170940171
2692611.808695652173914.1913043478261
27000.170940170940171-0.170940170940171
27100.170940170940171-0.170940170940171
27200.170940170940171-0.170940170940171
2731911.80869565217397.19130434782609
27400.170940170940171-0.170940170940171
2751211.80869565217390.191304347826087
2762311.808695652173911.1913043478261
27700.170940170940171-0.170940170940171
2782938.0735294117647-9.0735294117647
279811.8086956521739-3.80869565217391
28000.170940170940171-0.170940170940171
28100.170940170940171-0.170940170940171
2822611.808695652173914.1913043478261
28300.170940170940171-0.170940170940171
284911.8086956521739-2.80869565217391
28500.170940170940171-0.170940170940171
286511.8086956521739-6.80869565217391
28734.92857142857143-1.92857142857143
28800.170940170940171-0.170940170940171
2891311.80869565217391.19130434782609
29000.170940170940171-0.170940170940171
2911211.80869565217390.191304347826087
2921920.8235294117647-1.82352941176471
29300.170940170940171-0.170940170940171
294104.928571428571435.07142857142857
295911.8086956521739-2.80869565217391
29600.170940170940171-0.170940170940171
29700.170940170940171-0.170940170940171
29800.170940170940171-0.170940170940171
29990.1709401709401718.82905982905983
30044.92857142857143-0.92857142857143
301111.8086956521739-10.8086956521739
30210.1709401709401710.829059829059829
30300.170940170940171-0.170940170940171
3041420.8235294117647-6.82352941176471
305124.928571428571437.07142857142857
30600.170940170940171-0.170940170940171
3071911.80869565217397.19130434782609
3081711.80869565217395.19130434782609
30900.170940170940171-0.170940170940171
31000.170940170940171-0.170940170940171
3113220.823529411764711.1764705882353
31200.170940170940171-0.170940170940171
313144.928571428571439.07142857142857
31484.928571428571433.07142857142857
315411.8086956521739-7.80869565217391
31604.92857142857143-4.92857142857143
3172011.80869565217398.19130434782609
31854.928571428571430.0714285714285712
31900.170940170940171-0.170940170940171
32000.170940170940171-0.170940170940171
32100.170940170940171-0.170940170940171
32200.170940170940171-0.170940170940171
32300.170940170940171-0.170940170940171
32400.170940170940171-0.170940170940171
32514.92857142857143-3.92857142857143
32600.170940170940171-0.170940170940171
32700.170940170940171-0.170940170940171
32800.170940170940171-0.170940170940171
32900.170940170940171-0.170940170940171
33000.170940170940171-0.170940170940171
33100.170940170940171-0.170940170940171
33200.170940170940171-0.170940170940171
33344.92857142857143-0.92857142857143
33414.92857142857143-3.92857142857143
335411.8086956521739-7.80869565217391
3362011.80869565217398.19130434782609
33700.170940170940171-0.170940170940171
33814.92857142857143-3.92857142857143
3391011.8086956521739-1.80869565217391
3401211.80869565217390.191304347826087
34100.170940170940171-0.170940170940171
34200.170940170940171-0.170940170940171
34300.170940170940171-0.170940170940171
3441311.80869565217391.19130434782609
34500.170940170940171-0.170940170940171
34634.92857142857143-1.92857142857143
34700.170940170940171-0.170940170940171
34800.170940170940171-0.170940170940171
3491038.0735294117647-28.0735294117647
350311.8086956521739-8.80869565217391
35174.928571428571432.07142857142857
3521011.8086956521739-1.80869565217391
353111.8086956521739-10.8086956521739
35400.170940170940171-0.170940170940171
35500.170940170940171-0.170940170940171
3561511.80869565217393.19130434782609
35700.170940170940171-0.170940170940171
35800.170940170940171-0.170940170940171
35900.170940170940171-0.170940170940171
36044.92857142857143-0.92857142857143
36100.170940170940171-0.170940170940171
36200.170940170940171-0.170940170940171
3632838.0735294117647-10.0735294117647
364911.8086956521739-2.80869565217391
36500.170940170940171-0.170940170940171
36600.170940170940171-0.170940170940171
36700.170940170940171-0.170940170940171
36800.170940170940171-0.170940170940171
369711.8086956521739-4.80869565217391
37000.170940170940171-0.170940170940171
371711.8086956521739-4.80869565217391
372711.8086956521739-4.80869565217391
373311.8086956521739-8.80869565217391
37400.170940170940171-0.170940170940171
37500.170940170940171-0.170940170940171
3761111.8086956521739-0.808695652173913
377711.8086956521739-4.80869565217391
3781038.0735294117647-28.0735294117647
37900.170940170940171-0.170940170940171
38000.170940170940171-0.170940170940171
3811811.80869565217396.19130434782609
3821411.80869565217392.19130434782609
38300.170940170940171-0.170940170940171
384124.928571428571437.07142857142857
3852938.0735294117647-9.0735294117647
386311.8086956521739-8.80869565217391
387611.8086956521739-5.80869565217391
38834.92857142857143-1.92857142857143
389811.8086956521739-3.80869565217391
3901011.8086956521739-1.80869565217391
391611.8086956521739-5.80869565217391
392811.8086956521739-3.80869565217391
393620.8235294117647-14.8235294117647
394938.0735294117647-29.0735294117647
395811.8086956521739-3.80869565217391
3962677.8367346938775-51.8367346938775
39723938.0735294117647200.926470588235
398711.8086956521739-4.80869565217391
3994138.07352941176472.9264705882353
400311.8086956521739-8.80869565217391
401811.8086956521739-3.80869565217391
402611.8086956521739-5.80869565217391
4032138.0735294117647-17.0735294117647
404711.8086956521739-4.80869565217391
4051111.8086956521739-0.808695652173913
4061111.8086956521739-0.808695652173913
4071211.80869565217390.191304347826087
408911.8086956521739-2.80869565217391
409311.8086956521739-8.80869565217391
4105738.073529411764718.9264705882353
4112177.8367346938775-56.8367346938775
4121511.80869565217393.19130434782609
4133238.0735294117647-6.0735294117647
4141138.0735294117647-27.0735294117647
415211.8086956521739-9.80869565217391
4162338.0735294117647-15.0735294117647
4172011.80869565217398.19130434782609
4182411.808695652173912.1913043478261
419111.8086956521739-10.8086956521739
420111.8086956521739-10.8086956521739
4217438.073529411764735.9264705882353
4226877.8367346938775-9.83673469387755
4232077.8367346938775-57.8367346938775
4242038.0735294117647-18.0735294117647
4258277.83673469387754.16326530612245
4262138.0735294117647-17.0735294117647
427244250.636363636364-6.63636363636363
4283277.8367346938775-45.8367346938775
4298677.83673469387758.16326530612245
43069250.636363636364-181.636363636364
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934237u5fvzphop5pqyzi/2d7651292934339.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934237u5fvzphop5pqyzi/2d7651292934339.ps (open in new window)


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


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


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