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 computationSat, 17 Dec 2011 05:08:46 -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/17/t1324116561bv31mnupd50md2t.htm/, Retrieved Wed, 24 Apr 2024 10:17:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=156168, Retrieved Wed, 24 Apr 2024 10:17:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Recursive Partitioning (Regression Trees)] [] [2010-12-05 18:59:57] [b98453cac15ba1066b407e146608df68]
-   PD  [Recursive Partitioning (Regression Trees)] [Recursice Partiti...] [2010-12-11 19:00:32] [049b50ae610f671f7417ed8e2d1295c1]
- R PD    [Recursive Partitioning (Regression Trees)] [] [2011-12-17 09:55:23] [c53df38315e3cbde2dbe0de809195ef2]
-   P         [Recursive Partitioning (Regression Trees)] [] [2011-12-17 10:08:46] [ff205c8f94ca61ac7cf7eb30cad83105] [Current]
Feedback Forum

Post a new message
Dataseries X:
144244	1685	152043	53	670	47	3	44	29	107	84	17416	88229	111	107
197426	1109	121726	66	356	44	0	28	30	112	83	24797	178377	60	59
86652	1829	204039	75	615	83	6	44	49	182	146	10971	114198	165	159
65594	1808	185890	62	590	86	9	48	31	114	90	8589	92795	96	94
101382	2137	252805	52	866	67	5	81	30	111	77	13326	127097	102	97
76173	631	70849	28	179	46	3	8	35	129	89	10024	47552	49	47
124089	3873	366774	116	1548	117	9	95	39	145	120	16378	130332	125	123
66089	1121	102424	42	401	55	0	42	36	131	100	8728	61394	50	49
22618	893	73566	32	385	39	6	22	23	88	67	3007	23824	26	25
149695	2531	372238	308	833	81	8	85	44	163	157	20867	191179	165	158
56622	870	80953	25	437	31	0	49	8	28	27	7905	55792	59	58
150047	1915	168994	57	720	122	5	147	50	192	179	21166	75767	132	123
151911	3942	334657	116	1342	116	10	142	47	181	165	22938	191889	174	172
25162	530	61857	25	192	25	4	23	11	32	30	3913	24610	31	28
105079	1844	222373	69	673	59	16	70	42	162	106	16346	99776	121	121
69446	1937	220700	82	621	46	10	71	43	162	87	11034	113713	100	100
136588	2320	263411	85	683	62	8	135	49	191	185	21983	134163	200	186
128692	1807	217478	112	610	69	0	38	32	125	45	20954	100187	141	126
134047	2387	316105	97	820	120	0	154	48	187	145	21849	231257	172	165
31701	1161	101097	64	454	70	3	30	14	52	41	5296	45824	35	35
43750	602	43287	14	214	43	4	13	19	71	64	7409	19630	49	49
143592	1854	187965	126	562	54	6	79	35	137	128	24634	113963	158	156
100350	1757	199726	65	580	47	2	48	32	117	66	17372	75882	80	72
151715	3937	370483	139	1298	65	10	154	46	178	161	26719	197765	171	171
113344	2733	327474	64	1026	140	0	125	41	158	135	20190	230054	144	137
279488	3328	396725	123	1151	111	3	137	50	186	175	49809	258287	254	246
125081	2956	322896	157	1157	90	4	98	39	144	92	22355	135213	114	113
68788	1659	164107	67	633	60	8	50	37	122	113	12347	72591	70	70
103037	2768	425544	102	1203	101	1	86	39	144	144	18507	150773	140	137
102153	1907	198094	40	659	113	2	66	43	163	151	18700	80716	70	69
147172	1860	306952	67	606	58	4	76	40	149	143	27259	178303	112	108
146760	4023	401260	164	1429	155	4	103	46	172	163	27195	195791	187	182
127654	2135	254506	74	655	71	3	160	38	141	131	23841	105590	205	192
110459	1209	179444	64	429	63	4	71	34	133	127	20654	113854	135	132
131072	2277	232765	78	834	78	2	135	36	135	116	25270	114268	200	199
126817	1675	175699	68	621	62	5	143	28	102	89	24634	94333	104	98
108535	3687	361186	189	1456	278	1	69	37	143	137	21261	118845	88	83
82317	1441	179306	40	461	62	5	66	25	89	84	16278	111848	74	71
57224	1997	186856	177	640	116	0	73	36	138	59	11338	80684	73	70
135356	2089	240153	65	696	79	7	76	48	183	163	27111	91502	121	118
96125	2228	208051	76	648	80	0	101	52	201	180	19499	106314	155	155
1168	398	23623	11	156	9	0	12	1	0	0	238	5841	11	11
102070	2861	283950	328	947	149	4	84	40	155	150	20920	86480	113	107
118906	1717	189897	54	601	65	9	103	52	208	208	24662	102509	128	123
59900	2670	233632	106	1073	72	11	77	43	169	97	12526	96252	83	80
79011	1577	166266	64	623	75	9	67	41	148	111	16637	80238	104	103
103297	2934	358752	77	1163	114	4	139	52	179	162	21857	101345	148	148
143372	1624	189252	36	555	64	3	83	36	140	139	30391	111542	123	123
109432	2295	297982	87	684	70	0	147	45	164	115	23201	116938	142	141
167949	2122	305704	68	746	58	6	113	36	140	139	35902	164263	197	194
8773	568	38214	34	276	52	0	16	8	27	21	1888	13983	16	16
45724	1596	163766	48	457	107	0	83	45	169	119	9935	74151	132	101
149959	2295	285330	64	838	85	0	145	41	155	130	32616	195894	208	204
81351	2537	239314	68	865	64	13	99	45	173	154	17828	102204	111	109
103129	2824	267198	126	1061	91	5	99	41	158	127	22883	158376	147	138
154451	2604	246745	86	1011	52	2	116	36	132	118	34672	134969	154	151
88977	2189	242585	83	716	58	7	78	45	175	171	20065	111563	115	113
140824	1723	270018	68	476	90	3	96	38	144	116	32033	186099	165	165
84601	2030	233143	83	699	58	2	65	37	133	88	19354	105406	125	122
169707	2432	302218	83	642	80	5	122	56	210	208	38975	210012	174	169
187326	4513	498732	117	2201	109	0	149	33	128	122	43068	250931	185	177
156349	2633	301703	105	818	64	1	185	44	159	147	36171	169216	198	194
108146	2314	359644	84	982	95	4	140	45	166	143	25217	100125	121	121
168553	1606	222504	50	552	72	5	94	35	127	127	39932	162519	176	170
144408	1997	207822	57	735	75	7	74	34	132	117	34416	115466	125	124
183500	2091	285198	78	771	61	0	158	39	141	104	43840	211381	213	210
104128	1288	196269	58	445	64	0	50	53	205	171	24959	122975	173	158
33032	918	78800	42	330	57	2	20	26	82	66	7935	56968	21	21
43929	1148	162874	50	348	48	1	61	27	88	64	10621	100792	73	71
56750	2312	251466	89	786	58	1	76	37	138	85	13841	115750	98	96
126372	2645	341637	90	1056	48	3	130	36	140	133	30927	165278	183	178
160141	3842	447353	114	1216	114	0	147	45	175	138	39361	175721	166	157
71571	1787	182231	64	644	67	0	83	37	134	110	17696	75881	103	101
125818	1438	176082	55	507	41	3	103	29	111	85	31219	111669	169	162
38692	1369	145943	69	653	45	5	30	26	99	99	9648	68580	38	38
95893	2175	252529	83	822	77	12	89	36	139	127	23923	81180	103	100
67150	2535	282399	94	897	192	1	110	46	158	124	16786	114651	145	142
110529	2949	384053	114	1162	63	1	135	38	140	102	27738	232241	219	216
59938	2958	261494	72	1061	89	1	128	36	140	135	15049	82390	107	107
81625	2128	237633	114	660	61	7	117	55	210	184	20648	94853	98	93
71154	2250	201783	61	690	58	2	133	38	148	134	18050	80906	112	109
104767	2610	264889	88	931	59	8	92	42	163	142	26584	124527	130	126
125386	2181	236660	88	759	67	1	121	39	145	126	31852	134218	241	239
165933	4060	383703	130	1698	146	0	127	46	172	161	42570	147581	175	173
64520	1714	173510	60	470	85	6	68	42	157	126	16747	54518	73	71
165986	3805	367807	145	1253	123	12	151	58	223	221	43146	189944	208	193
102812	2306	280343	103	656	57	2	117	44	122	92	26759	136323	163	159
81897	1940	191030	60	681	61	1	127	38	148	133	21588	89770	140	137
37110	1495	155915	51	559	53	0	57	32	117	99	9845	64057	70	66
146975	2473	314255	79	947	134	4	73	36	140	132	39038	135599	150	144
92059	1694	187167	52	705	94	2	79	38	133	90	24648	91313	127	126
144551	3085	179797	104	1044	72	1	165	45	171	159	39039	81716	170	164
184923	3705	397681	108	1415	73	13	165	30	114	106	50099	226168	307	297
79756	1250	187992	35	473	49	0	71	40	151	137	21654	122531	90	89
140015	2960	323545	99	955	56	11	145	45	174	136	38086	145758	175	170
89506	3397	311281	113	1211	153	3	106	39	146	137	24347	160501	125	119
64593	1830	157429	76	689	76	4	55	39	143	112	17672	72558	90	90
70168	1840	215710	81	611	67	2	79	36	139	89	19433	104470	112	109
134238	3553	403932	79	1564	134	4	137	48	187	167	37343	191469	171	161
101047	2649	301614	88	1030	55	0	169	40	150	124	28317	135848	139	135
92622	3246	324178	79	1490	42	10	123	39	145	122	26041	134097	123	123
14116	492	31961	22	200	22	0	18	8	25	9	3988	13155	39	39
15986	1966	150216	54	822	175	0	52	27	101	77	4527	25157	27	27
89256	2081	175523	54	868	68	3	99	45	164	146	25314	104864	136	133
150491	3574	323485	179	1079	220	5	115	39	145	137	42721	194679	257	256
140358	2676	287015	134	846	83	8	117	51	198	176	40312	117495	125	125
114948	4763	369889	176	1650	127	0	168	59	223	199	33433	165354	150	142
95671	1816	213060	73	559	48	0	94	40	158	137	28524	160791	128	125
176225	3160	303406	116	1143	146	12	139	28	101	73	53405	214738	279	267
93487	1735	195153	73	635	82	5	75	36	115	108	28395	133252	94	87
89626	2711	237323	143	824	89	9	85	44	167	148	27269	134904	138	133
66485	1758	213274	44	595	72	0	82	33	120	82	20318	110896	93	92
79089	2063	296074	106	776	79	0	92	43	158	139	24409	169351	154	149
55918	1678	153613	46	622	41	1	62	28	109	89	17326	83963	63	61
112302	2090	318563	83	779	53	1	133	48	185	178	34811	198299	161	159
104581	2591	207280	114	960	72	0	86	38	146	139	32580	116136	116	115
117440	2758	353021	81	1010	115	0	137	52	198	187	36809	157384	162	160
101629	3657	422946	119	1317	74	0	112	43	158	148	32344	188355	121	117
112098	2683	218443	104	1137	135	2	134	38	148	133	35926	106194	148	145
68946	3145	366745	142	1047	113	3	130	47	185	115	22124	174586	174	173
114799	1426	228595	66	557	58	2	52	37	139	125	37062	153242	131	132
119442	3091	369331	92	1198	72	4	132	39	151	148	38941	189723	199	185
100087	3027	279012	58	1108	125	1	97	37	134	120	32982	129711	137	133
139165	2272	278019	74	908	49	3	123	45	175	165	46201	184531	155	152
83243	1968	270750	85	617	73	0	117	43	154	148	27652	153990	132	125
123534	1337	156923	57	390	68	6	71	36	132	130	41517	100922	108	108
6179	474	46660	20	259	7	0	12	5	15	13	2089	21509	13	13
1644	151	7199	5	74	0	0	7	0	0	0	556	4245	6	6
6023	207	14688	10	85	0	0	4	0	0	0	2065	7953	5	5
120192	2588	338543	137	1039	63	0	146	42	153	150	41455	197680	207	190
83248	2205	195817	73	779	54	0	146	40	155	103	28830	106020	130	130
103925	3314	336047	189	1174	45	2	124	39	151	143	36524	164808	158	149
72128	1646	216027	65	436	58	0	96	30	116	87	25696	145707	126	121
112431	2471	271965	69	828	99	0	123	45	171	148	40085	140303	148	147
92280	1627	236370	46	528	83	1	104	41	151	135	34245	147341	140	140
83515	3202	219420	114	1196	150	1	138	41	153	144	31452	96785	140	134
48029	2146	185468	80	716	85	4	89	23	84	36	18213	88634	82	82
93879	2616	318651	112	907	91	0	130	57	206	122	36099	170492	92	88
855	387	21054	16	146	2	0	4	0	0	0	338	6622	4	4
100046	2549	259692	47	1140	110	0	128	40	155	125	39844	128602	112	111
31081	934	115469	32	276	36	1	33	17	55	46	12558	58391	41	41
104978	2130	219475	138	749	72	0	92	40	151	88	45873	139292	206	205
5950	496	24188	24	218	20	0	8	4	12	7	2694	15049	7	7
3926	141	17547	5	69	3	0	0	1	4	4	2658	7670	3	3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Gwilym Jenkins' @ jenkins.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 & 5 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=156168&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=156168&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=156168&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 time5 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net







