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 computationSun, 18 Dec 2011 16:44:02 -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/18/t1324244682toh0shlnijq48fv.htm/, Retrieved Sun, 05 May 2024 09:38:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=157196, Retrieved Sun, 05 May 2024 09:38:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact77
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Kendall tau Correlation Matrix] [] [2010-12-05 17:44:33] [b98453cac15ba1066b407e146608df68]
- RMPD    [Recursive Partitioning (Regression Trees)] [Deel III RTC] [2011-12-18 21:44:02] [84449ea5bbe6e767918d59f07903f9b5] [Current]
Feedback Forum

Post a new message
Dataseries X:
112285	210907	79	144	145	3	1	1
84786	120982	58	103	101	4	1	1
83123	176508	60	98	98	12	1	0
101193	179321	108	135	132	2	1	NA
38361	123185	49	61	60	1	1	NA
68504	52746	0	39	38	3	1	NA
119182	385534	121	150	144	0	1	1
22807	33170	1	5	5	0	1	NA
17140	101645	20	28	28	0	0	NA
116174	149061	43	84	84	5	1	1
57635	165446	69	80	79	0	1	0
66198	237213	78	130	127	0	1	0
71701	173326	86	82	78	7	1	NA
57793	133131	44	60	60	7	1	0
80444	258873	104	131	131	3	1	NA
53855	180083	63	84	84	9	1	NA
97668	324799	158	140	133	0	1	0
133824	230964	102	151	150	4	1	1
101481	236785	77	91	91	3	1	0
99645	135473	82	138	132	0	1	1
114789	202925	115	150	136	7	1	NA
99052	215147	101	124	124	0	1	1
67654	344297	80	119	118	1	1	0
65553	153935	50	73	70	5	1	1
97500	132943	83	110	107	7	1	NA
69112	174724	123	123	119	0	1	0
82753	174415	73	90	89	0	1	0
85323	225548	81	116	112	5	1	1
72654	223632	105	113	108	0	1	0
30727	124817	47	56	52	0	1	0
77873	221698	105	115	112	0	1	NA
117478	210767	94	119	116	3	1	1
74007	170266	44	129	123	4	1	1
90183	260561	114	127	125	1	1	NA
61542	84853	38	27	27	4	1	NA
101494	294424	107	175	162	2	1	1
27570	101011	30	35	32	0	0	NA
55813	215641	71	64	64	0	1	NA
79215	325107	84	96	92	0	1	0
1423	7176	0	0	0	0	0	0
55461	167542	59	84	83	2	1	NA
31081	106408	33	41	41	1	1	1
22996	96560	42	47	47	0	0	1
83122	265769	96	126	120	2	1	0
70106	269651	106	105	105	10	1	NA
60578	149112	56	80	79	6	1	1
39992	175824	57	70	65	0	0	0
79892	152871	59	73	70	5	1	1
49810	111665	39	57	55	4	1	0
71570	116408	34	40	39	1	1	NA
100708	362301	76	68	67	2	1	0
33032	78800	20	21	21	2	1	NA
82875	183167	91	127	127	0	1	1
139077	277965	115	154	152	8	1	NA
71595	150629	85	116	113	3	1	NA
72260	168809	76	102	99	0	1	0
5950	24188	8	7	7	0	1	0
115762	329267	79	148	141	8	1	0
32551	65029	21	21	21	5	1	NA
31701	101097	30	35	35	3	1	NA
80670	218946	76	112	109	1	1	0
143558	244052	101	137	133	5	1	0
117105	341570	94	135	123	1	0	0
23789	103597	27	26	26	1	0	1
120733	233328	92	230	230	5	1	NA
105195	256462	123	181	166	0	1	0
73107	206161	75	71	68	12	1	NA
132068	311473	128	147	147	8	1	NA
149193	235800	105	190	179	8	1	1
46821	177939	55	64	61	8	1	NA
87011	207176	56	105	101	8	1	NA
95260	196553	41	107	108	2	1	0
55183	174184	72	94	90	0	1	0
106671	143246	67	116	114	5	1	1
73511	187559	75	106	103	8	1	0
92945	187681	114	143	142	2	1	1
78664	119016	118	81	79	5	1	NA
70054	182192	77	89	88	12	1	NA
22618	73566	22	26	25	6	1	0
74011	194979	66	84	83	7	1	NA
83737	167488	69	113	113	2	1	1
69094	143756	105	120	118	0	1	1
93133	275541	116	110	110	4	1	NA
95536	243199	88	134	129	3	1	1
225920	182999	73	54	51	6	1	0
62133	135649	99	96	93	2	1	NA
61370	152299	62	78	76	0	1	0
43836	120221	53	51	49	1	1	NA
106117	346485	118	121	118	0	1	0
38692	145790	30	38	38	5	1	NA
84651	193339	100	145	141	2	1	0
56622	80953	49	59	58	0	1	NA
15986	122774	24	27	27	0	1	0
95364	130585	67	91	91	5	1	1
26706	112611	46	48	48	0	0	0
89691	286468	57	68	63	1	1	0
67267	241066	75	58	56	0	1	NA
126846	148446	135	150	144	1	1	0
41140	204713	68	74	73	1	1	NA
102860	182079	124	181	168	2	1	1
51715	140344	33	65	64	6	1	0
55801	220516	98	97	97	1	1	0
111813	243060	58	121	117	4	1	0
120293	162765	68	99	100	2	1	0
138599	182613	81	152	149	3	1	NA
161647	232138	131	188	187	0	1	0
115929	265318	110	138	127	10	1	1
24266	85574	37	40	37	0	0	0
162901	310839	130	254	245	9	1	1
109825	225060	93	87	87	7	1	1
129838	232317	118	178	177	0	1	0
37510	144966	39	51	49	0	1	1
43750	43287	13	49	49	4	1	NA
40652	155754	74	73	73	4	1	NA
87771	164709	81	176	177	0	1	0
85872	201940	109	94	94	0	1	NA
89275	235454	151	120	117	0	1	NA
44418	220801	51	66	60	1	0	0
192565	99466	28	56	55	0	1	1
35232	92661	40	39	39	1	0	0
40909	133328	56	66	64	0	0	0
13294	61361	27	27	26	0	0	0
32387	125930	37	65	64	4	0	NA
140867	100750	83	58	58	0	1	0
120662	224549	54	98	95	4	1	NA
21233	82316	27	25	25	4	0	NA
44332	102010	28	26	26	3	0	1
61056	101523	59	77	76	0	0	0
101338	243511	133	130	129	0	1	0
1168	22938	12	11	11	0	1	0
13497	41566	0	2	2	5	0	NA
65567	152474	106	101	101	0	1	0
25162	61857	23	31	28	4	1	NA
32334	99923	44	36	36	0	0	1
40735	132487	71	120	89	0	1	0
91413	317394	116	195	193	1	1	1
855	21054	4	4	4	0	1	0
97068	209641	62	89	84	5	1	0
44339	22648	12	24	23	0	0	1
14116	31414	18	39	39	0	1	1
10288	46698	14	14	14	0	0	0
65622	131698	60	78	78	0	0	0
16563	91735	7	15	14	0	0	NA
76643	244749	98	106	101	2	1	0
110681	184510	64	83	82	7	1	NA
29011	79863	29	24	24	1	0	NA
92696	128423	32	37	36	8	1	1
94785	97839	25	77	75	2	1	1
8773	38214	16	16	16	0	1	NA
83209	151101	48	56	55	2	1	NA
93815	272458	100	132	131	0	1	0
86687	172494	46	144	131	0	1	NA
34553	108043	45	40	39	1	0	0
105547	328107	129	153	144	3	1	1
103487	250579	130	143	139	0	1	NA
213688	351067	136	220	211	3	1	0
71220	158015	59	79	78	0	1	1
23517	98866	25	50	50	0	0	NA
56926	85439	32	39	39	0	1	NA
91721	229242	63	95	90	4	1	0
115168	351619	95	169	166	4	1	NA
111194	84207	14	12	12	11	1	0
51009	120445	36	63	57	0	0	1
135777	324598	113	134	133	0	1	1
51513	131069	47	69	69	4	1	1
74163	204271	92	119	119	0	1	1
51633	165543	70	119	119	1	1	NA
75345	141722	19	75	65	0	1	NA
33416	116048	50	63	61	0	0	1
83305	250047	41	55	49	0	0	0
98952	299775	91	103	101	9	1	0
102372	195838	111	197	196	1	1	1
37238	173260	41	16	15	3	1	0
103772	254488	120	140	136	10	1	1
123969	104389	135	89	89	5	1	NA
27142	136084	27	40	40	0	0	NA
135400	199476	87	125	123	2	1	NA
21399	92499	25	21	21	0	0	0
130115	224330	131	167	163	1	1	1
24874	135781	45	32	29	2	0	1
34988	74408	29	36	35	4	0	0
45549	81240	58	13	13	0	0	1
6023	14688	4	5	5	0	1	NA
64466	181633	47	96	96	2	1	0
54990	271856	109	151	151	1	1	0
1644	7199	7	6	6	0	1	NA
6179	46660	12	13	13	0	1	NA
3926	17547	0	3	3	0	1	NA
32755	133368	37	57	56	1	0	NA
34777	95227	37	23	23	0	1	0
73224	152601	46	61	57	2	1	NA
27114	98146	15	21	14	0	0	1
20760	79619	42	43	43	3	0	NA
37636	59194	7	20	20	6	0	1
65461	139942	54	82	72	0	0	0
30080	118612	54	90	87	2	0	1
24094	72880	14	25	21	0	0	0
69008	65475	16	60	56	2	0	0
54968	99643	33	61	59	1	0	NA
46090	71965	32	85	82	1	0	0
27507	77272	21	43	43	2	0	NA
10672	49289	15	25	25	1	0	NA
34029	135131	38	41	38	0	0	1
46300	108446	22	26	25	1	0	1
24760	89746	28	38	38	3	0	NA
18779	44296	10	12	12	0	0	NA
21280	77648	31	29	29	0	0	NA
40662	181528	32	49	47	0	0	0
28987	134019	32	46	45	0	0	0
22827	124064	43	41	40	1	0	NA
18513	92630	27	31	30	4	0	NA
30594	121848	37	41	41	0	0	1
24006	52915	20	26	25	0	0	NA
27913	81872	32	23	23	0	0	1
42744	58981	0	14	14	7	0	1
12934	53515	5	16	16	2	0	1
22574	60812	26	25	26	0	0	NA
41385	56375	10	21	21	7	0	0
18653	65490	27	32	27	3	0	0
18472	80949	11	9	9	0	0	NA
30976	76302	29	35	33	0	0	0
63339	104011	25	42	42	6	0	0
25568	98104	55	68	68	2	0	1
33747	67989	23	32	32	0	0	NA
4154	30989	5	6	6	0	0	0
19474	135458	43	68	67	3	0	1
35130	73504	23	33	33	0	0	NA
39067	63123	34	84	77	1	0	0
13310	61254	36	46	46	1	0	NA
65892	74914	35	30	30	0	0	0
4143	31774	0	0	0	1	0	1
28579	81437	37	36	36	0	0	0
51776	87186	28	47	46	0	0	NA
21152	50090	16	20	18	0	0	NA
38084	65745	26	50	48	0	0	0
27717	56653	38	30	29	0	0	0
32928	158399	23	30	28	0	0	0
11342	46455	22	34	34	0	0	NA
19499	73624	30	33	33	0	0	0
16380	38395	16	34	34	0	0	NA
36874	91899	18	37	33	0	0	0
48259	139526	28	83	80	0	0	0
16734	52164	32	32	32	0	0	NA
28207	51567	21	30	30	2	0	1
30143	70551	23	43	41	0	0	NA
41369	84856	29	41	41	1	0	NA
45833	102538	50	51	51	1	0	1
29156	86678	12	19	18	0	0	0
35944	85709	21	37	34	0	0	NA
36278	34662	18	33	31	0	0	NA
45588	150580	27	41	39	0	0	0
45097	99611	41	54	54	0	0	0
3895	19349	13	14	14	0	0	NA
28394	99373	12	25	24	1	0	1
18632	86230	21	25	24	0	0	1
2325	30837	8	8	8	0	0	1
25139	31706	26	26	26	0	0	0
27975	89806	27	20	19	0	0	0
14483	62088	13	11	11	1	0	NA
13127	40151	16	14	14	0	0	NA
5839	27634	2	3	1	0	0	NA
24069	76990	42	40	39	0	0	NA
3738	37460	5	5	5	0	0	NA
18625	54157	37	38	37	0	0	NA
36341	49862	17	32	32	0	0	NA
24548	84337	38	41	38	0	0	NA
21792	64175	37	46	47	0	0	1
26263	59382	29	47	47	0	0	1
23686	119308	32	37	37	0	0	1
49303	76702	35	51	51	0	0	1
25659	103425	17	49	45	1	0	NA
28904	70344	20	21	21	0	0	NA
2781	43410	7	1	1	0	0	NA
29236	104838	46	44	42	1	0	NA
19546	62215	24	26	26	0	0	NA
22818	69304	40	21	21	6	0	NA
32689	53117	3	4	4	3	0	NA
5752	19764	10	10	10	1	0	0
22197	86680	37	43	43	2	0	NA
20055	84105	17	34	34	0	0	1
25272	77945	28	32	31	0	0	NA
82206	89113	19	20	19	0	0	NA
32073	91005	29	34	34	3	0	NA
5444	40248	8	6	6	1	0	NA
20154	64187	10	12	11	0	0	0
36944	50857	15	24	24	0	0	NA
8019	56613	15	16	16	1	0	NA
30884	62792	28	72	72	0	0	NA 
19540	72535	17	27	21	0	0	0




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=157196&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'AstonUniversity' @ aston.wessa.net







Confusion Matrix (predicted in columns / actuals in rows)
C1C2
C11414
C223121

\begin{tabular}{lllllllll}
\hline
Confusion Matrix (predicted in columns / actuals in rows) \tabularnewline
 & C1 & C2 \tabularnewline
C1 & 141 & 4 \tabularnewline
C2 & 23 & 121 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=157196&T=1

[TABLE]
[ROW][C]Confusion Matrix (predicted in columns / actuals in rows)[/C][/ROW]
[ROW][C][/C][C]C1[/C][C]C2[/C][/ROW]
[ROW][C]C1[/C][C]141[/C][C]4[/C][/ROW]
[ROW][C]C2[/C][C]23[/C][C]121[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=157196&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=157196&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)
C1C2
C11414
C223121



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