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 computationThu, 15 Dec 2011 11:13:59 -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/15/t1323965685m8xqzn8zzu8lkzo.htm/, Retrieved Wed, 08 May 2024 11:58:27 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=155542, Retrieved Wed, 08 May 2024 11:58:27 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact79
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 19:35:21] [b98453cac15ba1066b407e146608df68]
-   PD    [Recursive Partitioning (Regression Trees)] [WS 10 RP 2] [2011-12-15 16:13:59] [850c8b4f3ff1a893cc2b9e9f060c8f7e] [Current]
Feedback Forum

Post a new message
Dataseries X:
1418	210907	396	79	30	112285	146283
869	120982	297	58	28	84786	98364
1530	176508	559	60	38	83123	86146
2172	179321	967	108	30	101193	96933
901	123185	270	49	22	38361	79234
463	52746	143	0	26	68504	42551
3201	385534	1562	121	25	119182	195663
371	33170	109	1	18	22807	6853
1192	101645	371	20	11	17140	21529
1583	149061	656	43	26	116174	95757
1439	165446	511	69	25	57635	85584
1764	237213	655	78	38	66198	143983
1495	173326	465	86	44	71701	75851
1373	133131	525	44	30	57793	59238
2187	258873	885	104	40	80444	93163
1491	180083	497	63	34	53855	96037
4041	324799	1436	158	47	97668	151511
1706	230964	612	102	30	133824	136368
2152	236785	865	77	31	101481	112642
1036	135473	385	82	23	99645	94728
1882	202925	567	115	36	114789	105499
1929	215147	639	101	36	99052	121527
2242	344297	963	80	30	67654	127766
1220	153935	398	50	25	65553	98958
1289	132943	410	83	39	97500	77900
2515	174724	966	123	34	69112	85646
2147	174415	801	73	31	82753	98579
2352	225548	892	81	31	85323	130767
1638	223632	513	105	33	72654	131741
1222	124817	469	47	25	30727	53907
1812	221698	683	105	33	77873	178812
1677	210767	643	94	35	117478	146761
1579	170266	535	44	42	74007	82036
1731	260561	625	114	43	90183	163253
807	84853	264	38	30	61542	27032
2452	294424	992	107	33	101494	171975
829	101011	238	30	13	27570	65990
1940	215641	818	71	32	55813	86572
2662	325107	937	84	36	79215	159676
186	7176	70	0	0	1423	1929
1499	167542	507	59	28	55461	85371
865	106408	260	33	14	31081	58391
1793	96560	503	42	17	22996	31580
2527	265769	927	96	32	83122	136815
2747	269651	1269	106	30	70106	120642
1324	149112	537	56	35	60578	69107
2702	175824	910	57	20	39992	50495
1383	152871	532	59	28	79892	108016
1179	111665	345	39	28	49810	46341
2099	116408	918	34	39	71570	78348
4308	362301	1635	76	34	100708	79336
918	78800	330	20	26	33032	56968
1831	183167	557	91	39	82875	93176
3373	277965	1178	115	39	139077	161632
1713	150629	740	85	33	71595	87850
1438	168809	452	76	28	72260	127969
496	24188	218	8	4	5950	15049
2253	329267	764	79	39	115762	155135
744	65029	255	21	18	32551	25109
1161	101097	454	30	14	31701	45824
2352	218946	866	76	29	80670	102996
2144	244052	574	101	44	143558	160604
4691	341570	1276	94	21	117105	158051
1112	103597	379	27	16	23789	44547
2694	233328	825	92	28	120733	162647
1973	256462	798	123	35	105195	174141
1769	206161	663	75	28	73107	60622
3148	311473	1069	128	38	132068	179566
2474	235800	921	105	23	149193	184301
2084	177939	858	55	36	46821	75661
1954	207176	711	56	32	87011	96144
1226	196553	503	41	29	95260	129847
1389	174184	382	72	25	55183	117286
1496	143246	464	67	27	106671	71180
2269	187559	717	75	36	73511	109377
1833	187681	690	114	28	92945	85298
1268	119016	462	118	23	78664	73631
1943	182192	657	77	40	70054	86767
893	73566	385	22	23	22618	23824
1762	194979	577	66	40	74011	93487
1403	167488	619	69	28	83737	82981
1425	143756	479	105	34	69094	73815
1857	275541	817	116	33	93133	94552
1840	243199	752	88	28	95536	132190
1502	182999	430	73	34	225920	128754
1441	135649	451	99	30	62133	66363
1420	152299	537	62	33	61370	67808
1416	120221	519	53	22	43836	61724
2970	346485	1000	118	38	106117	131722
1317	145790	637	30	26	38692	68580
1644	193339	465	100	35	84651	106175
870	80953	437	49	8	56622	55792
1654	122774	711	24	24	15986	25157
1054	130585	299	67	29	95364	76669
937	112611	248	46	20	26706	57283
3004	286468	1162	57	29	89691	105805
2008	241066	714	75	45	67267	129484
2547	148446	905	135	37	126846	72413
1885	204713	649	68	33	41140	87831
1626	182079	512	124	33	102860	96971
1468	140344	472	33	25	51715	71299
2445	220516	905	98	32	55801	77494
1964	243060	786	58	29	111813	120336
1381	162765	489	68	28	120293	93913
1369	182613	479	81	28	138599	136048
1659	232138	617	131	31	161647	181248
2888	265318	925	110	52	115929	146123
1290	85574	351	37	21	24266	32036
2845	310839	1144	130	24	162901	186646
1982	225060	669	93	41	109825	102255
1904	232317	707	118	33	129838	168237
1391	144966	458	39	32	37510	64219
602	43287	214	13	19	43750	19630
1743	155754	599	74	20	40652	76825
1559	164709	572	81	31	87771	115338
2014	201940	897	109	31	85872	109427
2143	235454	819	151	32	89275	118168
2146	220801	720	51	18	44418	84845
874	99466	273	28	23	192565	153197
1590	92661	508	40	17	35232	29877
1590	133328	506	56	20	40909	63506
1210	61361	451	27	12	13294	22445
2072	125930	699	37	17	32387	47695
1281	100750	407	83	30	140867	68370
1401	224549	465	54	31	120662	146304
834	82316	245	27	10	21233	38233
1105	102010	370	28	13	44332	42071
1272	101523	316	59	22	61056	50517
1944	243511	603	133	42	101338	103950
391	22938	154	12	1	1168	5841
761	41566	229	0	9	13497	2341
1605	152474	577	106	32	65567	84396
530	61857	192	23	11	25162	24610
1988	99923	617	44	25	32334	35753
1386	132487	411	71	36	40735	55515
2395	317394	975	116	31	91413	209056
387	21054	146	4	0	855	6622
1742	209641	705	62	24	97068	115814
620	22648	184	12	13	44339	11609
449	31414	200	18	8	14116	13155
800	46698	274	14	13	10288	18274
1684	131698	502	60	19	65622	72875
1050	91735	382	7	18	16563	10112
2699	244749	964	98	33	76643	142775
1606	184510	537	64	40	110681	68847
1502	79863	438	29	22	29011	17659
1204	128423	369	32	38	92696	20112
1138	97839	417	25	24	94785	61023
568	38214	276	16	8	8773	13983
1459	151101	514	48	35	83209	65176
2158	272458	822	100	43	93815	132432
1111	172494	389	46	43	86687	112494
1421	108043	466	45	14	34553	45109
2833	328107	1255	129	41	105547	170875
1955	250579	694	130	38	103487	180759
2922	351067	1024	136	45	213688	214921
1002	158015	400	59	31	71220	100226
1060	98866	397	25	13	23517	32043
956	85439	350	32	28	56926	54454
2186	229242	719	63	31	91721	78876
3604	351619	1277	95	40	115168	170745
1035	84207	356	14	30	111194	6940
1417	120445	457	36	16	51009	49025
3261	324598	1402	113	37	135777	122037
1587	131069	600	47	30	51513	53782
1424	204271	480	92	35	74163	127748
1701	165543	595	70	32	51633	86839
1249	141722	436	19	27	75345	44830
946	116048	230	50	20	33416	77395
1926	250047	651	41	18	83305	89324
3352	299775	1367	91	31	98952	103300
1641	195838	564	111	31	102372	112283
2035	173260	716	41	21	37238	10901
2312	254488	747	120	39	103772	120691
1369	104389	467	135	41	123969	58106
1577	136084	671	27	13	27142	57140
2201	199476	861	87	32	135400	122422
961	92499	319	25	18	21399	25899
1900	224330	612	131	39	130115	139296
1254	135781	433	45	14	24874	52678
1335	74408	434	29	7	34988	23853
1597	81240	503	58	17	45549	17306
207	14688	85	4	0	6023	7953
1645	181633	564	47	30	64466	89455
2429	271856	824	109	37	54990	147866
151	7199	74	7	0	1644	4245
474	46660	259	12	5	6179	21509
141	17547	69	0	1	3926	7670
1639	133368	535	37	16	32755	66675
872	95227	239	37	32	34777	14336
1318	152601	438	46	24	73224	53608
1018	98146	459	15	17	27114	30059
1383	79619	426	42	11	20760	29668
1314	59194	288	7	24	37636	22097
1335	139942	498	54	22	65461	96841
1403	118612	454	54	12	30080	41907
910	72880	376	14	19	24094	27080
616	65475	225	16	13	69008	35885
1407	99643	555	33	17	54968	41247
771	71965	252	32	15	46090	28313
766	77272	208	21	16	27507	36845
473	49289	130	15	24	10672	16548
1376	135131	481	38	15	34029	36134
1232	108446	389	22	17	46300	55764
1521	89746	565	28	18	24760	28910
572	44296	173	10	20	18779	13339
1059	77648	278	31	16	21280	25319
1544	181528	609	32	16	40662	66956
1230	134019	422	32	18	28987	47487
1206	124064	445	43	22	22827	52785
1205	92630	387	27	8	18513	44683
1255	121848	339	37	17	30594	35619
613	52915	181	20	18	24006	21920
721	81872	245	32	16	27913	45608
1109	58981	384	0	23	42744	7721
740	53515	212	5	22	12934	20634
1126	60812	399	26	13	22574	29788
728	56375	229	10	13	41385	31931
689	65490	224	27	16	18653	37754
592	80949	203	11	16	18472	32505
995	76302	333	29	20	30976	40557
1613	104011	384	25	22	63339	94238
2048	98104	636	55	17	25568	44197
705	67989	185	23	18	33747	43228
301	30989	93	5	17	4154	4103
1803	135458	581	43	12	19474	44144
799	73504	248	23	7	35130	32868
861	63123	304	34	17	39067	27640
1186	61254	344	36	14	13310	14063
1451	74914	407	35	23	65892	28990
628	31774	170	0	17	4143	4694
1161	81437	312	37	14	28579	42648
1463	87186	507	28	15	51776	64329
742	50090	224	16	17	21152	21928
979	65745	340	26	21	38084	25836
675	56653	168	38	18	27717	22779
1241	158399	443	23	18	32928	40820
676	46455	204	22	17	11342	27530
1049	73624	367	30	17	19499	32378
620	38395	210	16	16	16380	10824
1081	91899	335	18	15	36874	39613
1688	139526	364	28	21	48259	60865
736	52164	178	32	16	16734	19787
617	51567	206	21	14	28207	20107
812	70551	279	23	15	30143	36605
1051	84856	387	29	17	41369	40961
1656	102538	490	50	15	45833	48231
705	86678	238	12	15	29156	39725
945	85709	343	21	10	35944	21455
554	34662	232	18	6	36278	23430
1597	150580	530	27	22	45588	62991
982	99611	291	41	21	45097	49363
222	19349	67	13	1	3895	9604
1212	99373	397	12	18	28394	24552
1143	86230	467	21	17	18632	31493
435	30837	178	8	4	2325	3439
532	31706	175	26	10	25139	19555
882	89806	299	27	16	27975	21228
608	62088	154	13	16	14483	23177
459	40151	106	16	9	13127	22094
578	27634	189	2	16	5839	2342
826	76990	194	42	17	24069	38798
509	37460	135	5	7	3738	3255
717	54157	201	37	15	18625	24261
637	49862	207	17	14	36341	18511
857	84337	280	38	14	24548	40798
830	64175	260	37	18	21792	28893
652	59382	227	29	12	26263	21425
707	119308	239	32	16	23686	50276
954	76702	333	35	21	49303	37643
1461	103425	428	17	19	25659	30377
672	70344	230	20	16	28904	27126
778	43410	292	7	1	2781	13
1141	104838	350	46	16	29236	42097
680	62215	186	24	10	19546	24451
1090	69304	326	40	19	22818	14335
616	53117	155	3	12	32689	5084
285	19764	75	10	2	5752	9927
1145	86680	361	37	14	22197	43527
733	84105	261	17	17	20055	27184
888	77945	299	28	19	25272	21610
849	89113	300	19	14	82206	20484
1182	91005	450	29	11	32073	20156
528	40248	183	8	4	5444	6012
642	64187	238	10	16	20154	18475
947	50857	165	15	20	36944	12645
819	56613	234	15	12	8019	11017
757	62792	176	28	15	30884	37623
894	72535	329	17	16	19540	35873




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=155542&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 time8 seconds
R Server'George Udny Yule' @ yule.wessa.net







Confusion Matrix (predicted in columns / actuals in rows)
C1C2
C113213
C27137

\begin{tabular}{lllllllll}
\hline
Confusion Matrix (predicted in columns / actuals in rows) \tabularnewline
 & C1 & C2 \tabularnewline
C1 & 132 & 13 \tabularnewline
C2 & 7 & 137 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=155542&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]132[/C][C]13[/C][/ROW]
[ROW][C]C2[/C][C]7[/C][C]137[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=155542&T=1

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



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