Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_multipleregression.wasp
Title produced by softwareMultiple Regression
Date of computationWed, 21 Nov 2007 05:54:19 -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/Nov/21/t11956492670c2ole7b4yu5rdx.htm/, Retrieved Tue, 07 May 2024 06:52:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=5848, Retrieved Tue, 07 May 2024 06:52:05 +0000
QR Codes:

Original text written by user:verband werkloosheid 1982-2006 en invoering dienstencheques 2005
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact238
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Multiple Regression] [Seatbeltlaw-Q3] [2007-11-21 12:54:19] [4c115797c5b528fedc91527ab5de21b2] [Current]
Feedback Forum

Post a new message
Dataseries X:
588261	1
596397	1
576612	0
538141	0
491481	0
469740	0
474427	0
507632	0
541047	0
570046	0
588251	0
596872	0
588676	0
549738	0
472907	0
429496	0
402790	0
419304	0
459425	0
500845	0
516761	0
557423	0
595042	0
589496	0
535029	0




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5848&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]4 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=5848&T=0

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







Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)654921.46153846227438.64905623.868600
x-17830.538461538631001.97925-0.57510.576770.288385
M1-33734.448717948727811.798532-1.2130.2505520.125276
M2-45499.820512820431888.737298-1.42680.1813910.090696
M3-99293.230769230630283.184436-3.27880.0073490.003675
M4-136804.37179487229990.34865-4.56160.0008140.000407
M5-170057.51282051329729.568856-5.72010.0001346.7e-05
M6-169241.15384615429501.695144-5.73670.0001316.5e-05
M7-143407.29487179529307.495082-4.89320.0004770.000238
M8-102664.93589743629147.641746-3.52220.004780.00239
M9-74569.57692307729022.702673-2.56940.026080.01304
M10-36309.217948718028933.130166-1.25490.2355090.117755
M11-4967.3589743589628879.253308-0.1720.8665580.433279
t-3429.858974358981018.945459-3.36610.0062960.003148

\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) & 654921.461538462 & 27438.649056 & 23.8686 & 0 & 0 \tabularnewline
x & -17830.5384615386 & 31001.97925 & -0.5751 & 0.57677 & 0.288385 \tabularnewline
M1 & -33734.4487179487 & 27811.798532 & -1.213 & 0.250552 & 0.125276 \tabularnewline
M2 & -45499.8205128204 & 31888.737298 & -1.4268 & 0.181391 & 0.090696 \tabularnewline
M3 & -99293.2307692306 & 30283.184436 & -3.2788 & 0.007349 & 0.003675 \tabularnewline
M4 & -136804.371794872 & 29990.34865 & -4.5616 & 0.000814 & 0.000407 \tabularnewline
M5 & -170057.512820513 & 29729.568856 & -5.7201 & 0.000134 & 6.7e-05 \tabularnewline
M6 & -169241.153846154 & 29501.695144 & -5.7367 & 0.000131 & 6.5e-05 \tabularnewline
M7 & -143407.294871795 & 29307.495082 & -4.8932 & 0.000477 & 0.000238 \tabularnewline
M8 & -102664.935897436 & 29147.641746 & -3.5222 & 0.00478 & 0.00239 \tabularnewline
M9 & -74569.576923077 & 29022.702673 & -2.5694 & 0.02608 & 0.01304 \tabularnewline
M10 & -36309.2179487180 & 28933.130166 & -1.2549 & 0.235509 & 0.117755 \tabularnewline
M11 & -4967.35897435896 & 28879.253308 & -0.172 & 0.866558 & 0.433279 \tabularnewline
t & -3429.85897435898 & 1018.945459 & -3.3661 & 0.006296 & 0.003148 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5848&T=1

