Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_regression_trees1.wasp
Title produced by softwareRecursive Partitioning (Regression Trees)
Date of computationTue, 20 Dec 2011 21:11:36 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/20/t1324433658x2w0jnmxw6fgog7.htm/, Retrieved Mon, 06 May 2024 08:32:44 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158346, Retrieved Mon, 06 May 2024 08:32:44 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact98
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Recursive Partitioning (Regression Trees)] [paper] [2011-12-21 02:11:36] [6e647d331a8f33aa61a2d78ef323178e] [Current]
Feedback Forum

Post a new message
Dataseries X:
2	210907	56	396	79	30	1	0
0	149061	44	656	43	26	1	0
0	237213	84	655	78	38	1	1
4	133131	55	525	44	30	1	1
0	324799	154	1436	158	47	1	1
0	230964	53	612	102	30	1	0
0	236785	119	865	77	31	1	1
1	344297	75	963	80	30	1	1
0	174724	92	966	123	34	1	1
3	174415	100	801	73	31	1	1
0	223632	73	513	105	33	1	1
4	294424	77	992	107	33	1	0
1	106408	30	260	33	14	1	0
0	96560	76	503	42	17	0	0
0	265769	146	927	96	32	1	1
0	149112	56	537	56	35	1	0
2	152871	58	532	59	28	1	0
2	362301	119	1635	76	34	1	1
0	183167	66	557	91	39	1	0
2	218946	41	866	76	29	1	1
2	244052	68	574	101	44	1	1
0	341570	168	1276	94	21	0	1
0	196553	57	503	41	29	1	1
2	143246	103	464	67	27	1	0
0	167488	45	619	69	28	1	0
4	143756	46	479	105	34	1	0
2	152299	53	537	62	33	1	1
2	193339	78	465	100	35	1	1
0	130585	46	299	67	29	1	0
3	112611	41	248	46	20	0	1
3	148446	91	905	135	37	1	1
2	182079	63	512	124	33	1	0
0	243060	63	786	58	29	1	1
0	162765	32	489	68	28	1	1
0	85574	34	351	37	21	0	1
1	225060	93	669	93	41	1	0
0	133328	55	506	56	20	0	1
3	100750	72	407	83	30	1	1
0	101523	42	316	59	22	0	1
0	243511	71	603	133	42	1	1
0	152474	65	577	106	32	1	1
3	132487	41	411	71	36	1	1
0	317394	86	975	116	31	1	0
0	244749	95	964	98	33	1	1
2	128423	64	369	32	38	1	0
0	97839	38	417	25	24	1	0
2	229242	247	719	63	31	1	1
2	324598	110	1402	113	37	1	0
0	195838	67	564	111	31	1	0
0	254488	83	747	120	39	1	0
0	92499	32	319	25	18	0	1
0	224330	83	612	131	39	1	0
6	181633	70	564	47	30	1	1
0	271856	103	824	109	37	1	1
3	95227	34	239	37	32	1	1
0	98146	40	459	15	17	0	0
0	118612	46	454	54	12	0	0
1	65475	18	225	16	13	0	1
0	108446	60	389	22	17	0	0
2	121848	39	339	37	17	0	0
2	76302	31	333	29	20	0	1
0	98104	54	636	55	17	0	0
0	30989	14	93	5	17	0	1
1	31774	23	170	0	17	0	0
0	150580	77	530	27	22	0	1
1	59382	49	227	29	12	0	0
0	84105	20	261	17	17	0	0




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158346&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158346&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158346&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







Goodness of Fit
Correlation0.8666
R-squared0.7511
RMSE39260.7926

\begin{tabular}{lllllllll}
\hline
Goodness of Fit \tabularnewline
Correlation & 0.8666 \tabularnewline
R-squared & 0.7511 \tabularnewline
RMSE & 39260.7926 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158346&T=1

