Home » date » 2010 » Dec » 21 »

Costs 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 13:19:54 +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/t1292937498h1ijzznn5wu3ab4.htm/, Retrieved Tue, 21 Dec 2010 14:18:22 +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/t1292937498h1ijzznn5wu3ab4.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 «
6282154 162556 807 213118 1 1 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 64027 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 time33 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.8072
R-squared0.6516
RMSE6968.151


Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
116255664785.285714285797770.7142857143
22979064785.2857142857-34995.2857142857
38755064785.285714285722764.7142857143
48473864785.285714285719952.7142857143
55466064785.2857142857-10125.2857142857
6426342782614808
7409492782613123
8451872782617361
937704278269878
10162757940.38297872348334.6170212766
11258307940.382978723417889.6170212766
12126797940.38297872344738.61702127660
131801464785.2857142857-46771.2857142857
14435562782615730
152481127826-3015
1665757940.3829787234-1365.38297872340
1771237940.3829787234-817.382978723404
182195027826-5876
1937597278269771
201782127826-10005
21129887940.38297872345047.61702127660
22223307940.382978723414389.6170212766
23133267940.38297872345385.61702127660
241618964785.2857142857-48596.2857142857
2571467940.3829787234-794.382978723404
26158247940.38297872347883.6170212766
272766427826-162
28119207940.38297872343979.61702127660
2985685195.714285714293372.28571428571
30144167940.38297872346475.6170212766
3133691974.711111111111394.28888888889
32118197940.38297872343878.61702127660
3369845195.714285714291788.28571428571
3445195195.71428571429-676.714285714285
3522201950.71428571429269.285714285714
361856227826-9264
37103277940.38297872342386.61702127660
3853367940.3829787234-2604.38297872340
3923657940.3829787234-5575.38297872340
4040697940.3829787234-3871.38297872340
41863627826-19190
42137187940.38297872345777.6170212766
4345257940.3829787234-3415.38297872340
4468697940.3829787234-1071.38297872340
4546282895.428571428571732.57142857143
4636891974.711111111111714.28888888889
4748912895.428571428571995.57142857143
4874897940.3829787234-451.382978723404
4949017940.3829787234-3039.38297872340
5022842895.42857142857-611.428571428572
5131607940.3829787234-4780.3829787234
5241507940.3829787234-3790.38297872340
5372857940.3829787234-655.382978723404
5411347940.3829787234-6806.3829787234
5546587940.3829787234-3282.38297872340
5623847940.3829787234-5556.38297872340
5737481950.714285714291797.28571428571
5853715195.71428571429175.285714285715
5912852895.42857142857-1610.42857142857
6093277940.38297872341386.61702127660
6155655195.71428571429369.285714285715
6215282895.42857142857-1367.42857142857
6331221974.711111111111147.28888888889
6475617940.3829787234-379.382978723404
6526752895.42857142857-220.428571428572
661325327826-14573
67880456424
6820535195.71428571429-3142.71428571429
6914247940.3829787234-6516.3829787234
7040367940.3829787234-3904.38297872340
7130452895.42857142857149.571428571428
7251192895.428571428572223.57142857143
7314312895.42857142857-1464.42857142857
7455445698
7519752895.42857142857-920.428571428572
7617651974.71111111111-209.711111111111
7710121974.71111111111-962.711111111111
78810456354
7912802895.42857142857-1615.42857142857
806661097.82352941176-431.823529411765
8113801974.71111111111-594.711111111111
8246777940.3829787234-3263.38297872340
838762895.42857142857-2019.42857142857
84814456358
8551445658
8656927940.3829787234-2248.38297872340
8736427940.3829787234-4298.38297872340
8854045684
8920992895.42857142857-796.428571428572
905671950.71428571429-1383.71428571429
9120012895.42857142857-894.428571428572
9229492895.4285714285753.5714285714284
9322537940.3829787234-5687.38297872340
9465331974.711111111114558.28888888889
9518892895.42857142857-1006.42857142857
9630551974.711111111111080.28888888889
972721950.71428571429-1678.71428571429
9814141974.71111111111-560.711111111111
9925641950.71428571429613.285714285714
10013831097.82352941176285.176470588235
10112611974.71111111111-713.711111111111
102975456519
10333662895.42857142857470.571428571428
104576456120
10516861974.71111111111-288.711111111111
1067461974.71111111111-1228.71111111111
10731922895.42857142857296.571428571428
10820451950.7142857142994.2857142857142
10957022895.428571428572806.57142857143
11019321974.71111111111-42.7111111111112
1119361974.71111111111-1038.71111111111
11234372895.42857142857541.571428571428
11351312895.428571428572235.57142857143
11423971097.823529411761299.17647058824
11513891097.82352941176291.176470588235
11615032895.42857142857-1392.42857142857
117402456-54
11822391950.71428571429288.285714285714
11922341097.823529411761136.17647058824
1208371974.71111111111-1137.71111111111
121105797940.38297872342638.61702127660
122875456419
12315857940.3829787234-6355.3829787234
12416591974.71111111111-315.711111111111
12526471097.823529411761549.17647058824
12632941974.711111111111319.28888888889
12701.03478260869565-1.03478260869565
12894456-362
1294221974.71111111111-1552.71111111111
13001.03478260869565-1.03478260869565
13134456-422
13215581974.71111111111-416.711111111111
133071.578947368421-71.578947368421
134431974.71111111111-1931.71111111111
135645210.518518518519434.481481481482
136316210.518518518519105.481481481481
137115456-341
138571.578947368421-66.578947368421
139897210.518518518519686.481481481482
14001.03478260869565-1.03478260869565
141389456-67
14201.03478260869565-1.03478260869565
1431002456546
14436210.518518518519-174.518518518519
1454604564
146309456-147
14701.03478260869565-1.03478260869565
1489456-447
14927171.578947368421199.421052631579
150141.0347826086956512.9652173913043
15152045664
15217662895.42857142857-1129.42857142857
1530210.518518518519-210.518518518519
1544584562
1552071.578947368421-51.5789473684211
15601.03478260869565-1.03478260869565
15701.03478260869565-1.03478260869565
1589871.57894736842126.4210526315789
159405210.518518518519194.481481481481
16001.03478260869565-1.03478260869565
16101.03478260869565-1.03478260869565
16201.03478260869565-1.03478260869565
16301.03478260869565-1.03478260869565
16448345627
1654541974.71111111111-1520.71111111111
1664771.578947368421-24.5789473684211
16701.03478260869565-1.03478260869565
168757456301
16946552895.428571428571759.57142857143
17001.03478260869565-1.03478260869565
17101.03478260869565-1.03478260869565
17236210.518518518519-174.518518518519
17301.03478260869565-1.03478260869565
174203456-253
17501.03478260869565-1.03478260869565
176126456-330
1774007940.3829787234-7540.3829787234
178711.0347826086956569.9652173913043
17901.03478260869565-1.03478260869565
18001.03478260869565-1.03478260869565
181972456516
1825311097.82352941176-566.823529411765
18324611974.71111111111486.288888888889
1843781097.82352941176-719.823529411765
18523210.518518518519-187.518518518519
1866381097.82352941176-459.823529411765
18723001974.71111111111325.288888888889
188149456-307
189226210.51851851851915.4814814814815
19001.03478260869565-1.03478260869565
191275456-181
19201.03478260869565-1.03478260869565
193141456-315
19401.03478260869565-1.03478260869565
19528210.518518518519-182.518518518519
19601.03478260869565-1.03478260869565
19749807940.3829787234-2960.38297872340
19801.03478260869565-1.03478260869565
19901.03478260869565-1.03478260869565
2004721097.82352941176-625.823529411765
20101.03478260869565-1.03478260869565
20201.03478260869565-1.03478260869565
20301.03478260869565-1.03478260869565
2042031097.82352941176-894.823529411765
2054961097.82352941176-601.823529411765
20610210.518518518519-200.518518518519
2076371.578947368421-8.57894736842105
20801.03478260869565-1.03478260869565
20911361974.71111111111-838.711111111111
210265210.51851851851954.4814814814815
21101.03478260869565-1.03478260869565
21201.03478260869565-1.03478260869565
213267456-189
21447445618
215534210.518518518519323.481481481482
216071.578947368421-71.578947368421
21715456-441
218397456-59
219071.578947368421-71.578947368421
22018661974.71111111111-108.711111111111
221288210.51851851851977.4814814814815
22201.03478260869565-1.03478260869565
223371.578947368421-68.578947368421
2244681974.71111111111-1506.71111111111
2252071.578947368421-51.5789473684211
2262781974.71111111111-1696.71111111111
22761456-395
22801.03478260869565-1.03478260869565
22919271.578947368421120.421052631579
23001.03478260869565-1.03478260869565
231317456-139
232738456282
23301.03478260869565-1.03478260869565
234368456-88
23501.03478260869565-1.03478260869565
23621.034782608695650.965217391304348
23701.03478260869565-1.03478260869565
23853456-403
23901.03478260869565-1.03478260869565
24001.03478260869565-1.03478260869565
24101.03478260869565-1.03478260869565
24294210.518518518519-116.518518518519
24301.03478260869565-1.03478260869565
24424456-432
2452332984.4285714285711347.57142857143
24601.03478260869565-1.03478260869565
24701.03478260869565-1.03478260869565
248131456-325
24901.03478260869565-1.03478260869565
25001.03478260869565-1.03478260869565
251206456-250
25201.03478260869565-1.03478260869565
25316771.57894736842195.421052631579
2546222895.42857142857-2273.42857142857
25523287940.3829787234-5612.38297872340
25601.03478260869565-1.03478260869565
257365456-91
2583641974.71111111111-1610.71111111111
25901.03478260869565-1.03478260869565
26001.03478260869565-1.03478260869565
26101.03478260869565-1.03478260869565
26201.03478260869565-1.03478260869565
263226456-230
264307456-149
26501.03478260869565-1.03478260869565
26601.03478260869565-1.03478260869565
26701.03478260869565-1.03478260869565
268188456-268
26901.03478260869565-1.03478260869565
2701381974.71111111111-1836.71111111111
27101.03478260869565-1.03478260869565
27201.03478260869565-1.03478260869565
27301.03478260869565-1.03478260869565
274125456-331
27501.03478260869565-1.03478260869565
276282456-174
2773351974.71111111111-1639.71111111111
27801.03478260869565-1.03478260869565
27913241974.71111111111-650.711111111111
280176456-280
28101.03478260869565-1.03478260869565
28201.03478260869565-1.03478260869565
2832491974.71111111111-1725.71111111111
28401.03478260869565-1.03478260869565
285333456-123
28601.03478260869565-1.03478260869565
287601210.518518518519390.481481481482
28830210.518518518519-180.518518518519
28901.03478260869565-1.03478260869565
290249456-207
29101.03478260869565-1.03478260869565
292165456-291
293453456-3
29401.03478260869565-1.03478260869565
29553456-403
2963821097.82352941176-715.823529411765
29701.03478260869565-1.03478260869565
29801.03478260869565-1.03478260869565
29901.03478260869565-1.03478260869565
3000456-456
30130210.518518518519-180.518518518519
30229071.578947368421218.421052631579
303071.578947368421-71.578947368421
30401.03478260869565-1.03478260869565
305366456-90
3062456-454
30701.03478260869565-1.03478260869565
3082091097.82352941176-888.823529411765
309384456-72
31001.03478260869565-1.03478260869565
31101.03478260869565-1.03478260869565
3123652895.42857142857-2530.42857142857
31301.03478260869565-1.03478260869565
314491097.82352941176-1048.82352941176
3153456-453
316133984.428571428571-851.428571428571
317321.0347826086956530.9652173913043
3183681974.71111111111-1606.71111111111
3191210.518518518519-209.518518518519
32001.03478260869565-1.03478260869565
32101.03478260869565-1.03478260869565
32201.03478260869565-1.03478260869565
32301.03478260869565-1.03478260869565
32401.03478260869565-1.03478260869565
32501.03478260869565-1.03478260869565
3262271.578947368421-49.5789473684211
32701.03478260869565-1.03478260869565
32801.03478260869565-1.03478260869565
32901.03478260869565-1.03478260869565
33001.03478260869565-1.03478260869565
33101.03478260869565-1.03478260869565
33201.03478260869565-1.03478260869565
33301.03478260869565-1.03478260869565
33496210.518518518519-114.518518518519
335171.578947368421-70.578947368421
336314210.518518518519103.481481481481
3378441974.71111111111-1130.71111111111
33801.03478260869565-1.03478260869565
3392671.578947368421-45.5789473684211
340125456-331
341304456-152
34201.03478260869565-1.03478260869565
34301.03478260869565-1.03478260869565
34401.03478260869565-1.03478260869565
345621456165
34601.03478260869565-1.03478260869565
347119210.518518518519-91.5185185185185
34801.03478260869565-1.03478260869565
34901.03478260869565-1.03478260869565
35015954561139
351312210.518518518519101.481481481481
35260456-396
353587456131
35413571.57894736842163.421052631579
35501.03478260869565-1.03478260869565
35601.03478260869565-1.03478260869565
35751445658
35801.03478260869565-1.03478260869565
35901.03478260869565-1.03478260869565
36001.03478260869565-1.03478260869565
3611210.518518518519-209.518518518519
36201.03478260869565-1.03478260869565
36301.03478260869565-1.03478260869565
36417631974.71111111111-211.711111111111
365180456-276
36601.03478260869565-1.03478260869565
36701.03478260869565-1.03478260869565
36801.03478260869565-1.03478260869565
36901.03478260869565-1.03478260869565
370218456-238
37101.03478260869565-1.03478260869565
372448456-8
373227456-229
374174210.518518518519-36.5185185185185
37501.03478260869565-1.03478260869565
37601.03478260869565-1.03478260869565
377121456-335
378607456151
37922124561756
38001.03478260869565-1.03478260869565
38101.03478260869565-1.03478260869565
38253045674
383571456115
38401.03478260869565-1.03478260869565
38578456-378
38624891974.71111111111514.288888888889
387131210.518518518519-79.5185185185185
388923456467
38972210.518518518519-138.518518518519
390572456116
391397456-59
392450456-6
393622456166
394694456238
39534251097.823529411762327.17647058824
396562456106
39749171974.711111111112942.28888888889
398144227826-26384
39952945673
40021262895.42857142857-769.428571428572
4011061984.42857142857176.5714285714286
402776456320
403611456155
40415261974.71111111111-448.711111111111
405592456136
4061182456726
407621456165
408989456533
409438456-18
410726984.428571428571-258.428571428571
41113037940.3829787234-6637.3829787234
41274191974.711111111115444.28888888889
41311641097.8235294117666.1764705882354
41433105195.71428571429-1885.71428571429
41519204561464
416965984.428571428571-19.4285714285714
41732561974.711111111111281.28888888889
41811351974.71111111111-839.711111111111
41912701974.71111111111-704.711111111111
420661984.428571428571-323.428571428571
4211013984.42857142857128.5714285714286
42228447940.3829787234-5096.38297872340
423115287940.38297872343587.61702127660
42465261974.711111111114551.28888888889
42522641974.71111111111289.288888888889
42651097940.3829787234-2831.38297872340
42739991974.711111111112024.28888888889
42835624278267798
42992522895.428571428576356.57142857143
430152367940.38297872347295.6170212766
431180737940.382978723410132.6170212766
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292937498h1ijzznn5wu3ab4/2ucfv1292937560.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/21/t1292937498h1ijzznn5wu3ab4/2ucfv1292937560.ps (open in new window)


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


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


 
Parameters (Session):
par1 = 2 ; par2 = none ; par3 = 3 ; par4 = no ;
 