[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]654921.461538462[/C][C]27438.649056[/C][C]23.8686[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]x[/C][C]-17830.5384615386[/C][C]31001.97925[/C][C]-0.5751[/C][C]0.57677[/C][C]0.288385[/C][/ROW]
[ROW][C]M1[/C][C]-33734.4487179487[/C][C]27811.798532[/C][C]-1.213[/C][C]0.250552[/C][C]0.125276[/C][/ROW]
[ROW][C]M2[/C][C]-45499.8205128204[/C][C]31888.737298[/C][C]-1.4268[/C][C]0.181391[/C][C]0.090696[/C][/ROW]
[ROW][C]M3[/C][C]-99293.2307692306[/C][C]30283.184436[/C][C]-3.2788[/C][C]0.007349[/C][C]0.003675[/C][/ROW]
[ROW][C]M4[/C][C]-136804.371794872[/C][C]29990.34865[/C][C]-4.5616[/C][C]0.000814[/C][C]0.000407[/C][/ROW]
[ROW][C]M5[/C][C]-170057.512820513[/C][C]29729.568856[/C][C]-5.7201[/C][C]0.000134[/C][C]6.7e-05[/C][/ROW]
[ROW][C]M6[/C][C]-169241.153846154[/C][C]29501.695144[/C][C]-5.7367[/C][C]0.000131[/C][C]6.5e-05[/C][/ROW]
[ROW][C]M7[/C][C]-143407.294871795[/C][C]29307.495082[/C][C]-4.8932[/C][C]0.000477[/C][C]0.000238[/C][/ROW]
[ROW][C]M8[/C][C]-102664.935897436[/C][C]29147.641746[/C][C]-3.5222[/C][C]0.00478[/C][C]0.00239[/C][/ROW]
[ROW][C]M9[/C][C]-74569.576923077[/C][C]29022.702673[/C][C]-2.5694[/C][C]0.02608[/C][C]0.01304[/C][/ROW]
[ROW][C]M10[/C][C]-36309.2179487180[/C][C]28933.130166[/C][C]-1.2549[/C][C]0.235509[/C][C]0.117755[/C][/ROW]
[ROW][C]M11[/C][C]-4967.35897435896[/C][C]28879.253308[/C][C]-0.172[/C][C]0.866558[/C][C]0.433279[/C][/ROW]
[ROW][C]t[/C][C]-3429.85897435898[/C][C]1018.945459[/C][C]-3.3661[/C][C]0.006296[/C][C]0.003148[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5848&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5848&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 - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)654921.46153846227438.64905623.868600
x-17830.538461538631001.97925-0.57510.576770.288385
M1-33734.448717948727811.798532-1.2130.2505520.125276
M2-45499.820512820431888.737298-1.42680.1813910.090696
M3-99293.230769230630283.184436-3.27880.0073490.003675
M4-136804.37179487229990.34865-4.56160.0008140.000407
M5-170057.51282051329729.568856-5.72010.0001346.7e-05
M6-169241.15384615429501.695144-5.73670.0001316.5e-05
M7-143407.29487179529307.495082-4.89320.0004770.000238
M8-102664.93589743629147.641746-3.52220.004780.00239
M9-74569.57692307729022.702673-2.56940.026080.01304
M10-36309.217948718028933.130166-1.25490.2355090.117755
M11-4967.3589743589628879.253308-0.1720.8665580.433279
t-3429.858974358981018.945459-3.36610.0062960.003148







Multiple Linear Regression - Regression Statistics
Multiple R0.946611084504785
R-squared0.896072545307325
Adjusted R-squared0.773249189761437
F-TEST (value)7.29562013124238
F-TEST (DF numerator)13
F-TEST (DF denominator)11
p-value0.00113789540626930
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation28861.2720056344
Sum Squared Residuals9162703239.61539

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Regression Statistics \tabularnewline
Multiple R & 0.946611084504785 \tabularnewline
R-squared & 0.896072545307325 \tabularnewline
Adjusted R-squared & 0.773249189761437 \tabularnewline
F-TEST (value) & 7.29562013124238 \tabularnewline
F-TEST (DF numerator) & 13 \tabularnewline
F-TEST (DF denominator) & 11 \tabularnewline
p-value & 0.00113789540626930 \tabularnewline
Multiple Linear Regression - Residual Statistics \tabularnewline
Residual Standard Deviation & 28861.2720056344 \tabularnewline
Sum Squared Residuals & 9162703239.61539 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5848&T=2