[TABLE]
[ROW][C]Goodness of Fit[/C][/ROW]
[ROW][C]Correlation[/C][C]0.8666[/C][/ROW]
[ROW][C]R-squared[/C][C]0.7511[/C][/ROW]
[ROW][C]RMSE[/C][C]39260.7926[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158346&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158346&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Goodness of Fit
Correlation0.8666
R-squared0.7511
RMSE39260.7926







Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
1210907148507.362399.7
2149061189834.166666667-40773.1666666667
3237213225791.44444444411421.5555555556
4133131148507.3-15376.3
5324799299462.525336.5
6230964189834.16666666741129.8333333333
7236785189834.16666666746950.8333333333
8344297299462.544834.5
9174724299462.5-124738.5
10174415189834.166666667-15419.1666666667
11223632148507.375124.7
12294424299462.5-5038.5
1310640889563.562516844.4375
1496560148507.3-51947.3
15265769299462.5-33693.5
16149112148507.3604.700000000012
17152871148507.34363.70000000001
18362301299462.562838.5
19183167225791.444444444-42624.4444444444
20218946189834.16666666729111.8333333333
21244052225791.44444444418260.5555555556
22341570299462.542107.5
23196553148507.348045.7
24143246148507.3-5261.29999999999
25167488189834.166666667-22346.1666666667
26143756148507.3-4751.29999999999
27152299148507.33791.70000000001
28193339148507.344831.7
29130585148507.3-17922.3
30112611148507.3-35896.3
31148446225791.444444444-77345.4444444444
32182079148507.333571.7
33243060189834.16666666753225.8333333333
34162765148507.314257.7
358557489563.5625-3989.5625
36225060225791.444444444-731.444444444438
37133328148507.3-15179.3
38100750148507.3-47757.3
39101523148507.3-46984.3
40243511225791.44444444417719.5555555556
41152474189834.166666667-37360.1666666667
42132487148507.3-16020.3
43317394299462.517931.5
44244749299462.5-54713.5
4512842389563.562538859.4375
469783989563.56258275.4375
47229242189834.16666666739407.8333333333
48324598299462.525135.5
49195838189834.1666666676003.83333333334
50254488225791.44444444428696.5555555556
519249989563.56252935.4375
52224330225791.444444444-1461.44444444444
53181633189834.166666667-8201.16666666666
54271856225791.44444444446064.5555555556
559522789563.56255663.4375
569814689563.56258582.4375
57118612148507.3-29895.3
586547589563.5625-24088.5625
5910844689563.562518882.4375
6012184889563.562532284.4375
617630289563.5625-13261.5625
6298104189834.166666667-91730.1666666667
633098989563.5625-58574.5625
643177489563.5625-57789.5625
6515058089563.562561016.4375
665938289563.5625-30181.5625
678410589563.5625-5458.5625

\begin{tabular}{lllllllll}
\hline
Actuals, Predictions, and Residuals \tabularnewline
# & Actuals & Forecasts & Residuals \tabularnewline
1 & 210907 & 148507.3 & 62399.7 \tabularnewline
2 & 149061 & 189834.166666667 & -40773.1666666667 \tabularnewline
3 & 237213 & 225791.444444444 & 11421.5555555556 \tabularnewline
4 & 133131 & 148507.3 & -15376.3 \tabularnewline
5 & 324799 & 299462.5 & 25336.5 \tabularnewline
6 & 230964 & 189834.166666667 & 41129.8333333333 \tabularnewline
7 & 236785 & 189834.166666667 & 46950.8333333333 \tabularnewline
8 & 344297 & 299462.5 & 44834.5 \tabularnewline
9 & 174724 & 299462.5 & -124738.5 \tabularnewline
10 & 174415 & 189834.166666667 & -15419.1666666667 \tabularnewline
11 & 223632 & 148507.3 & 75124.7 \tabularnewline
12 & 294424 & 299462.5 & -5038.5 \tabularnewline
13 & 106408 & 89563.5625 & 16844.4375 \tabularnewline
14 & 96560 & 148507.3 & -51947.3 \tabularnewline
15 & 265769 & 299462.5 & -33693.5 \tabularnewline
16 & 149112 & 148507.3 & 604.700000000012 \tabularnewline
17 & 152871 & 148507.3 & 4363.70000000001 \tabularnewline
18 & 362301 & 299462.5 & 62838.5 \tabularnewline
19 & 183167 & 225791.444444444 & -42624.4444444444 \tabularnewline
20 & 218946 & 189834.166666667 & 29111.8333333333 \tabularnewline
21 & 244052 & 225791.444444444 & 18260.5555555556 \tabularnewline
22 & 341570 & 299462.5 & 42107.5 \tabularnewline
23 & 196553 & 148507.3 & 48045.7 \tabularnewline
24 & 143246 & 148507.3 & -5261.29999999999 \tabularnewline
25 & 167488 & 189834.166666667 & -22346.1666666667 \tabularnewline
26 & 143756 & 148507.3 & -4751.29999999999 \tabularnewline
27 & 152299 & 148507.3 & 3791.70000000001 \tabularnewline
28 & 193339 & 148507.3 & 44831.7 \tabularnewline
29 & 130585 & 148507.3 & -17922.3 \tabularnewline
30 & 112611 & 148507.3 & -35896.3 \tabularnewline
31 & 148446 & 225791.444444444 & -77345.4444444444 \tabularnewline
32 & 182079 & 148507.3 & 33571.7 \tabularnewline
33 & 243060 & 189834.166666667 & 53225.8333333333 \tabularnewline
34 & 162765 & 148507.3 & 14257.7 \tabularnewline
35 & 85574 & 89563.5625 & -3989.5625 \tabularnewline
36 & 225060 & 225791.444444444 & -731.444444444438 \tabularnewline
37 & 133328 & 148507.3 & -15179.3 \tabularnewline
38 & 100750 & 148507.3 & -47757.3 \tabularnewline
39 & 101523 & 148507.3 & -46984.3 \tabularnewline
40 & 243511 & 225791.444444444 & 17719.5555555556 \tabularnewline
41 & 152474 & 189834.166666667 & -37360.1666666667 \tabularnewline
42 & 132487 & 148507.3 & -16020.3 \tabularnewline
43 & 317394 & 299462.5 & 17931.5 \tabularnewline
44 & 244749 & 299462.5 & -54713.5 \tabularnewline
45 & 128423 & 89563.5625 & 38859.4375 \tabularnewline
46 & 97839 & 89563.5625 & 8275.4375 \tabularnewline
47 & 229242 & 189834.166666667 & 39407.8333333333 \tabularnewline
48 & 324598 & 299462.5 & 25135.5 \tabularnewline
49 & 195838 & 189834.166666667 & 6003.83333333334 \tabularnewline
50 & 254488 & 225791.444444444 & 28696.5555555556 \tabularnewline
51 & 92499 & 89563.5625 & 2935.4375 \tabularnewline
52 & 224330 & 225791.444444444 & -1461.44444444444 \tabularnewline
53 & 181633 & 189834.166666667 & -8201.16666666666 \tabularnewline
54 & 271856 & 225791.444444444 & 46064.5555555556 \tabularnewline
55 & 95227 & 89563.5625 & 5663.4375 \tabularnewline
56 & 98146 & 89563.5625 & 8582.4375 \tabularnewline
57 & 118612 & 148507.3 & -29895.3 \tabularnewline
58 & 65475 & 89563.5625 & -24088.5625 \tabularnewline
59 & 108446 & 89563.5625 & 18882.4375 \tabularnewline
60 & 121848 & 89563.5625 & 32284.4375 \tabularnewline
61 & 76302 & 89563.5625 & -13261.5625 \tabularnewline
62 & 98104 & 189834.166666667 & -91730.1666666667 \tabularnewline
63 & 30989 & 89563.5625 & -58574.5625 \tabularnewline
64 & 31774 & 89563.5625 & -57789.5625 \tabularnewline
65 & 150580 & 89563.5625 & 61016.4375 \tabularnewline
66 & 59382 & 89563.5625 & -30181.5625 \tabularnewline
67 & 84105 & 89563.5625 & -5458.5625 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158346&T=2

[TABLE]
[ROW][C]Actuals, Predictions, and Residuals[/C][/ROW]
[ROW][C]#[/C][C]Actuals[/C][C]Forecasts[/C][C]Residuals[/C][/ROW]
[ROW][C]1[/C][C]210907[/C][C]148507.3[/C][C]62399.7[/C][/ROW]
[ROW][C]2[/C][C]149061[/C][C]189834.166666667[/C][C]-40773.1666666667[/C][/ROW]
[ROW][C]3[/C][C]237213[/C][C]225791.444444444[/C][C]11421.5555555556[/C][/ROW]
[ROW][C]4[/C][C]133131[/C][C]148507.3[/C][C]-15376.3[/C][/ROW]
[ROW][C]5[/C][C]324799[/C][C]299462.5[/C][C]25336.5[/C][/ROW]
[ROW][C]6[/C][C]230964[/C][C]189834.166666667[/C][C]41129.8333333333[/C][/ROW]
[ROW][C]7[/C][C]236785[/C][C]189834.166666667[/C][C]46950.8333333333[/C][/ROW]
[ROW][C]8[/C][C]344297[/C][C]299462.5[/C][C]44834.5[/C][/ROW]
[ROW][C]9[/C][C]174724[/C][C]299462.5[/C][C]-124738.5[/C][/ROW]
[ROW][C]10[/C][C]174415[/C][C]189834.166666667[/C][C]-15419.1666666667[/C][/ROW]
[ROW][C]11[/C][C]223632[/C][C]148507.3[/C][C]75124.7[/C][/ROW]
[ROW][C]12[/C][C]294424[/C][C]299462.5[/C][C]-5038.5[/C][/ROW]
[ROW][C]13[/C][C]106408[/C][C]89563.5625[/C][C]16844.4375[/C][/ROW]
[ROW][C]14[/C][C]96560[/C][C]148507.3[/C][C]-51947.3[/C][/ROW]
[ROW][C]15[/C][C]265769[/C][C]299462.5[/C][C]-33693.5[/C][/ROW]
[ROW][C]16[/C][C]149112[/C][C]148507.3[/C][C]604.700000000012[/C][/ROW]
[ROW][C]17[/C][C]152871[/C][C]148507.3[/C][C]4363.70000000001[/C][/ROW]
[ROW][C]18[/C][C]362301[/C][C]299462.5[/C][C]62838.5[/C][/ROW]
[ROW][C]19[/C][C]183167[/C][C]225791.444444444[/C][C]-42624.4444444444[/C][/ROW]
[ROW][C]20[/C][C]218946[/C][C]189834.166666667[/C][C]29111.8333333333[/C][/ROW]
[ROW][C]21[/C][C]244052[/C][C]225791.444444444[/C][C]18260.5555555556[/C][/ROW]
[ROW][C]22[/C][C]341570[/C][C]299462.5[/C][C]42107.5[/C][/ROW]
[ROW][C]23[/C][C]196553[/C][C]148507.3[/C][C]48045.7[/C][/ROW]
[ROW][C]24[/C][C]143246[/C][C]148507.3[/C][C]-5261.29999999999[/C][/ROW]
[ROW][C]25[/C][C]167488[/C][C]189834.166666667[/C][C]-22346.1666666667[/C][/ROW]
[ROW][C]26[/C][C]143756[/C][C]148507.3[/C][C]-4751.29999999999[/C][/ROW]
[ROW][C]27[/C][C]152299[/C][C]148507.3[/C][C]3791.70000000001[/C][/ROW]
[ROW][C]28[/C][C]193339[/C][C]148507.3[/C][C]44831.7[/C][/ROW]
[ROW][C]29[/C][C]130585[/C][C]148507.3[/C][C]-17922.3[/C][/ROW]
[ROW][C]30[/C][C]112611[/C][C]148507.3[/C][C]-35896.3[/C][/ROW]
[ROW][C]31[/C][C]148446[/C][C]225791.444444444[/C][C]-77345.4444444444[/C][/ROW]
[ROW][C]32[/C][C]182079[/C][C]148507.3[/C][C]33571.7[/C][/ROW]
[ROW][C]33[/C][C]243060[/C][C]189834.166666667[/C][C]53225.8333333333[/C][/ROW]
[ROW][C]34[/C][C]162765[/C][C]148507.3[/C][C]14257.7[/C][/ROW]
[ROW][C]35[/C][C]85574[/C][C]89563.5625[/C][C]-3989.5625[/C][/ROW]
[ROW][C]36[/C][C]225060[/C][C]225791.444444444[/C][C]-731.444444444438[/C][/ROW]
[ROW][C]37[/C][C]133328[/C][C]148507.3[/C][C]-15179.3[/C][/ROW]
[ROW][C]38[/C][C]100750[/C][C]148507.3[/C][C]-47757.3[/C][/ROW]
[ROW][C]39[/C][C]101523[/C][C]148507.3[/C][C]-46984.3[/C][/ROW]
[ROW][C]40[/C][C]243511[/C][C]225791.444444444[/C][C]17719.5555555556[/C][/ROW]
[ROW][C]41[/C][C]152474[/C][C]189834.166666667[/C][C]-37360.1666666667[/C][/ROW]
[ROW][C]42[/C][C]132487[/C][C]148507.3[/C][C]-16020.3[/C][/ROW]
[ROW][C]43[/C][C]317394[/C][C]299462.5[/C][C]17931.5[/C][/ROW]
[ROW][C]44[/C][C]244749[/C][C]299462.5[/C][C]-54713.5[/C][/ROW]
[ROW][C]45[/C][C]128423[/C][C]89563.5625[/C][C]38859.4375[/C][/ROW]
[ROW][C]46[/C][C]97839[/C][C]89563.5625[/C][C]8275.4375[/C][/ROW]
[ROW][C]47[/C][C]229242[/C][C]189834.166666667[/C][C]39407.8333333333[/C][/ROW]
[ROW][C]48[/C][C]324598[/C][C]299462.5[/C][C]25135.5[/C][/ROW]
[ROW][C]49[/C][C]195838[/C][C]189834.166666667[/C][C]6003.83333333334[/C][/ROW]
[ROW][C]50[/C][C]254488[/C][C]225791.444444444[/C][C]28696.5555555556[/C][/ROW]
[ROW][C]51[/C][C]92499[/C][C]89563.5625[/C][C]2935.4375[/C][/ROW]
[ROW][C]52[/C][C]224330[/C][C]225791.444444444[/C][C]-1461.44444444444[/C][/ROW]
[ROW][C]53[/C][C]181633[/C][C]189834.166666667[/C][C]-8201.16666666666[/C][/ROW]
[ROW][C]54[/C][C]271856[/C][C]225791.444444444[/C][C]46064.5555555556[/C][/ROW]
[ROW][C]55[/C][C]95227[/C][C]89563.5625[/C][C]5663.4375[/C][/ROW]
[ROW][C]56[/C][C]98146[/C][C]89563.5625[/C][C]8582.4375[/C][/ROW]
[ROW][C]57[/C][C]118612[/C][C]148507.3[/C][C]-29895.3[/C][/ROW]
[ROW][C]58[/C][C]65475[/C][C]89563.5625[/C][C]-24088.5625[/C][/ROW]
[ROW][C]59[/C][C]108446[/C][C]89563.5625[/C][C]18882.4375[/C][/ROW]
[ROW][C]60[/C][C]121848[/C][C]89563.5625[/C][C]32284.4375[/C][/ROW]
[ROW][C]61[/C][C]76302[/C][C]89563.5625[/C][C]-13261.5625[/C][/ROW]
[ROW][C]62[/C][C]98104[/C][C]189834.166666667[/C][C]-91730.1666666667[/C][/ROW]
[ROW][C]63[/C][C]30989[/C][C]89563.5625[/C][C]-58574.5625[/C][/ROW]
[ROW][C]64[/C][C]31774[/C][C]89563.5625[/C][C]-57789.5625[/C][/ROW]
[ROW][C]65[/C][C]150580[/C][C]89563.5625[/C][C]61016.4375[/C][/ROW]
[ROW][C]66[/C][C]59382[/C][C]89563.5625[/C][C]-30181.5625[/C][/ROW]
[ROW][C]67[/C][C]84105[/C][C]89563.5625[/C][C]-5458.5625[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158346&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158346&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
1210907148507.362399.7
2149061189834.166666667-40773.1666666667
3237213225791.44444444411421.5555555556
4133131148507.3-15376.3
5324799299462.525336.5
6230964189834.16666666741129.8333333333
7236785189834.16666666746950.8333333333
8344297299462.544834.5
9174724299462.5-124738.5
10174415189834.166666667-15419.1666666667
11223632148507.375124.7
12294424299462.5-5038.5
1310640889563.562516844.4375
1496560148507.3-51947.3
15265769299462.5-33693.5
16149112148507.3604.700000000012
17152871148507.34363.70000000001
18362301299462.562838.5
19183167225791.444444444-42624.4444444444
20218946189834.16666666729111.8333333333
21244052225791.44444444418260.5555555556
22341570299462.542107.5
23196553148507.348045.7
24143246148507.3-5261.29999999999
25167488189834.166666667-22346.1666666667
26143756148507.3-4751.29999999999
27152299148507.33791.70000000001
28193339148507.344831.7
29130585148507.3-17922.3
30112611148507.3-35896.3
31148446225791.444444444-77345.4444444444
32182079148507.333571.7
33243060189834.16666666753225.8333333333
34162765148507.314257.7
358557489563.5625-3989.5625
36225060225791.444444444-731.444444444438
37133328148507.3-15179.3
38100750148507.3-47757.3
39101523148507.3-46984.3
40243511225791.44444444417719.5555555556
41152474189834.166666667-37360.1666666667
42132487148507.3-16020.3
43317394299462.517931.5
44244749299462.5-54713.5
4512842389563.562538859.4375
469783989563.56258275.4375
47229242189834.16666666739407.8333333333
48324598299462.525135.5
49195838189834.1666666676003.83333333334
50254488225791.44444444428696.5555555556
519249989563.56252935.4375
52224330225791.444444444-1461.44444444444
53181633189834.166666667-8201.16666666666
54271856225791.44444444446064.5555555556
559522789563.56255663.4375
569814689563.56258582.4375
57118612148507.3-29895.3
586547589563.5625-24088.5625
5910844689563.562518882.4375
6012184889563.562532284.4375
617630289563.5625-13261.5625
6298104189834.166666667-91730.1666666667
633098989563.5625-58574.5625
643177489563.5625-57789.5625
6515058089563.562561016.4375
665938289563.5625-30181.5625
678410589563.5625-5458.5625



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')
}