Parameters (R input):
par1 = 2 ; par2 = none ; par3 = 3 ; par4 = no ;
 
R code (references can be found in the software module):
library(party)
library(Hmisc)
par1 <- as.numeric(par1)
par3 <- as.numeric(par3)
x <- data.frame(t(y))
is.data.frame(x)
x <- x[!is.na(x[,par1]),]
k <- length(x[1,])
n <- length(x[,1])
colnames(x)[par1]
x[,par1]
if (par2 == 'kmeans') {
cl <- kmeans(x[,par1], par3)
print(cl)
clm <- matrix(cbind(cl$centers,1:par3),ncol=2)
clm <- clm[sort.list(clm[,1]),]
for (i in 1:par3) {
cl$cluster[cl$cluster==clm[i,2]] <- paste('C',i,sep='')
}
cl$cluster <- as.factor(cl$cluster)
print(cl$cluster)
x[,par1] <- cl$cluster
}
if (par2 == 'quantiles') {
x[,par1] <- cut2(x[,par1],g=par3)
}
if (par2 == 'hclust') {
hc <- hclust(dist(x[,par1])^2, 'cen')
print(hc)
memb <- cutree(hc, k = par3)
dum <- c(mean(x[memb==1,par1]))
for (i in 2:par3) {
dum <- c(dum, mean(x[memb==i,par1]))
}
hcm <- matrix(cbind(dum,1:par3),ncol=2)
hcm <- hcm[sort.list(hcm[,1]),]
for (i in 1:par3) {
memb[memb==hcm[i,2]] <- paste('C',i,sep='')
}
memb <- as.factor(memb)
print(memb)
x[,par1] <- memb
}
if (par2=='equal') {
ed <- cut(as.numeric(x[,par1]),par3,labels=paste('C',1:par3,sep=''))
x[,par1] <- as.factor(ed)
}
table(x[,par1])
colnames(x)
colnames(x)[par1]
x[,par1]
if (par2 == 'none') {
m <- ctree(as.formula(paste(colnames(x)[par1],' ~ .',sep='')),data = x)
}
load(file='createtable')
if (par2 != 'none') {
m <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data = x)
if (par4=='yes') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'10-Fold Cross Validation',3+2*par3,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'',1,TRUE)
a<-table.element(a,'Prediction (training)',par3+1,TRUE)
a<-table.element(a,'Prediction (testing)',par3+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Actual',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE)
a<-table.element(a,'CV',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,paste('C',jjj,sep=''),1,TRUE)
a<-table.element(a,'CV',1,TRUE)
a<-table.row.end(a)
for (i in 1:10) {
ind <- sample(2, nrow(x), replace=T, prob=c(0.9,0.1))
m.ct <- ctree(as.formula(paste('as.factor(',colnames(x)[par1],') ~ .',sep='')),data =x[ind==1,])
if (i==1) {
m.ct.i.pred <- predict(m.ct, newdata=x[ind==1,])
m.ct.i.actu <- x[ind==1,par1]
m.ct.x.pred <- predict(m.ct, newdata=x[ind==2,])
m.ct.x.actu <- x[ind==2,par1]
} else {
m.ct.i.pred <- c(m.ct.i.pred,predict(m.ct, newdata=x[ind==1,]))
m.ct.i.actu <- c(m.ct.i.actu,x[ind==1,par1])
m.ct.x.pred <- c(m.ct.x.pred,predict(m.ct, newdata=x[ind==2,]))
m.ct.x.actu <- c(m.ct.x.actu,x[ind==2,par1])
}
}
print(m.ct.i.tab <- table(m.ct.i.actu,m.ct.i.pred))
numer <- 0
for (i in 1:par3) {
print(m.ct.i.tab[i,i] / sum(m.ct.i.tab[i,]))
numer <- numer + m.ct.i.tab[i,i]
}
print(m.ct.i.cp <- numer / sum(m.ct.i.tab))
print(m.ct.x.tab <- table(m.ct.x.actu,m.ct.x.pred))
numer <- 0
for (i in 1:par3) {
print(m.ct.x.tab[i,i] / sum(m.ct.x.tab[i,]))
numer <- numer + m.ct.x.tab[i,i]
}
print(m.ct.x.cp <- numer / sum(m.ct.x.tab))
for (i in 1:par3) {
a<-table.row.start(a)
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
for (jjj in 1:par3) a<-table.element(a,m.ct.i.tab[i,jjj])
a<-table.element(a,round(m.ct.i.tab[i,i]/sum(m.ct.i.tab[i,]),4))
for (jjj in 1:par3) a<-table.element(a,m.ct.x.tab[i,jjj])
a<-table.element(a,round(m.ct.x.tab[i,i]/sum(m.ct.x.tab[i,]),4))
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a,'Overall',1,TRUE)
for (jjj in 1:par3) a<-table.element(a,'-')
a<-table.element(a,round(m.ct.i.cp,4))
for (jjj in 1:par3) a<-table.element(a,'-')
a<-table.element(a,round(m.ct.x.cp,4))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
}
}
m
bitmap(file='test1.png')
plot(m)
dev.off()
bitmap(file='test1a.png')
plot(x[,par1] ~ as.factor(where(m)),main='Response by Terminal Node',xlab='Terminal Node',ylab='Response')
dev.off()
if (par2 == 'none') {
forec <- predict(m)
result <- as.data.frame(cbind(x[,par1],forec,x[,par1]-forec))
colnames(result) <- c('Actuals','Forecasts','Residuals')
print(result)
}
if (par2 != 'none') {
print(cbind(as.factor(x[,par1]),predict(m)))
myt <- table(as.factor(x[,par1]),predict(m))
print(myt)
}
bitmap(file='test2.png')
if(par2=='none') {
op <- par(mfrow=c(2,2))
plot(density(result$Actuals),main='Kernel Density Plot of Actuals')
plot(density(result$Residuals),main='Kernel Density Plot of Residuals')
plot(result$Forecasts,result$Actuals,main='Actuals versus Predictions',xlab='Predictions',ylab='Actuals')
plot(density(result$Forecasts),main='Kernel Density Plot of Predictions')
par(op)
}
if(par2!='none') {
plot(myt,main='Confusion Matrix',xlab='Actual',ylab='Predicted')
}
dev.off()
if (par2 == 'none') {
detcoef <- cor(result$Forecasts,result$Actuals)
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goodness of Fit',2,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Correlation',1,TRUE)
a<-table.element(a,round(detcoef,4))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'R-squared',1,TRUE)
a<-table.element(a,round(detcoef*detcoef,4))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'RMSE',1,TRUE)
a<-table.element(a,round(sqrt(mean((result$Residuals)^2)),4))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Actuals, Predictions, and Residuals',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'#',header=TRUE)
a<-table.element(a,'Actuals',header=TRUE)
a<-table.element(a,'Forecasts',header=TRUE)
a<-table.element(a,'Residuals',header=TRUE)
a<-table.row.end(a)
for (i in 1:length(result$Actuals)) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,result$Actuals[i])
a<-table.element(a,result$Forecasts[i])
a<-table.element(a,result$Residuals[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
}
if (par2 != 'none') {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Confusion Matrix (predicted in columns / actuals in rows)',par3+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'',1,TRUE)
for (i in 1:par3) {
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
}
a<-table.row.end(a)
for (i in 1:par3) {
a<-table.row.start(a)
a<-table.element(a,paste('C',i,sep=''),1,TRUE)
for (j in 1:par3) {
a<-table.element(a,myt[i,j])
}
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by