Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_multipleregression.wasp
Title produced by softwareMultiple Regression
Date of computationSat, 29 Dec 2007 03:44:02 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Dec/29/t1198923781t5w2v8gv3wq5d0o.htm/, Retrieved Sat, 27 Apr 2024 06:01:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4915, Retrieved Sat, 27 Apr 2024 06:01:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact297
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Multiple Regression] [] [2007-12-29 10:44:02] [5ab9c9a9553a1280610271cc4d1472e3] [Current]
Feedback Forum

Post a new message
Dataseries X:
163414	0
163652	0
164603	0
165257	0
168731	0
171848	0
175032	0
179187	0
187369	0
194147	0
200145	0
203750	0
206464	0
205034	0
211782	0
244562	0
247059	0
255703	0
260218	0
268852	0
279436	0
281514	0
285458	1
288338	1
296369	1
302221	1
311016	1




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of compuational 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 & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4915&T=0

[TABLE]
[ROW][C]Summary of compuational 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]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4915&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4915&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







Multiple Linear Regression - Estimated Regression Equation
BBP[t] = + 210204.125748503 + 88721.245508982`ja/nee`[t] -1615.4465355004Q1[t] + 1995.55346449956Q2[t] -5802.48160821216Q3[t] + e[t]

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Estimated Regression Equation \tabularnewline
BBP[t] =  +  210204.125748503 +  88721.245508982`ja/nee`[t] -1615.4465355004Q1[t] +  1995.55346449956Q2[t] -5802.48160821216Q3[t]  + e[t] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4915&T=1

[TABLE]
[ROW][C]Multiple Linear Regression - Estimated Regression Equation[/C][/ROW]
[ROW][C]BBP[t] =  +  210204.125748503 +  88721.245508982`ja/nee`[t] -1615.4465355004Q1[t] +  1995.55346449956Q2[t] -5802.48160821216Q3[t]  + e[t][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4915&T=1

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

As an alternative you can also use a QR Code:  

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

Multiple Linear Regression - Estimated Regression Equation
BBP[t] = + 210204.125748503 + 88721.245508982`ja/nee`[t] -1615.4465355004Q1[t] + 1995.55346449956Q2[t] -5802.48160821216Q3[t] + e[t]







Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)210204.12574850316719.49594812.572400
`ja/nee`88721.24550898220120.9659744.40940.0002220.000111
Q1-1615.446535500422326.95241-0.07240.9429740.471487
Q21995.5534644995622326.952410.08940.929590.464795
Q3-5802.4816082121622449.966853-0.25850.7984520.399226

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Ordinary Least Squares \tabularnewline
Variable & Parameter & S.D. & T-STATH0: parameter = 0 & 2-tail p-value & 1-tail p-value \tabularnewline
(Intercept) & 210204.125748503 & 16719.495948 & 12.5724 & 0 & 0 \tabularnewline
`ja/nee` & 88721.245508982 & 20120.965974 & 4.4094 & 0.000222 & 0.000111 \tabularnewline
Q1 & -1615.4465355004 & 22326.95241 & -0.0724 & 0.942974 & 0.471487 \tabularnewline
Q2 & 1995.55346449956 & 22326.95241 & 0.0894 & 0.92959 & 0.464795 \tabularnewline
Q3 & -5802.48160821216 & 22449.966853 & -0.2585 & 0.798452 & 0.399226 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4915&T=2

