Home » date » 2010 » Dec » 21 »

group 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:29:12 +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/t1292934444tazj7a3mvaqhjp1.htm/, Retrieved Tue, 21 Dec 2010 13:27:28 +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/t1292934444tazj7a3mvaqhjp1.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.378
R-squared0.1429
RMSE0.4142


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
110.7241379310344830.275862068965517
210.7241379310344830.275862068965517
300.328767123287671-0.328767123287671
410.7241379310344830.275862068965517
510.4761904761904760.523809523809524
600.724137931034483-0.724137931034483
710.4761904761904760.523809523809524
810.7241379310344830.275862068965517
910.7241379310344830.275862068965517
1000.724137931034483-0.724137931034483
1100.724137931034483-0.724137931034483
1210.7241379310344830.275862068965517
1300.328767123287671-0.328767123287671
1410.7241379310344830.275862068965517
1500.476190476190476-0.476190476190476
1600.476190476190476-0.476190476190476
1710.7241379310344830.275862068965517
1810.7241379310344830.275862068965517
1900.328767123287671-0.328767123287671
2010.7241379310344830.275862068965517
2110.4761904761904760.523809523809524
2200.476190476190476-0.476190476190476
2300.328767123287671-0.328767123287671
2400.328767123287671-0.328767123287671
2500.724137931034483-0.724137931034483
2610.7241379310344830.275862068965517
2700.328767123287671-0.328767123287671
2800.724137931034483-0.724137931034483
2900.328767123287671-0.328767123287671
3010.7241379310344830.275862068965517
3110.7241379310344830.275862068965517
3210.4761904761904760.523809523809524
3310.7241379310344830.275862068965517
3400.724137931034483-0.724137931034483
3500.328767123287671-0.328767123287671
3600.724137931034483-0.724137931034483
3710.7241379310344830.275862068965517
3810.7241379310344830.275862068965517
3900.328767123287671-0.328767123287671
4000.476190476190476-0.476190476190476
4100.328767123287671-0.328767123287671
4200.476190476190476-0.476190476190476
4300.476190476190476-0.476190476190476
4400.476190476190476-0.476190476190476
4510.3287671232876710.671232876712329
4610.3287671232876710.671232876712329
4710.3287671232876710.671232876712329
4800.328767123287671-0.328767123287671
4900.328767123287671-0.328767123287671
5010.7241379310344830.275862068965517
5110.7241379310344830.275862068965517
5210.7241379310344830.275862068965517
5310.09937888198757760.900621118012422
5410.3287671232876710.671232876712329
5500.0993788819875776-0.0993788819875776
5600.724137931034483-0.724137931034483
5700.476190476190476-0.476190476190476
5800.328767123287671-0.328767123287671
5910.3287671232876710.671232876712329
6010.4761904761904760.523809523809524
6100.0993788819875776-0.0993788819875776
6210.3287671232876710.671232876712329
6310.4761904761904760.523809523809524
6400.0993788819875776-0.0993788819875776
6500.328767123287671-0.328767123287671
6600.328767123287671-0.328767123287671
6710.3287671232876710.671232876712329
6800.328767123287671-0.328767123287671
6910.3287671232876710.671232876712329
7010.3287671232876710.671232876712329
7100.476190476190476-0.476190476190476
7200.0993788819875776-0.0993788819875776
7300.328767123287671-0.328767123287671
7400.328767123287671-0.328767123287671
7510.3287671232876710.671232876712329
7600.0993788819875776-0.0993788819875776
7700.0993788819875776-0.0993788819875776
7800.328767123287671-0.328767123287671
7910.3287671232876710.671232876712329
8000.328767123287671-0.328767123287671
8110.4761904761904760.523809523809524
8200.328767123287671-0.328767123287671
8300.0993788819875776-0.0993788819875776
8400.328767123287671-0.328767123287671
8510.3287671232876710.671232876712329
8600.328767123287671-0.328767123287671
8700.0993788819875776-0.0993788819875776
8800.0993788819875776-0.0993788819875776
8900.0993788819875776-0.0993788819875776
9000.0993788819875776-0.0993788819875776
9110.3287671232876710.671232876712329
9200.328767123287671-0.328767123287671
9310.3287671232876710.671232876712329
9400.328767123287671-0.328767123287671
9510.4761904761904760.523809523809524
9600.328767123287671-0.328767123287671
9710.3287671232876710.671232876712329
9800.0993788819875776-0.0993788819875776
9910.3287671232876710.671232876712329
10010.3287671232876710.671232876712329
10100.328767123287671-0.328767123287671
10200.328767123287671-0.328767123287671
10300.328767123287671-0.328767123287671
10400.328767123287671-0.328767123287671
10500.328767123287671-0.328767123287671
10610.3287671232876710.671232876712329
10710.7241379310344830.275862068965517
10800.476190476190476-0.476190476190476
10910.3287671232876710.671232876712329
11000.328767123287671-0.328767123287671
11110.3287671232876710.671232876712329
11200.476190476190476-0.476190476190476
11310.3287671232876710.671232876712329
11410.3287671232876710.671232876712329
11500.0993788819875776-0.0993788819875776
11600.0993788819875776-0.0993788819875776
11700.0993788819875776-0.0993788819875776
11810.3287671232876710.671232876712329
11900.328767123287671-0.328767123287671
12000.328767123287671-0.328767123287671
12100.0993788819875776-0.0993788819875776
12200.328767123287671-0.328767123287671
12310.7241379310344830.275862068965517
12410.3287671232876710.671232876712329
12510.4761904761904760.523809523809524
12600.0993788819875776-0.0993788819875776
12700.0993788819875776-0.0993788819875776
12800.0993788819875776-0.0993788819875776
12900.328767123287671-0.328767123287671
13000.0993788819875776-0.0993788819875776
13100.328767123287671-0.328767123287671
13200.328767123287671-0.328767123287671
13300.0993788819875776-0.0993788819875776
13400.0993788819875776-0.0993788819875776
13500.0993788819875776-0.0993788819875776
13600.328767123287671-0.328767123287671
13700.0993788819875776-0.0993788819875776
13800.0993788819875776-0.0993788819875776
13900.0993788819875776-0.0993788819875776
14000.0993788819875776-0.0993788819875776
14100.328767123287671-0.328767123287671
14200.0993788819875776-0.0993788819875776
14300.0993788819875776-0.0993788819875776
14400.328767123287671-0.328767123287671
14500.0993788819875776-0.0993788819875776
14600.328767123287671-0.328767123287671
14700.0993788819875776-0.0993788819875776
14800.328767123287671-0.328767123287671
14900.328767123287671-0.328767123287671
15000.0993788819875776-0.0993788819875776
15100.0993788819875776-0.0993788819875776
15200.0993788819875776-0.0993788819875776
15300.328767123287671-0.328767123287671
15400.0993788819875776-0.0993788819875776
15500.0993788819875776-0.0993788819875776
15600.0993788819875776-0.0993788819875776
15700.0993788819875776-0.0993788819875776
15800.0993788819875776-0.0993788819875776
15900.0993788819875776-0.0993788819875776
16000.0993788819875776-0.0993788819875776
16100.328767123287671-0.328767123287671
16200.0993788819875776-0.0993788819875776
16300.0993788819875776-0.0993788819875776
16400.328767123287671-0.328767123287671
16500.0993788819875776-0.0993788819875776
16600.328767123287671-0.328767123287671
16700.328767123287671-0.328767123287671
16800.328767123287671-0.328767123287671
16900.0993788819875776-0.0993788819875776
17000.0993788819875776-0.0993788819875776
17100.328767123287671-0.328767123287671
17200.328767123287671-0.328767123287671
17300.328767123287671-0.328767123287671
17400.328767123287671-0.328767123287671
17500.0993788819875776-0.0993788819875776
17600.0993788819875776-0.0993788819875776
17710.3287671232876710.671232876712329
17800.0993788819875776-0.0993788819875776
17900.0993788819875776-0.0993788819875776
18000.328767123287671-0.328767123287671
18110.09937888198757760.900621118012422
18200.0993788819875776-0.0993788819875776
18310.09937888198757760.900621118012422
18410.3287671232876710.671232876712329
18510.3287671232876710.671232876712329
18610.09937888198757760.900621118012422
18700.0993788819875776-0.0993788819875776
18800.328767123287671-0.328767123287671
18900.0993788819875776-0.0993788819875776
19000.0993788819875776-0.0993788819875776
19100.0993788819875776-0.0993788819875776
19200.0993788819875776-0.0993788819875776
19300.328767123287671-0.328767123287671
19400.0993788819875776-0.0993788819875776
19510.3287671232876710.671232876712329
19610.3287671232876710.671232876712329
19710.3287671232876710.671232876712329
19810.3287671232876710.671232876712329
19910.3287671232876710.671232876712329
20010.3287671232876710.671232876712329
20110.3287671232876710.671232876712329
20210.3287671232876710.671232876712329
20310.09937888198757760.900621118012422
20410.3287671232876710.671232876712329
20510.3287671232876710.671232876712329
20610.3287671232876710.671232876712329
20710.3287671232876710.671232876712329
20810.09937888198757760.900621118012422
20910.09937888198757760.900621118012422
21000.0993788819875776-0.0993788819875776
21100.328767123287671-0.328767123287671
21200.328767123287671-0.328767123287671
21300.328767123287671-0.328767123287671
21400.328767123287671-0.328767123287671
21500.328767123287671-0.328767123287671
21600.0993788819875776-0.0993788819875776
21700.0993788819875776-0.0993788819875776
21800.0993788819875776-0.0993788819875776
21900.0993788819875776-0.0993788819875776
22000.328767123287671-0.328767123287671
22100.328767123287671-0.328767123287671
22200.328767123287671-0.328767123287671
22300.0993788819875776-0.0993788819875776
22400.0993788819875776-0.0993788819875776
22500.0993788819875776-0.0993788819875776
22600.0993788819875776-0.0993788819875776
22700.328767123287671-0.328767123287671
22800.328767123287671-0.328767123287671
22900.0993788819875776-0.0993788819875776
23000.328767123287671-0.328767123287671
23100.328767123287671-0.328767123287671
23200.328767123287671-0.328767123287671
23300.0993788819875776-0.0993788819875776
23400.0993788819875776-0.0993788819875776
23500.0993788819875776-0.0993788819875776
23600.0993788819875776-0.0993788819875776
23700.0993788819875776-0.0993788819875776
23800.328767123287671-0.328767123287671
23900.328767123287671-0.328767123287671
24000.0993788819875776-0.0993788819875776
24100.328767123287671-0.328767123287671
24200.0993788819875776-0.0993788819875776
24300.328767123287671-0.328767123287671
24400.328767123287671-0.328767123287671
24510.3287671232876710.671232876712329
24610.3287671232876710.671232876712329
24700.0993788819875776-0.0993788819875776
24810.3287671232876710.671232876712329
24910.09937888198757760.900621118012422
25000.328767123287671-0.328767123287671
25110.3287671232876710.671232876712329
25200.328767123287671-0.328767123287671
25300.0993788819875776-0.0993788819875776
25400.0993788819875776-0.0993788819875776
25500.0993788819875776-0.0993788819875776
25600.0993788819875776-0.0993788819875776
25700.0993788819875776-0.0993788819875776
25810.3287671232876710.671232876712329
25900.328767123287671-0.328767123287671
26010.3287671232876710.671232876712329
26110.3287671232876710.671232876712329
26200.0993788819875776-0.0993788819875776
26300.328767123287671-0.328767123287671
26410.3287671232876710.671232876712329
26500.328767123287671-0.328767123287671
26610.09937888198757760.900621118012422
26700.328767123287671-0.328767123287671
26810.3287671232876710.671232876712329
26900.328767123287671-0.328767123287671
27010.3287671232876710.671232876712329
27110.3287671232876710.671232876712329
27210.3287671232876710.671232876712329
27300.0993788819875776-0.0993788819875776
27400.0993788819875776-0.0993788819875776
27500.328767123287671-0.328767123287671
27600.0993788819875776-0.0993788819875776
27700.328767123287671-0.328767123287671
27810.3287671232876710.671232876712329
27900.328767123287671-0.328767123287671
28010.3287671232876710.671232876712329
28100.0993788819875776-0.0993788819875776
28200.328767123287671-0.328767123287671
28300.0993788819875776-0.0993788819875776
28400.328767123287671-0.328767123287671
28500.328767123287671-0.328767123287671
28610.3287671232876710.671232876712329
28700.0993788819875776-0.0993788819875776
28810.09937888198757760.900621118012422
28900.0993788819875776-0.0993788819875776
29010.3287671232876710.671232876712329
29100.0993788819875776-0.0993788819875776
29200.328767123287671-0.328767123287671
29300.0993788819875776-0.0993788819875776
29400.328767123287671-0.328767123287671
29510.3287671232876710.671232876712329
29600.0993788819875776-0.0993788819875776
29710.09937888198757760.900621118012422
29800.328767123287671-0.328767123287671
29900.0993788819875776-0.0993788819875776
30010.3287671232876710.671232876712329
30100.328767123287671-0.328767123287671
30200.328767123287671-0.328767123287671
30310.3287671232876710.671232876712329
30400.0993788819875776-0.0993788819875776
30500.0993788819875776-0.0993788819875776
30610.3287671232876710.671232876712329
30710.3287671232876710.671232876712329
30800.0993788819875776-0.0993788819875776
30910.3287671232876710.671232876712329
31010.3287671232876710.671232876712329
31100.328767123287671-0.328767123287671
31210.3287671232876710.671232876712329
31310.09937888198757760.900621118012422
31400.0993788819875776-0.0993788819875776
31500.0993788819875776-0.0993788819875776
31600.0993788819875776-0.0993788819875776
31700.0993788819875776-0.0993788819875776
31800.0993788819875776-0.0993788819875776
31900.0993788819875776-0.0993788819875776
32000.328767123287671-0.328767123287671
32100.328767123287671-0.328767123287671
32200.328767123287671-0.328767123287671
32310.09937888198757760.900621118012422
32400.328767123287671-0.328767123287671
32500.328767123287671-0.328767123287671
32610.09937888198757760.900621118012422
32710.3287671232876710.671232876712329
32800.328767123287671-0.328767123287671
32900.328767123287671-0.328767123287671
33000.328767123287671-0.328767123287671
33100.0993788819875776-0.0993788819875776
33200.328767123287671-0.328767123287671
33300.328767123287671-0.328767123287671
33400.0993788819875776-0.0993788819875776
33500.0993788819875776-0.0993788819875776
33600.328767123287671-0.328767123287671
33700.0993788819875776-0.0993788819875776
33800.0993788819875776-0.0993788819875776
33900.328767123287671-0.328767123287671
34000.0993788819875776-0.0993788819875776
34100.0993788819875776-0.0993788819875776
34200.0993788819875776-0.0993788819875776
34300.328767123287671-0.328767123287671
34400.0993788819875776-0.0993788819875776
34500.0993788819875776-0.0993788819875776
34600.0993788819875776-0.0993788819875776
34700.0993788819875776-0.0993788819875776
34800.328767123287671-0.328767123287671
34900.0993788819875776-0.0993788819875776
35000.328767123287671-0.328767123287671
35100.0993788819875776-0.0993788819875776
35200.328767123287671-0.328767123287671
35300.0993788819875776-0.0993788819875776
35400.0993788819875776-0.0993788819875776
35500.0993788819875776-0.0993788819875776
35600.0993788819875776-0.0993788819875776
35700.0993788819875776-0.0993788819875776
35800.0993788819875776-0.0993788819875776
35900.328767123287671-0.328767123287671
36000.0993788819875776-0.0993788819875776
36100.328767123287671-0.328767123287671
36200.0993788819875776-0.0993788819875776
36310.3287671232876710.671232876712329
36400.328767123287671-0.328767123287671
36500.328767123287671-0.328767123287671
36600.328767123287671-0.328767123287671
36700.0993788819875776-0.0993788819875776
36800.328767123287671-0.328767123287671
36900.0993788819875776-0.0993788819875776
37000.328767123287671-0.328767123287671
37100.328767123287671-0.328767123287671
37200.0993788819875776-0.0993788819875776
37300.328767123287671-0.328767123287671
37400.328767123287671-0.328767123287671
37500.328767123287671-0.328767123287671
37600.328767123287671-0.328767123287671
37700.0993788819875776-0.0993788819875776
37800.0993788819875776-0.0993788819875776
37900.328767123287671-0.328767123287671
38000.328767123287671-0.328767123287671
38100.0993788819875776-0.0993788819875776
38200.0993788819875776-0.0993788819875776
38300.328767123287671-0.328767123287671
38400.0993788819875776-0.0993788819875776
38500.328767123287671-0.328767123287671
38600.0993788819875776-0.0993788819875776
38700.328767123287671-0.328767123287671
38800.0993788819875776-0.0993788819875776
38900.328767123287671-0.328767123287671
39000.328767123287671-0.328767123287671
39100.0993788819875776-0.0993788819875776
39200.328767123287671-0.328767123287671
39300.0993788819875776-0.0993788819875776
39410.4761904761904760.523809523809524
39500.328767123287671-0.328767123287671
39600.328767123287671-0.328767123287671
39710.3287671232876710.671232876712329
39800.328767123287671-0.328767123287671
39910.3287671232876710.671232876712329
40000.0993788819875776-0.0993788819875776
40100.0993788819875776-0.0993788819875776
40200.0993788819875776-0.0993788819875776
40310.09937888198757760.900621118012422
40400.0993788819875776-0.0993788819875776
40500.0993788819875776-0.0993788819875776
40600.328767123287671-0.328767123287671
40700.328767123287671-0.328767123287671
40800.0993788819875776-0.0993788819875776
40900.328767123287671-0.328767123287671
41000.328767123287671-0.328767123287671
41110.3287671232876710.671232876712329
41210.3287671232876710.671232876712329
41310.3287671232876710.671232876712329
41400.328767123287671-0.328767123287671
41500.0993788819875776-0.0993788819875776
41600.328767123287671-0.328767123287671
41710.09937888198757760.900621118012422
41800.0993788819875776-0.0993788819875776
41900.0993788819875776-0.0993788819875776
42000.0993788819875776-0.0993788819875776
42100.328767123287671-0.328767123287671
42210.3287671232876710.671232876712329
42300.328767123287671-0.328767123287671
42400.328767123287671-0.328767123287671
42510.3287671232876710.671232876712329
42600.328767123287671-0.328767123287671
42700.328767123287671-0.328767123287671
42800.328767123287671-0.328767123287671
42900.328767123287671-0.328767123287671
43000.328767123287671-0.328767123287671
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934444tazj7a3mvaqhjp1/29p601292934533.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934444tazj7a3mvaqhjp1/29p601292934533.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934444tazj7a3mvaqhjp1/39p601292934533.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292934444tazj7a3mvaqhjp1/39p601292934533.ps (open in new window)


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


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