Confusion Matrix (predicted in columns / actuals in rows)
C1C2C3C4C5C6C7C8C9C10C11C12C13C14C15
C11000000000000000
C2271000000000000
C3018000000000000
C4022500100000000
C5012200400000000
C6001200700000000
C7001100800000000
C8002100600000000
C9002000700000001
C10000100700010000
C11001000400050000
C12000000700020001
C13000100700010000
C14000000600030001
C15001000200010005

\begin{tabular}{lllllllll}
\hline
Confusion Matrix (predicted in columns / actuals in rows) \tabularnewline & C1 & C2 & C3 & C4 & C5 & C6 & C7 & C8 & C9 & C10 & C11 & C12 & C13 & C14 & C15 \tabularnewline C1 & 10 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C2 & 2 & 7 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C3 & 0 & 1 & 8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C4 & 0 & 2 & 2 & 5 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C5 & 0 & 1 & 2 & 2 & 0 & 0 & 4 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C6 & 0 & 0 & 1 & 2 & 0 & 0 & 7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C7 & 0 & 0 & 1 & 1 & 0 & 0 & 8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C8 & 0 & 0 & 2 & 1 & 0 & 0 & 6 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \tabularnewline C9 & 0 & 0 & 2 & 0 & 0 & 0 & 7 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \tabularnewline C10 & 0 & 0 & 0 & 1 & 0 & 0 & 7 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline C11 & 0 & 0 & 1 & 0 & 0 & 0 & 4 & 0 & 0 & 0 & 5 & 0 & 0 & 0 & 0 \tabularnewline C12 & 0 & 0 & 0 & 0 & 0 & 0 & 7 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 1 \tabularnewline C13 & 0 & 0 & 0 & 1 & 0 & 0 & 7 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \tabularnewline C14 & 0 & 0 & 0 & 0 & 0 & 0 & 6 & 0 & 0 & 0 & 3 & 0 & 0 & 0 & 1 \tabularnewline C15 & 0 & 0 & 1 & 0 & 0 & 0 & 2 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 5 \tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=156168&T=1