[TABLE]
[ROW][C]Multiple Linear Regression - Ordinary Least Squares[/C][/ROW]
[ROW][C]Variable[/C][C]Parameter[/C][C]S.D.[/C][C]T-STATH0: parameter = 0[/C][C]2-tail p-value[/C][C]1-tail p-value[/C][/ROW]
[ROW][C](Intercept)[/C][C]210204.125748503[/C][C]16719.495948[/C][C]12.5724[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]`ja/nee`[/C][C]88721.245508982[/C][C]20120.965974[/C][C]4.4094[/C][C]0.000222[/C][C]0.000111[/C][/ROW]
[ROW][C]Q1[/C][C]-1615.4465355004[/C][C]22326.95241[/C][C]-0.0724[/C][C]0.942974[/C][C]0.471487[/C][/ROW]
[ROW][C]Q2[/C][C]1995.55346449956[/C][C]22326.95241[/C][C]0.0894[/C][C]0.92959[/C][C]0.464795[/C][/ROW]
[ROW][C]Q3[/C][C]-5802.48160821216[/C][C]22449.966853[/C][C]-0.2585[/C][C]0.798452[/C][C]0.399226[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4915&T=2

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

As an alternative you can also use a QR Code:  

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

Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)210204.12574850316719.49594812.572400
`ja/nee`88721.24550898220120.9659744.40940.0002220.000111
Q1-1615.446535500422326.95241-0.07240.9429740.471487
Q21995.5534644995622326.952410.08940.929590.464795
Q3-5802.4816082121622449.966853-0.25850.7984520.399226







Multiple Linear Regression - Regression Statistics
Multiple R0.686413874436888
R-squared0.47116400701946
Adjusted R-squared0.375012008295725
F-TEST (value)4.9001998218801
F-TEST (DF numerator)4
F-TEST (DF denominator)22
p-value0.00559392384329749
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation40121.9855343899
Sum Squared Residuals35415021910.8794

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Regression Statistics \tabularnewline
Multiple R & 0.686413874436888 \tabularnewline
R-squared & 0.47116400701946 \tabularnewline
Adjusted R-squared & 0.375012008295725 \tabularnewline
F-TEST (value) & 4.9001998218801 \tabularnewline
F-TEST (DF numerator) & 4 \tabularnewline
F-TEST (DF denominator) & 22 \tabularnewline
p-value & 0.00559392384329749 \tabularnewline
Multiple Linear Regression - Residual Statistics \tabularnewline
Residual Standard Deviation & 40121.9855343899 \tabularnewline
Sum Squared Residuals & 35415021910.8794 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4915&T=3

