Home » date » 2010 » Dec » 24 »

Workshop 7 group RP

*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: Fri, 24 Dec 2010 14:55:59 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa.htm/, Retrieved Fri, 24 Dec 2010 15:54:41 +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/24/t1293202477ly00sdp1f712wpa.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 time21 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.3287
R-squared0.108
RMSE0.4233


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
110.720930232558140.279069767441861
210.720930232558140.279069767441861
310.720930232558140.279069767441861
400.229381443298969-0.229381443298969
510.720930232558140.279069767441861
610.720930232558140.279069767441861
700.72093023255814-0.72093023255814
810.720930232558140.279069767441861
910.720930232558140.279069767441861
1010.720930232558140.279069767441861
1100.72093023255814-0.72093023255814
1200.72093023255814-0.72093023255814
1310.720930232558140.279069767441861
1400.229381443298969-0.229381443298969
1510.720930232558140.279069767441861
1600.72093023255814-0.72093023255814
1700.72093023255814-0.72093023255814
1810.720930232558140.279069767441861
1910.720930232558140.279069767441861
2000.229381443298969-0.229381443298969
2110.720930232558140.279069767441861
2210.720930232558140.279069767441861
2300.72093023255814-0.72093023255814
2400.229381443298969-0.229381443298969
2500.229381443298969-0.229381443298969
2600.72093023255814-0.72093023255814
2710.720930232558140.279069767441861
2800.229381443298969-0.229381443298969
2900.72093023255814-0.72093023255814
3000.229381443298969-0.229381443298969
3110.720930232558140.279069767441861
3210.720930232558140.279069767441861
3310.720930232558140.279069767441861
3410.720930232558140.279069767441861
3500.72093023255814-0.72093023255814
3600.229381443298969-0.229381443298969
3700.72093023255814-0.72093023255814
3810.720930232558140.279069767441861
3910.720930232558140.279069767441861
4000.229381443298969-0.229381443298969
4100.229381443298969-0.229381443298969
4200.229381443298969-0.229381443298969
4300.72093023255814-0.72093023255814
4400.229381443298969-0.229381443298969
4500.229381443298969-0.229381443298969
4610.2293814432989690.770618556701031
4710.720930232558140.279069767441861
4810.720930232558140.279069767441861
4900.229381443298969-0.229381443298969
5000.229381443298969-0.229381443298969
5110.720930232558140.279069767441861
5210.720930232558140.279069767441861
5310.720930232558140.279069767441861
5410.720930232558140.279069767441861
5510.2293814432989690.770618556701031
5600.229381443298969-0.229381443298969
5700.72093023255814-0.72093023255814
5800.229381443298969-0.229381443298969
5900.229381443298969-0.229381443298969
6010.2293814432989690.770618556701031
6110.720930232558140.279069767441861
6200.229381443298969-0.229381443298969
6310.2293814432989690.770618556701031
6410.2293814432989690.770618556701031
6500.229381443298969-0.229381443298969
6600.229381443298969-0.229381443298969
6700.229381443298969-0.229381443298969
6810.2293814432989690.770618556701031
6900.229381443298969-0.229381443298969
7010.2293814432989690.770618556701031
7110.2293814432989690.770618556701031
7200.229381443298969-0.229381443298969
7300.229381443298969-0.229381443298969
7400.229381443298969-0.229381443298969
7500.229381443298969-0.229381443298969
7610.2293814432989690.770618556701031
7700.229381443298969-0.229381443298969
7800.229381443298969-0.229381443298969
7900.229381443298969-0.229381443298969
8010.2293814432989690.770618556701031
8100.229381443298969-0.229381443298969
8210.2293814432989690.770618556701031
8300.229381443298969-0.229381443298969
8400.229381443298969-0.229381443298969
8500.229381443298969-0.229381443298969
8610.2293814432989690.770618556701031
8700.229381443298969-0.229381443298969
8800.229381443298969-0.229381443298969
8900.229381443298969-0.229381443298969
9000.229381443298969-0.229381443298969
9100.229381443298969-0.229381443298969
9210.2293814432989690.770618556701031
9300.229381443298969-0.229381443298969
9410.2293814432989690.770618556701031
9500.229381443298969-0.229381443298969
9610.2293814432989690.770618556701031
9700.229381443298969-0.229381443298969
9810.2293814432989690.770618556701031
9900.229381443298969-0.229381443298969
10010.2293814432989690.770618556701031
10110.2293814432989690.770618556701031
10200.229381443298969-0.229381443298969
10300.229381443298969-0.229381443298969
10400.229381443298969-0.229381443298969
10500.229381443298969-0.229381443298969
10600.229381443298969-0.229381443298969
10710.2293814432989690.770618556701031
10810.720930232558140.279069767441861
10900.229381443298969-0.229381443298969
11010.2293814432989690.770618556701031
11100.229381443298969-0.229381443298969
11210.2293814432989690.770618556701031
11300.229381443298969-0.229381443298969
11410.2293814432989690.770618556701031
11510.2293814432989690.770618556701031
11600.229381443298969-0.229381443298969
11700.229381443298969-0.229381443298969
11800.229381443298969-0.229381443298969
11910.2293814432989690.770618556701031
12000.229381443298969-0.229381443298969
12100.229381443298969-0.229381443298969
12200.229381443298969-0.229381443298969
12300.229381443298969-0.229381443298969
12410.720930232558140.279069767441861
12510.2293814432989690.770618556701031
12610.2293814432989690.770618556701031
12700.229381443298969-0.229381443298969
12800.229381443298969-0.229381443298969
12900.229381443298969-0.229381443298969
13000.229381443298969-0.229381443298969
13100.229381443298969-0.229381443298969
13200.229381443298969-0.229381443298969
13300.229381443298969-0.229381443298969
13400.229381443298969-0.229381443298969
13500.229381443298969-0.229381443298969
13600.229381443298969-0.229381443298969
13700.229381443298969-0.229381443298969
13800.229381443298969-0.229381443298969
13900.229381443298969-0.229381443298969
14000.229381443298969-0.229381443298969
14100.229381443298969-0.229381443298969
14200.229381443298969-0.229381443298969
14300.229381443298969-0.229381443298969
14400.229381443298969-0.229381443298969
14500.229381443298969-0.229381443298969
14600.229381443298969-0.229381443298969
14700.229381443298969-0.229381443298969
14800.229381443298969-0.229381443298969
14900.229381443298969-0.229381443298969
15000.229381443298969-0.229381443298969
15100.229381443298969-0.229381443298969
15200.229381443298969-0.229381443298969
15300.229381443298969-0.229381443298969
15400.229381443298969-0.229381443298969
15500.229381443298969-0.229381443298969
15600.229381443298969-0.229381443298969
15700.229381443298969-0.229381443298969
15800.229381443298969-0.229381443298969
15900.229381443298969-0.229381443298969
16000.229381443298969-0.229381443298969
16100.229381443298969-0.229381443298969
16200.229381443298969-0.229381443298969
16300.229381443298969-0.229381443298969
16400.229381443298969-0.229381443298969
16500.229381443298969-0.229381443298969
16600.229381443298969-0.229381443298969
16700.229381443298969-0.229381443298969
16800.229381443298969-0.229381443298969
16900.229381443298969-0.229381443298969
17000.229381443298969-0.229381443298969
17100.229381443298969-0.229381443298969
17200.229381443298969-0.229381443298969
17300.229381443298969-0.229381443298969
17400.229381443298969-0.229381443298969
17500.229381443298969-0.229381443298969
17600.229381443298969-0.229381443298969
17700.229381443298969-0.229381443298969
17810.2293814432989690.770618556701031
17900.229381443298969-0.229381443298969
18000.229381443298969-0.229381443298969
18100.229381443298969-0.229381443298969
18210.2293814432989690.770618556701031
18300.229381443298969-0.229381443298969
18410.2293814432989690.770618556701031
18510.2293814432989690.770618556701031
18610.2293814432989690.770618556701031
18710.2293814432989690.770618556701031
18800.229381443298969-0.229381443298969
18900.229381443298969-0.229381443298969
19000.229381443298969-0.229381443298969
19100.229381443298969-0.229381443298969
19200.229381443298969-0.229381443298969
19300.229381443298969-0.229381443298969
19400.229381443298969-0.229381443298969
19500.229381443298969-0.229381443298969
19610.2293814432989690.770618556701031
19710.2293814432989690.770618556701031
19810.2293814432989690.770618556701031
19910.2293814432989690.770618556701031
20010.2293814432989690.770618556701031
20110.2293814432989690.770618556701031
20210.2293814432989690.770618556701031
20310.2293814432989690.770618556701031
20410.2293814432989690.770618556701031
20510.2293814432989690.770618556701031
20610.2293814432989690.770618556701031
20710.2293814432989690.770618556701031
20810.2293814432989690.770618556701031
20910.2293814432989690.770618556701031
21010.2293814432989690.770618556701031
21100.229381443298969-0.229381443298969
21200.229381443298969-0.229381443298969
21300.229381443298969-0.229381443298969
21400.229381443298969-0.229381443298969
21500.229381443298969-0.229381443298969
21600.229381443298969-0.229381443298969
21700.229381443298969-0.229381443298969
21800.229381443298969-0.229381443298969
21900.229381443298969-0.229381443298969
22000.229381443298969-0.229381443298969
22100.229381443298969-0.229381443298969
22200.229381443298969-0.229381443298969
22300.229381443298969-0.229381443298969
22400.229381443298969-0.229381443298969
22500.229381443298969-0.229381443298969
22600.229381443298969-0.229381443298969
22700.229381443298969-0.229381443298969
22800.229381443298969-0.229381443298969
22900.229381443298969-0.229381443298969
23000.229381443298969-0.229381443298969
23100.229381443298969-0.229381443298969
23200.229381443298969-0.229381443298969
23300.229381443298969-0.229381443298969
23400.229381443298969-0.229381443298969
23500.229381443298969-0.229381443298969
23600.229381443298969-0.229381443298969
23700.229381443298969-0.229381443298969
23800.229381443298969-0.229381443298969
23900.229381443298969-0.229381443298969
24000.229381443298969-0.229381443298969
24100.229381443298969-0.229381443298969
24200.229381443298969-0.229381443298969
24300.229381443298969-0.229381443298969
24400.229381443298969-0.229381443298969
24500.229381443298969-0.229381443298969
24610.2293814432989690.770618556701031
24710.2293814432989690.770618556701031
24800.229381443298969-0.229381443298969
24910.2293814432989690.770618556701031
25010.2293814432989690.770618556701031
25100.229381443298969-0.229381443298969
25210.2293814432989690.770618556701031
25300.229381443298969-0.229381443298969
25400.229381443298969-0.229381443298969
25500.229381443298969-0.229381443298969
25600.229381443298969-0.229381443298969
25700.229381443298969-0.229381443298969
25800.229381443298969-0.229381443298969
25910.2293814432989690.770618556701031
26000.229381443298969-0.229381443298969
26110.2293814432989690.770618556701031
26210.2293814432989690.770618556701031
26300.229381443298969-0.229381443298969
26400.229381443298969-0.229381443298969
26510.2293814432989690.770618556701031
26600.229381443298969-0.229381443298969
26710.2293814432989690.770618556701031
26800.229381443298969-0.229381443298969
26910.2293814432989690.770618556701031
27000.229381443298969-0.229381443298969
27110.2293814432989690.770618556701031
27210.2293814432989690.770618556701031
27310.2293814432989690.770618556701031
27400.229381443298969-0.229381443298969
27500.229381443298969-0.229381443298969
27600.229381443298969-0.229381443298969
27700.229381443298969-0.229381443298969
27800.229381443298969-0.229381443298969
27910.2293814432989690.770618556701031
28000.229381443298969-0.229381443298969
28110.2293814432989690.770618556701031
28200.229381443298969-0.229381443298969
28300.229381443298969-0.229381443298969
28400.229381443298969-0.229381443298969
28500.229381443298969-0.229381443298969
28600.229381443298969-0.229381443298969
28710.2293814432989690.770618556701031
28800.229381443298969-0.229381443298969
28910.2293814432989690.770618556701031
29000.229381443298969-0.229381443298969
29110.2293814432989690.770618556701031
29200.229381443298969-0.229381443298969
29300.229381443298969-0.229381443298969
29400.229381443298969-0.229381443298969
29500.229381443298969-0.229381443298969
29610.2293814432989690.770618556701031
29700.229381443298969-0.229381443298969
29810.2293814432989690.770618556701031
29900.229381443298969-0.229381443298969
30000.229381443298969-0.229381443298969
30110.2293814432989690.770618556701031
30200.229381443298969-0.229381443298969
30300.229381443298969-0.229381443298969
30410.2293814432989690.770618556701031
30500.229381443298969-0.229381443298969
30600.229381443298969-0.229381443298969
30710.2293814432989690.770618556701031
30810.2293814432989690.770618556701031
30900.229381443298969-0.229381443298969
31010.2293814432989690.770618556701031
31110.2293814432989690.770618556701031
31200.229381443298969-0.229381443298969
31310.2293814432989690.770618556701031
31410.2293814432989690.770618556701031
31500.229381443298969-0.229381443298969
31600.229381443298969-0.229381443298969
31700.229381443298969-0.229381443298969
31800.229381443298969-0.229381443298969
31900.229381443298969-0.229381443298969
32000.229381443298969-0.229381443298969
32100.229381443298969-0.229381443298969
32200.229381443298969-0.229381443298969
32300.229381443298969-0.229381443298969
32410.2293814432989690.770618556701031
32500.229381443298969-0.229381443298969
32600.229381443298969-0.229381443298969
32710.2293814432989690.770618556701031
32810.2293814432989690.770618556701031
32900.229381443298969-0.229381443298969
33000.229381443298969-0.229381443298969
33100.229381443298969-0.229381443298969
33200.229381443298969-0.229381443298969
33300.229381443298969-0.229381443298969
33400.229381443298969-0.229381443298969
33500.229381443298969-0.229381443298969
33600.229381443298969-0.229381443298969
33700.229381443298969-0.229381443298969
33800.229381443298969-0.229381443298969
33900.229381443298969-0.229381443298969
34000.229381443298969-0.229381443298969
34100.229381443298969-0.229381443298969
34200.229381443298969-0.229381443298969
34300.229381443298969-0.229381443298969
34400.229381443298969-0.229381443298969
34500.229381443298969-0.229381443298969
34600.229381443298969-0.229381443298969
34700.229381443298969-0.229381443298969
34800.229381443298969-0.229381443298969
34900.229381443298969-0.229381443298969
35000.229381443298969-0.229381443298969
35100.229381443298969-0.229381443298969
35200.229381443298969-0.229381443298969
35300.229381443298969-0.229381443298969
35400.229381443298969-0.229381443298969
35500.229381443298969-0.229381443298969
35600.229381443298969-0.229381443298969
35700.229381443298969-0.229381443298969
35800.229381443298969-0.229381443298969
35900.229381443298969-0.229381443298969
36000.229381443298969-0.229381443298969
36100.229381443298969-0.229381443298969
36200.229381443298969-0.229381443298969
36300.229381443298969-0.229381443298969
36410.2293814432989690.770618556701031
36500.229381443298969-0.229381443298969
36600.229381443298969-0.229381443298969
36700.229381443298969-0.229381443298969
36800.229381443298969-0.229381443298969
36900.229381443298969-0.229381443298969
37000.229381443298969-0.229381443298969
37100.229381443298969-0.229381443298969
37200.229381443298969-0.229381443298969
37300.229381443298969-0.229381443298969
37400.229381443298969-0.229381443298969
37500.229381443298969-0.229381443298969
37600.229381443298969-0.229381443298969
37700.229381443298969-0.229381443298969
37800.229381443298969-0.229381443298969
37900.229381443298969-0.229381443298969
38000.229381443298969-0.229381443298969
38100.229381443298969-0.229381443298969
38200.229381443298969-0.229381443298969
38300.229381443298969-0.229381443298969
38400.229381443298969-0.229381443298969
38500.229381443298969-0.229381443298969
38600.229381443298969-0.229381443298969
38700.229381443298969-0.229381443298969
38800.229381443298969-0.229381443298969
38900.229381443298969-0.229381443298969
39000.229381443298969-0.229381443298969
39100.229381443298969-0.229381443298969
39200.229381443298969-0.229381443298969
39300.229381443298969-0.229381443298969
39400.229381443298969-0.229381443298969
39510.2293814432989690.770618556701031
39600.229381443298969-0.229381443298969
39700.229381443298969-0.229381443298969
39810.720930232558140.279069767441861
39900.229381443298969-0.229381443298969
40010.2293814432989690.770618556701031
40100.229381443298969-0.229381443298969
40200.229381443298969-0.229381443298969
40300.229381443298969-0.229381443298969
40410.2293814432989690.770618556701031
40500.229381443298969-0.229381443298969
40600.229381443298969-0.229381443298969
40700.229381443298969-0.229381443298969
40800.229381443298969-0.229381443298969
40900.229381443298969-0.229381443298969
41000.229381443298969-0.229381443298969
41100.229381443298969-0.229381443298969
41210.2293814432989690.770618556701031
41310.2293814432989690.770618556701031
41410.2293814432989690.770618556701031
41500.229381443298969-0.229381443298969
41600.229381443298969-0.229381443298969
41700.229381443298969-0.229381443298969
41810.2293814432989690.770618556701031
41900.229381443298969-0.229381443298969
42000.229381443298969-0.229381443298969
42100.229381443298969-0.229381443298969
42200.229381443298969-0.229381443298969
42310.2293814432989690.770618556701031
42400.229381443298969-0.229381443298969
42500.229381443298969-0.229381443298969
42610.2293814432989690.770618556701031
42700.229381443298969-0.229381443298969
42800.229381443298969-0.229381443298969
42900.229381443298969-0.229381443298969
43000.229381443298969-0.229381443298969
43100.229381443298969-0.229381443298969
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/2zila1293202536.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/2zila1293202536.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/3zila1293202536.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/3zila1293202536.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/4ar3d1293202536.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293202477ly00sdp1f712wpa/4ar3d1293202536.ps (open in new window)


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