Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_regression_trees1.wasp
Title produced by softwareRecursive Partitioning (Regression Trees)
Date of computationSun, 30 Apr 2023 17:40:22 +0200
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2023/Apr/30/t1682869307bofrmg2cwuq8ck7.htm/, Retrieved Wed, 09 Sep 2026 15:48:17 +0200
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=, Retrieved Wed, 09 Sep 2026 15:48:17 +0200
QR Codes:

Original text written by user:
IsPrivate?This computation is private
User-defined keywords
Estimated Impact0
Dataseries X:
1	22.55
1	22.55
1	22.55
1	22.55
1	22.55
1	22.55
1	22.55
14	2.97
24	2.97
1	6.71
33	6.71
6	0.93
100	0.93
12	0.42
8	0.59
11	0.59
25	0.59
1	11.24
92	3.17
20	3.17
1	10.49
1	10.49
1	10.49
4	10.49
4	10.49
5	10.49
1	10.09
1	10.09
2	6.00
1	6.00
1	39.70
1	39.70
11	0.06
1	12.09
9	1.03
14	1.10
1	6.20
2	6.20
2	9.70
100	4.82
4	13.96
20	1.18
1	5.41
4	10.74
6	2.30
1	9.98
100	1.46
100	2.43
100	1.45
2	5.72
100	2.62
8	7.73




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R ServerBig Analytics Cloud Computing Center







Goodness of Fit
Correlation0.6102
R-squared0.3724
RMSE25.7432

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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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.6102
R-squared0.3724
RMSE25.7432







Actuals, Predictions, and Residuals
#ActualsForecastsResiduals
112.84375-1.84375
212.84375-1.84375
312.84375-1.84375
412.84375-1.84375
512.84375-1.84375
612.84375-1.84375
712.84375-1.84375
81443.6-29.6
92443.6-19.6
1012.84375-1.84375
11332.8437530.15625
12643.6-37.6
1310043.656.4
141243.6-31.6
15843.6-35.6
161143.6-32.6
172543.6-18.6
1812.84375-1.84375
199243.648.4
202043.6-23.6
2112.84375-1.84375
2212.84375-1.84375
2312.84375-1.84375
2442.843751.15625
2542.843751.15625
2652.843752.15625
2712.84375-1.84375
2812.84375-1.84375
2922.84375-0.84375
3012.84375-1.84375
3112.84375-1.84375
3212.84375-1.84375
331143.6-32.6
3412.84375-1.84375
35943.6-34.6
361443.6-29.6
3712.84375-1.84375
3822.84375-0.84375
3922.84375-0.84375
4010043.656.4
4142.843751.15625
422043.6-23.6
4312.84375-1.84375
4442.843751.15625
45643.6-37.6
4612.84375-1.84375
4710043.656.4
4810043.656.4
4910043.656.4
5022.84375-0.84375
5110043.656.4
5282.843755.15625