[TABLE]
[ROW][C]Multiple Linear Regression - Regression Statistics[/C][/ROW]
[ROW][C]Multiple R[/C][C]0.686413874436888[/C][/ROW]
[ROW][C]R-squared[/C][C]0.47116400701946[/C][/ROW]
[ROW][C]Adjusted R-squared[/C][C]0.375012008295725[/C][/ROW]
[ROW][C]F-TEST (value)[/C][C]4.9001998218801[/C][/ROW]
[ROW][C]F-TEST (DF numerator)[/C][C]4[/C][/ROW]
[ROW][C]F-TEST (DF denominator)[/C][C]22[/C][/ROW]
[ROW][C]p-value[/C][C]0.00559392384329749[/C][/ROW]
[ROW][C]Multiple Linear Regression - Residual Statistics[/C][/ROW]
[ROW][C]Residual Standard Deviation[/C][C]40121.9855343899[/C][/ROW]
[ROW][C]Sum Squared Residuals[/C][C]35415021910.8794[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4915&T=3

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

As an alternative you can also use a QR Code:  

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

Multiple Linear Regression - Regression Statistics
Multiple R0.686413874436888
R-squared0.47116400701946
Adjusted R-squared0.375012008295725
F-TEST (value)4.9001998218801
F-TEST (DF numerator)4
F-TEST (DF denominator)22
p-value0.00559392384329749
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation40121.9855343899
Sum Squared Residuals35415021910.8794







Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolationForecastResidualsPrediction Error
1163414208588.679213002-45174.6792130024
2163652212199.679213003-48547.6792130026
3164603204401.644140291-39798.6441402909
4165257210204.125748503-44947.125748503
5168731208588.679213003-39857.6792130026
6171848212199.679213003-40351.6792130026
7175032204401.644140291-29369.6441402908
8179187210204.125748503-31017.125748503
9187369208588.679213003-21219.6792130026
10194147212199.679213003-18052.6792130026
11200145204401.644140291-4256.64414029085
12203750210204.125748503-6454.12574850301
13206464208588.679213003-2124.6792130026
14205034212199.679213003-7165.67921300258
15211782204401.6441402917380.35585970916
16244562210204.12574850334357.874251497
17247059208588.67921300338470.3207869974
18255703212199.67921300343503.3207869974
19260218204401.64414029155816.3558597092
20268852210204.12574850358647.874251497
21279436208588.67921300370847.3207869974
22281514212199.67921300369314.3207869974
23285458293122.889649273-7664.88964927288
24288338298925.371257485-10587.3712574850
25296369297309.924721985-940.924721984632
26302221300920.9247219851300.07527801539
27311016293122.88964927317893.1103507271

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Actuals, Interpolation, and Residuals \tabularnewline
Time or Index & Actuals & InterpolationForecast & ResidualsPrediction Error \tabularnewline
1 & 163414 & 208588.679213002 & -45174.6792130024 \tabularnewline
2 & 163652 & 212199.679213003 & -48547.6792130026 \tabularnewline
3 & 164603 & 204401.644140291 & -39798.6441402909 \tabularnewline
4 & 165257 & 210204.125748503 & -44947.125748503 \tabularnewline
5 & 168731 & 208588.679213003 & -39857.6792130026 \tabularnewline
6 & 171848 & 212199.679213003 & -40351.6792130026 \tabularnewline
7 & 175032 & 204401.644140291 & -29369.6441402908 \tabularnewline
8 & 179187 & 210204.125748503 & -31017.125748503 \tabularnewline
9 & 187369 & 208588.679213003 & -21219.6792130026 \tabularnewline
10 & 194147 & 212199.679213003 & -18052.6792130026 \tabularnewline
11 & 200145 & 204401.644140291 & -4256.64414029085 \tabularnewline
12 & 203750 & 210204.125748503 & -6454.12574850301 \tabularnewline
13 & 206464 & 208588.679213003 & -2124.6792130026 \tabularnewline
14 & 205034 & 212199.679213003 & -7165.67921300258 \tabularnewline
15 & 211782 & 204401.644140291 & 7380.35585970916 \tabularnewline
16 & 244562 & 210204.125748503 & 34357.874251497 \tabularnewline
17 & 247059 & 208588.679213003 & 38470.3207869974 \tabularnewline
18 & 255703 & 212199.679213003 & 43503.3207869974 \tabularnewline
19 & 260218 & 204401.644140291 & 55816.3558597092 \tabularnewline
20 & 268852 & 210204.125748503 & 58647.874251497 \tabularnewline
21 & 279436 & 208588.679213003 & 70847.3207869974 \tabularnewline
22 & 281514 & 212199.679213003 & 69314.3207869974 \tabularnewline
23 & 285458 & 293122.889649273 & -7664.88964927288 \tabularnewline
24 & 288338 & 298925.371257485 & -10587.3712574850 \tabularnewline
25 & 296369 & 297309.924721985 & -940.924721984632 \tabularnewline
26 & 302221 & 300920.924721985 & 1300.07527801539 \tabularnewline
27 & 311016 & 293122.889649273 & 17893.1103507271 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4915&T=4

[TABLE]
[ROW][C]Multiple Linear Regression - Actuals, Interpolation, and Residuals[/C][/ROW]
[ROW][C]Time or Index[/C][C]Actuals[/C][C]InterpolationForecast[/C][C]ResidualsPrediction Error[/C][/ROW]
[ROW][C]1[/C][C]163414[/C][C]208588.679213002[/C][C]-45174.6792130024[/C][/ROW]
[ROW][C]2[/C][C]163652[/C][C]212199.679213003[/C][C]-48547.6792130026[/C][/ROW]
[ROW][C]3[/C][C]164603[/C][C]204401.644140291[/C][C]-39798.6441402909[/C][/ROW]
[ROW][C]4[/C][C]165257[/C][C]210204.125748503[/C][C]-44947.125748503[/C][/ROW]
[ROW][C]5[/C][C]168731[/C][C]208588.679213003[/C][C]-39857.6792130026[/C][/ROW]
[ROW][C]6[/C][C]171848[/C][C]212199.679213003[/C][C]-40351.6792130026[/C][/ROW]
[ROW][C]7[/C][C]175032[/C][C]204401.644140291[/C][C]-29369.6441402908[/C][/ROW]
[ROW][C]8[/C][C]179187[/C][C]210204.125748503[/C][C]-31017.125748503[/C][/ROW]
[ROW][C]9[/C][C]187369[/C][C]208588.679213003[/C][C]-21219.6792130026[/C][/ROW]
[ROW][C]10[/C][C]194147[/C][C]212199.679213003[/C][C]-18052.6792130026[/C][/ROW]
[ROW][C]11[/C][C]200145[/C][C]204401.644140291[/C][C]-4256.64414029085[/C][/ROW]
[ROW][C]12[/C][C]203750[/C][C]210204.125748503[/C][C]-6454.12574850301[/C][/ROW]
[ROW][C]13[/C][C]206464[/C][C]208588.679213003[/C][C]-2124.6792130026[/C][/ROW]
[ROW][C]14[/C][C]205034[/C][C]212199.679213003[/C][C]-7165.67921300258[/C][/ROW]
[ROW][C]15[/C][C]211782[/C][C]204401.644140291[/C][C]7380.35585970916[/C][/ROW]
[ROW][C]16[/C][C]244562[/C][C]210204.125748503[/C][C]34357.874251497[/C][/ROW]
[ROW][C]17[/C][C]247059[/C][C]208588.679213003[/C][C]38470.3207869974[/C][/ROW]
[ROW][C]18[/C][C]255703[/C][C]212199.679213003[/C][C]43503.3207869974[/C][/ROW]
[ROW][C]19[/C][C]260218[/C][C]204401.644140291[/C][C]55816.3558597092[/C][/ROW]
[ROW][C]20[/C][C]268852[/C][C]210204.125748503[/C][C]58647.874251497[/C][/ROW]
[ROW][C]21[/C][C]279436[/C][C]208588.679213003[/C][C]70847.3207869974[/C][/ROW]
[ROW][C]22[/C][C]281514[/C][C]212199.679213003[/C][C]69314.3207869974[/C][/ROW]
[ROW][C]23[/C][C]285458[/C][C]293122.889649273[/C][C]-7664.88964927288[/C][/ROW]
[ROW][C]24[/C][C]288338[/C][C]298925.371257485[/C][C]-10587.3712574850[/C][/ROW]
[ROW][C]25[/C][C]296369[/C][C]297309.924721985[/C][C]-940.924721984632[/C][/ROW]
[ROW][C]26[/C][C]302221[/C][C]300920.924721985[/C][C]1300.07527801539[/C][/ROW]
[ROW][C]27[/C][C]311016[/C][C]293122.889649273[/C][C]17893.1103507271[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4915&T=4

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

As an alternative you can also use a QR Code:  

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

Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolationForecastResidualsPrediction Error
1163414208588.679213002-45174.6792130024
2163652212199.679213003-48547.6792130026
3164603204401.644140291-39798.6441402909
4165257210204.125748503-44947.125748503
5168731208588.679213003-39857.6792130026
6171848212199.679213003-40351.6792130026
7175032204401.644140291-29369.6441402908
8179187210204.125748503-31017.125748503
9187369208588.679213003-21219.6792130026
10194147212199.679213003-18052.6792130026
11200145204401.644140291-4256.64414029085
12203750210204.125748503-6454.12574850301
13206464208588.679213003-2124.6792130026
14205034212199.679213003-7165.67921300258
15211782204401.6441402917380.35585970916
16244562210204.12574850334357.874251497
17247059208588.67921300338470.3207869974
18255703212199.67921300343503.3207869974
19260218204401.64414029155816.3558597092
20268852210204.12574850358647.874251497
21279436208588.67921300370847.3207869974
22281514212199.67921300369314.3207869974
23285458293122.889649273-7664.88964927288
24288338298925.371257485-10587.3712574850
25296369297309.924721985-940.924721984632
26302221300920.9247219851300.07527801539
27311016293122.88964927317893.1103507271



Parameters (Session):
par1 = 1 ; par2 = Include Quarterly Dummies ; par3 = No Linear Trend ;
Parameters (R input):
par1 = 1 ; par2 = Include Quarterly Dummies ; par3 = No Linear Trend ;
R code (references can be found in the software module):
library(lattice)
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
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,hyperlink('ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')