[TABLE]
[ROW][C]Multiple Linear Regression - Regression Statistics[/C][/ROW]
[ROW][C]Multiple R[/C][C]0.946611084504785[/C][/ROW]
[ROW][C]R-squared[/C][C]0.896072545307325[/C][/ROW]
[ROW][C]Adjusted R-squared[/C][C]0.773249189761437[/C][/ROW]
[ROW][C]F-TEST (value)[/C][C]7.29562013124238[/C][/ROW]
[ROW][C]F-TEST (DF numerator)[/C][C]13[/C][/ROW]
[ROW][C]F-TEST (DF denominator)[/C][C]11[/C][/ROW]
[ROW][C]p-value[/C][C]0.00113789540626930[/C][/ROW]
[ROW][C]Multiple Linear Regression - Residual Statistics[/C][/ROW]
[ROW][C]Residual Standard Deviation[/C][C]28861.2720056344[/C][/ROW]
[ROW][C]Sum Squared Residuals[/C][C]9162703239.61539[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5848&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5848&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 - Regression Statistics
Multiple R0.946611084504785
R-squared0.896072545307325
Adjusted R-squared0.773249189761437
F-TEST (value)7.29562013124238
F-TEST (DF numerator)13
F-TEST (DF denominator)11
p-value0.00113789540626930
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation28861.2720056344
Sum Squared Residuals9162703239.61539







Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolationForecastResidualsPrediction Error
1588261599926.615384615-11665.6153846154
2596397584731.38461538511665.6153846154
3576612545338.65384615431273.3461538462
4538141504397.65384615433743.3461538462
5491481467714.65384615423766.3461538460
6469740465101.1538461544638.84615384612
7474427487505.153846154-13078.1538461537
8507632524817.653846154-17185.6538461539
9541047549483.153846154-8436.15384615387
10570046584313.653846154-14267.6538461539
11588251612225.653846154-23974.6538461538
12596872613763.153846154-16891.1538461538
13588676576598.84615384612077.1538461538
14549738561403.615384615-11665.6153846154
15472907504180.346153846-31273.3461538462
16429496463239.346153846-33743.3461538462
17402790426556.346153846-23766.3461538460
18419304423942.846153846-4638.84615384614
19459425446346.84615384613078.1538461537
20500845483659.34615384617185.6538461538
21516761508324.8461538468436.15384615387
22557423543155.34615384614267.6538461539
23595042571067.34615384623974.6538461538
24589496572604.84615384616891.1538461539
25535029535440.538461538-411.538461538465

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Actuals, Interpolation, and Residuals \tabularnewline
Time or Index & Actuals & InterpolationForecast & ResidualsPrediction Error \tabularnewline
1 & 588261 & 599926.615384615 & -11665.6153846154 \tabularnewline
2 & 596397 & 584731.384615385 & 11665.6153846154 \tabularnewline
3 & 576612 & 545338.653846154 & 31273.3461538462 \tabularnewline
4 & 538141 & 504397.653846154 & 33743.3461538462 \tabularnewline
5 & 491481 & 467714.653846154 & 23766.3461538460 \tabularnewline
6 & 469740 & 465101.153846154 & 4638.84615384612 \tabularnewline
7 & 474427 & 487505.153846154 & -13078.1538461537 \tabularnewline
8 & 507632 & 524817.653846154 & -17185.6538461539 \tabularnewline
9 & 541047 & 549483.153846154 & -8436.15384615387 \tabularnewline
10 & 570046 & 584313.653846154 & -14267.6538461539 \tabularnewline
11 & 588251 & 612225.653846154 & -23974.6538461538 \tabularnewline
12 & 596872 & 613763.153846154 & -16891.1538461538 \tabularnewline
13 & 588676 & 576598.846153846 & 12077.1538461538 \tabularnewline
14 & 549738 & 561403.615384615 & -11665.6153846154 \tabularnewline
15 & 472907 & 504180.346153846 & -31273.3461538462 \tabularnewline
16 & 429496 & 463239.346153846 & -33743.3461538462 \tabularnewline
17 & 402790 & 426556.346153846 & -23766.3461538460 \tabularnewline
18 & 419304 & 423942.846153846 & -4638.84615384614 \tabularnewline
19 & 459425 & 446346.846153846 & 13078.1538461537 \tabularnewline
20 & 500845 & 483659.346153846 & 17185.6538461538 \tabularnewline
21 & 516761 & 508324.846153846 & 8436.15384615387 \tabularnewline
22 & 557423 & 543155.346153846 & 14267.6538461539 \tabularnewline
23 & 595042 & 571067.346153846 & 23974.6538461538 \tabularnewline
24 & 589496 & 572604.846153846 & 16891.1538461539 \tabularnewline
25 & 535029 & 535440.538461538 & -411.538461538465 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5848&T=3

[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]588261[/C][C]599926.615384615[/C][C]-11665.6153846154[/C][/ROW]
[ROW][C]2[/C][C]596397[/C][C]584731.384615385[/C][C]11665.6153846154[/C][/ROW]
[ROW][C]3[/C][C]576612[/C][C]545338.653846154[/C][C]31273.3461538462[/C][/ROW]
[ROW][C]4[/C][C]538141[/C][C]504397.653846154[/C][C]33743.3461538462[/C][/ROW]
[ROW][C]5[/C][C]491481[/C][C]467714.653846154[/C][C]23766.3461538460[/C][/ROW]
[ROW][C]6[/C][C]469740[/C][C]465101.153846154[/C][C]4638.84615384612[/C][/ROW]
[ROW][C]7[/C][C]474427[/C][C]487505.153846154[/C][C]-13078.1538461537[/C][/ROW]
[ROW][C]8[/C][C]507632[/C][C]524817.653846154[/C][C]-17185.6538461539[/C][/ROW]
[ROW][C]9[/C][C]541047[/C][C]549483.153846154[/C][C]-8436.15384615387[/C][/ROW]
[ROW][C]10[/C][C]570046[/C][C]584313.653846154[/C][C]-14267.6538461539[/C][/ROW]
[ROW][C]11[/C][C]588251[/C][C]612225.653846154[/C][C]-23974.6538461538[/C][/ROW]
[ROW][C]12[/C][C]596872[/C][C]613763.153846154[/C][C]-16891.1538461538[/C][/ROW]
[ROW][C]13[/C][C]588676[/C][C]576598.846153846[/C][C]12077.1538461538[/C][/ROW]
[ROW][C]14[/C][C]549738[/C][C]561403.615384615[/C][C]-11665.6153846154[/C][/ROW]
[ROW][C]15[/C][C]472907[/C][C]504180.346153846[/C][C]-31273.3461538462[/C][/ROW]
[ROW][C]16[/C][C]429496[/C][C]463239.346153846[/C][C]-33743.3461538462[/C][/ROW]
[ROW][C]17[/C][C]402790[/C][C]426556.346153846[/C][C]-23766.3461538460[/C][/ROW]
[ROW][C]18[/C][C]419304[/C][C]423942.846153846[/C][C]-4638.84615384614[/C][/ROW]
[ROW][C]19[/C][C]459425[/C][C]446346.846153846[/C][C]13078.1538461537[/C][/ROW]
[ROW][C]20[/C][C]500845[/C][C]483659.346153846[/C][C]17185.6538461538[/C][/ROW]
[ROW][C]21[/C][C]516761[/C][C]508324.846153846[/C][C]8436.15384615387[/C][/ROW]
[ROW][C]22[/C][C]557423[/C][C]543155.346153846[/C][C]14267.6538461539[/C][/ROW]
[ROW][C]23[/C][C]595042[/C][C]571067.346153846[/C][C]23974.6538461538[/C][/ROW]
[ROW][C]24[/C][C]589496[/C][C]572604.846153846[/C][C]16891.1538461539[/C][/ROW]
[ROW][C]25[/C][C]535029[/C][C]535440.538461538[/C][C]-411.538461538465[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5848&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5848&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 - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolationForecastResidualsPrediction Error
1588261599926.615384615-11665.6153846154
2596397584731.38461538511665.6153846154
3576612545338.65384615431273.3461538462
4538141504397.65384615433743.3461538462
5491481467714.65384615423766.3461538460
6469740465101.1538461544638.84615384612
7474427487505.153846154-13078.1538461537
8507632524817.653846154-17185.6538461539
9541047549483.153846154-8436.15384615387
10570046584313.653846154-14267.6538461539
11588251612225.653846154-23974.6538461538
12596872613763.153846154-16891.1538461538
13588676576598.84615384612077.1538461538
14549738561403.615384615-11665.6153846154
15472907504180.346153846-31273.3461538462
16429496463239.346153846-33743.3461538462
17402790426556.346153846-23766.3461538460
18419304423942.846153846-4638.84615384614
19459425446346.84615384613078.1538461537
20500845483659.34615384617185.6538461538
21516761508324.8461538468436.15384615387
22557423543155.34615384614267.6538461539
23595042571067.34615384623974.6538461538
24589496572604.84615384616891.1538461539
25535029535440.538461538-411.538461538465



Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = 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')