\begin{tabular}{lllllllll}
\hline
Actuals, Predictions, and Residuals \tabularnewline
# & Actuals & Forecasts & Residuals \tabularnewline
1 & 1 & 2.84375 & -1.84375 \tabularnewline
2 & 1 & 2.84375 & -1.84375 \tabularnewline
3 & 1 & 2.84375 & -1.84375 \tabularnewline
4 & 1 & 2.84375 & -1.84375 \tabularnewline
5 & 1 & 2.84375 & -1.84375 \tabularnewline
6 & 1 & 2.84375 & -1.84375 \tabularnewline
7 & 1 & 2.84375 & -1.84375 \tabularnewline
8 & 14 & 43.6 & -29.6 \tabularnewline
9 & 24 & 43.6 & -19.6 \tabularnewline
10 & 1 & 2.84375 & -1.84375 \tabularnewline
11 & 33 & 2.84375 & 30.15625 \tabularnewline
12 & 6 & 43.6 & -37.6 \tabularnewline
13 & 100 & 43.6 & 56.4 \tabularnewline
14 & 12 & 43.6 & -31.6 \tabularnewline
15 & 8 & 43.6 & -35.6 \tabularnewline
16 & 11 & 43.6 & -32.6 \tabularnewline
17 & 25 & 43.6 & -18.6 \tabularnewline
18 & 1 & 2.84375 & -1.84375 \tabularnewline
19 & 92 & 43.6 & 48.4 \tabularnewline
20 & 20 & 43.6 & -23.6 \tabularnewline
21 & 1 & 2.84375 & -1.84375 \tabularnewline
22 & 1 & 2.84375 & -1.84375 \tabularnewline
23 & 1 & 2.84375 & -1.84375 \tabularnewline
24 & 4 & 2.84375 & 1.15625 \tabularnewline
25 & 4 & 2.84375 & 1.15625 \tabularnewline
26 & 5 & 2.84375 & 2.15625 \tabularnewline
27 & 1 & 2.84375 & -1.84375 \tabularnewline
28 & 1 & 2.84375 & -1.84375 \tabularnewline
29 & 2 & 2.84375 & -0.84375 \tabularnewline
30 & 1 & 2.84375 & -1.84375 \tabularnewline
31 & 1 & 2.84375 & -1.84375 \tabularnewline
32 & 1 & 2.84375 & -1.84375 \tabularnewline
33 & 11 & 43.6 & -32.6 \tabularnewline
34 & 1 & 2.84375 & -1.84375 \tabularnewline
35 & 9 & 43.6 & -34.6 \tabularnewline
36 & 14 & 43.6 & -29.6 \tabularnewline
37 & 1 & 2.84375 & -1.84375 \tabularnewline
38 & 2 & 2.84375 & -0.84375 \tabularnewline
39 & 2 & 2.84375 & -0.84375 \tabularnewline
40 & 100 & 43.6 & 56.4 \tabularnewline
41 & 4 & 2.84375 & 1.15625 \tabularnewline
42 & 20 & 43.6 & -23.6 \tabularnewline
43 & 1 & 2.84375 & -1.84375 \tabularnewline
44 & 4 & 2.84375 & 1.15625 \tabularnewline
45 & 6 & 43.6 & -37.6 \tabularnewline
46 & 1 & 2.84375 & -1.84375 \tabularnewline
47 & 100 & 43.6 & 56.4 \tabularnewline
48 & 100 & 43.6 & 56.4 \tabularnewline
49 & 100 & 43.6 & 56.4 \tabularnewline
50 & 2 & 2.84375 & -0.84375 \tabularnewline
51 & 100 & 43.6 & 56.4 \tabularnewline
52 & 8 & 2.84375 & 5.15625 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=&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]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]2[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]3[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]4[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]5[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]6[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]7[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]8[/C][C]14[/C][C]43.6[/C][C]-29.6[/C][/ROW]
[ROW][C]9[/C][C]24[/C][C]43.6[/C][C]-19.6[/C][/ROW]
[ROW][C]10[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]11[/C][C]33[/C][C]2.84375[/C][C]30.15625[/C][/ROW]
[ROW][C]12[/C][C]6[/C][C]43.6[/C][C]-37.6[/C][/ROW]
[ROW][C]13[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]14[/C][C]12[/C][C]43.6[/C][C]-31.6[/C][/ROW]
[ROW][C]15[/C][C]8[/C][C]43.6[/C][C]-35.6[/C][/ROW]
[ROW][C]16[/C][C]11[/C][C]43.6[/C][C]-32.6[/C][/ROW]
[ROW][C]17[/C][C]25[/C][C]43.6[/C][C]-18.6[/C][/ROW]
[ROW][C]18[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]19[/C][C]92[/C][C]43.6[/C][C]48.4[/C][/ROW]
[ROW][C]20[/C][C]20[/C][C]43.6[/C][C]-23.6[/C][/ROW]
[ROW][C]21[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]22[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]23[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]24[/C][C]4[/C][C]2.84375[/C][C]1.15625[/C][/ROW]
[ROW][C]25[/C][C]4[/C][C]2.84375[/C][C]1.15625[/C][/ROW]
[ROW][C]26[/C][C]5[/C][C]2.84375[/C][C]2.15625[/C][/ROW]
[ROW][C]27[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]28[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]29[/C][C]2[/C][C]2.84375[/C][C]-0.84375[/C][/ROW]
[ROW][C]30[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]31[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]32[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]33[/C][C]11[/C][C]43.6[/C][C]-32.6[/C][/ROW]
[ROW][C]34[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]35[/C][C]9[/C][C]43.6[/C][C]-34.6[/C][/ROW]
[ROW][C]36[/C][C]14[/C][C]43.6[/C][C]-29.6[/C][/ROW]
[ROW][C]37[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]38[/C][C]2[/C][C]2.84375[/C][C]-0.84375[/C][/ROW]
[ROW][C]39[/C][C]2[/C][C]2.84375[/C][C]-0.84375[/C][/ROW]
[ROW][C]40[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]41[/C][C]4[/C][C]2.84375[/C][C]1.15625[/C][/ROW]
[ROW][C]42[/C][C]20[/C][C]43.6[/C][C]-23.6[/C][/ROW]
[ROW][C]43[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]44[/C][C]4[/C][C]2.84375[/C][C]1.15625[/C][/ROW]
[ROW][C]45[/C][C]6[/C][C]43.6[/C][C]-37.6[/C][/ROW]
[ROW][C]46[/C][C]1[/C][C]2.84375[/C][C]-1.84375[/C][/ROW]
[ROW][C]47[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]48[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]49[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]50[/C][C]2[/C][C]2.84375[/C][C]-0.84375[/C][/ROW]
[ROW][C]51[/C][C]100[/C][C]43.6[/C][C]56.4[/C][/ROW]
[ROW][C]52[/C][C]8[/C][C]2.84375[/C][C]5.15625[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=&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
112.84375-1.84375
212.84375-1.84375
312.84375-1.84375
412.84375-1.84375
512.84375-1.84375
612.84375-1.84375
712.84375-1.84375
81443.6-29.6
92443.6-19.6
1012.84375-1.84375
11332.8437530.15625
12643.6-37.6
1310043.656.4
141243.6-31.6
15843.6-35.6
161143.6-32.6
172543.6-18.6
1812.84375-1.84375
199243.648.4
202043.6-23.6
2112.84375-1.84375
2212.84375-1.84375
2312.84375-1.84375
2442.843751.15625
2542.843751.15625
2652.843752.15625
2712.84375-1.84375
2812.84375-1.84375
2922.84375-0.84375
3012.84375-1.84375
3112.84375-1.84375
3212.84375-1.84375
331143.6-32.6
3412.84375-1.84375
35943.6-34.6
361443.6-29.6
3712.84375-1.84375
3822.84375-0.84375
3922.84375-0.84375
4010043.656.4
4142.843751.15625
422043.6-23.6
4312.84375-1.84375
4442.843751.15625
45643.6-37.6
4612.84375-1.84375
4710043.656.4
4810043.656.4
4910043.656.4
5022.84375-0.84375
5110043.656.4
5282.843755.15625



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