[TABLE]
[ROW]
Confusion Matrix (predicted in columns / actuals in rows)[/C][/ROW] [ROW][C][/C][C]C1[/C][C]C2[/C][C]C3[/C][C]C4[/C][C]C5[/C][C]C6[/C][C]C7[/C][C]C8[/C][C]C9[/C][C]C10[/C][C]C11[/C][C]C12[/C][C]C13[/C][C]C14[/C][C]C15[/C][/ROW] [ROW][C]C1[/C][C]10[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C2[/C][C]2[/C][C]7[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C3[/C][C]0[/C][C]1[/C][C]8[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C4[/C][C]0[/C][C]2[/C][C]2[/C][C]5[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C5[/C][C]0[/C][C]1[/C][C]2[/C][C]2[/C][C]0[/C][C]0[/C][C]4[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C6[/C][C]0[/C][C]0[/C][C]1[/C][C]2[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C7[/C][C]0[/C][C]0[/C][C]1[/C][C]1[/C][C]0[/C][C]0[/C][C]8[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C8[/C][C]0[/C][C]0[/C][C]2[/C][C]1[/C][C]0[/C][C]0[/C][C]6[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C9[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][/ROW] [ROW][C]C10[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C11[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]4[/C][C]0[/C][C]0[/C][C]0[/C][C]5[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C12[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][/ROW] [ROW][C]C13[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]7[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][/ROW] [ROW][C]C14[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]0[/C][C]6[/C][C]0[/C][C]0[/C][C]0[/C][C]3[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][/ROW] [ROW][C]C15[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]2[/C][C]0[/C][C]0[/C][C]0[/C][C]1[/C][C]0[/C][C]0[/C][C]0[/C][C]5[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=156168&T=1

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

As an alternative you can also use a QR Code:  

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

Confusion Matrix (predicted in columns / actuals in rows)
C1C2C3C4C5C6C7C8C9C10C11C12C13C14C15
C11000000000000000
C2271000000000000
C3018000000000000
C4022500100000000
C5012200400000000
C6001200700000000
C7001100800000000
C8002100600000000
C9002000700000001
C10000100700010000
C11001000400050000
C12000000700020001
C13000100700010000
C14000000600030001
C15001000200010005



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