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:38:41 -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/t1198923465ls8yqlrqd2mnz58.htm/, Retrieved Sat, 27 Apr 2024 08:09:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4914, Retrieved Sat, 27 Apr 2024 08:09:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact280
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Multiple Regression] [] [2007-12-29 10:38:41] [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 time16 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 16 seconds \tabularnewline
R Server & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4914&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]16 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4914&T=0

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







Multiple Linear Regression - Estimated Regression Equation
BBP[t] = + 132356.491935484 + 9922.88709677425`ja/nee`[t] + 7893.83243727606M1[t] + 3406.82885304658M2[t] + 2864.49193548385M3[t] + 12149.6388888889M4[t] + 9094.80197132617M5[t] + 8934.96505376345M6[t] + 6744.12813620071M7[t] + 7098.29121863798M8[t] + 10440.9543010753M9[t] + 8828.61738351255M10[t] + 2797.83691756272M11[t] + 6040.33691756272t + e[t]

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Estimated Regression Equation \tabularnewline
BBP[t] =  +  132356.491935484 +  9922.88709677425`ja/nee`[t] +  7893.83243727606M1[t] +  3406.82885304658M2[t] +  2864.49193548385M3[t] +  12149.6388888889M4[t] +  9094.80197132617M5[t] +  8934.96505376345M6[t] +  6744.12813620071M7[t] +  7098.29121863798M8[t] +  10440.9543010753M9[t] +  8828.61738351255M10[t] +  2797.83691756272M11[t] +  6040.33691756272t  + e[t] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4914&T=1

[TABLE]
[ROW][C]Multiple Linear Regression - Estimated Regression Equation[/C][/ROW]
[ROW][C]BBP[t] =  +  132356.491935484 +  9922.88709677425`ja/nee`[t] +  7893.83243727606M1[t] +  3406.82885304658M2[t] +  2864.49193548385M3[t] +  12149.6388888889M4[t] +  9094.80197132617M5[t] +  8934.96505376345M6[t] +  6744.12813620071M7[t] +  7098.29121863798M8[t] +  10440.9543010753M9[t] +  8828.61738351255M10[t] +  2797.83691756272M11[t] +  6040.33691756272t  + e[t][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4914&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4914&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] = + 132356.491935484 + 9922.88709677425`ja/nee`[t] + 7893.83243727606M1[t] + 3406.82885304658M2[t] + 2864.49193548385M3[t] + 12149.6388888889M4[t] + 9094.80197132617M5[t] + 8934.96505376345M6[t] + 6744.12813620071M7[t] + 7098.29121863798M8[t] + 10440.9543010753M9[t] + 8828.61738351255M10[t] + 2797.83691756272M11[t] + 6040.33691756272t + e[t]







Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)132356.49193548410312.28812812.834800
`ja/nee`9922.8870967742510018.4302410.99050.3400260.170013
M17893.8324372760611221.6688450.70340.4941850.247093
M23406.8288530465811189.0863930.30450.7655830.382792
M32864.4919354838511174.2447810.25630.8016940.400847
M412149.638888888912669.2799050.9590.3550640.177532
M59094.8019713261712677.1368230.71740.4858080.242904
M68934.9650537634512700.6784160.70350.494150.247075
M76744.1281362007112739.8177340.52940.6054680.302734
M87098.2912186379812794.4116320.55480.5884530.294226
M910440.954301075312864.2633520.81160.4316170.215809
M108828.6173835125512949.1259790.68180.5073360.253668
M112797.8369175627212180.4279360.22970.82190.41095
t6040.33691756272446.25635113.535600

\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) & 132356.491935484 & 10312.288128 & 12.8348 & 0 & 0 \tabularnewline
`ja/nee` & 9922.88709677425 & 10018.430241 & 0.9905 & 0.340026 & 0.170013 \tabularnewline
M1 & 7893.83243727606 & 11221.668845 & 0.7034 & 0.494185 & 0.247093 \tabularnewline
M2 & 3406.82885304658 & 11189.086393 & 0.3045 & 0.765583 & 0.382792 \tabularnewline
M3 & 2864.49193548385 & 11174.244781 & 0.2563 & 0.801694 & 0.400847 \tabularnewline
M4 & 12149.6388888889 & 12669.279905 & 0.959 & 0.355064 & 0.177532 \tabularnewline
M5 & 9094.80197132617 & 12677.136823 & 0.7174 & 0.485808 & 0.242904 \tabularnewline
M6 & 8934.96505376345 & 12700.678416 & 0.7035 & 0.49415 & 0.247075 \tabularnewline
M7 & 6744.12813620071 & 12739.817734 & 0.5294 & 0.605468 & 0.302734 \tabularnewline
M8 & 7098.29121863798 & 12794.411632 & 0.5548 & 0.588453 & 0.294226 \tabularnewline
M9 & 10440.9543010753 & 12864.263352 & 0.8116 & 0.431617 & 0.215809 \tabularnewline
M10 & 8828.61738351255 & 12949.125979 & 0.6818 & 0.507336 & 0.253668 \tabularnewline
M11 & 2797.83691756272 & 12180.427936 & 0.2297 & 0.8219 & 0.41095 \tabularnewline
t & 6040.33691756272 & 446.256351 & 13.5356 & 0 & 0 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4914&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]132356.491935484[/C][C]10312.288128[/C][C]12.8348[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]`ja/nee`[/C][C]9922.88709677425[/C][C]10018.430241[/C][C]0.9905[/C][C]0.340026[/C][C]0.170013[/C][/ROW]
[ROW][C]M1[/C][C]7893.83243727606[/C][C]11221.668845[/C][C]0.7034[/C][C]0.494185[/C][C]0.247093[/C][/ROW]
[ROW][C]M2[/C][C]3406.82885304658[/C][C]11189.086393[/C][C]0.3045[/C][C]0.765583[/C][C]0.382792[/C][/ROW]
[ROW][C]M3[/C][C]2864.49193548385[/C][C]11174.244781[/C][C]0.2563[/C][C]0.801694[/C][C]0.400847[/C][/ROW]
[ROW][C]M4[/C][C]12149.6388888889[/C][C]12669.279905[/C][C]0.959[/C][C]0.355064[/C][C]0.177532[/C][/ROW]
[ROW][C]M5[/C][C]9094.80197132617[/C][C]12677.136823[/C][C]0.7174[/C][C]0.485808[/C][C]0.242904[/C][/ROW]
[ROW][C]M6[/C][C]8934.96505376345[/C][C]12700.678416[/C][C]0.7035[/C][C]0.49415[/C][C]0.247075[/C][/ROW]
[ROW][C]M7[/C][C]6744.12813620071[/C][C]12739.817734[/C][C]0.5294[/C][C]0.605468[/C][C]0.302734[/C][/ROW]
[ROW][C]M8[/C][C]7098.29121863798[/C][C]12794.411632[/C][C]0.5548[/C][C]0.588453[/C][C]0.294226[/C][/ROW]
[ROW][C]M9[/C][C]10440.9543010753[/C][C]12864.263352[/C][C]0.8116[/C][C]0.431617[/C][C]0.215809[/C][/ROW]
[ROW][C]M10[/C][C]8828.61738351255[/C][C]12949.125979[/C][C]0.6818[/C][C]0.507336[/C][C]0.253668[/C][/ROW]
[ROW][C]M11[/C][C]2797.83691756272[/C][C]12180.427936[/C][C]0.2297[/C][C]0.8219[/C][C]0.41095[/C][/ROW]
[ROW][C]t[/C][C]6040.33691756272[/C][C]446.256351[/C][C]13.5356[/C][C]0[/C][C]0[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4914&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4914&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)132356.49193548410312.28812812.834800
`ja/nee`9922.8870967742510018.4302410.99050.3400260.170013
M17893.8324372760611221.6688450.70340.4941850.247093
M23406.8288530465811189.0863930.30450.7655830.382792
M32864.4919354838511174.2447810.25630.8016940.400847
M412149.638888888912669.2799050.9590.3550640.177532
M59094.8019713261712677.1368230.71740.4858080.242904
M68934.9650537634512700.6784160.70350.494150.247075
M76744.1281362007112739.8177340.52940.6054680.302734
M87098.2912186379812794.4116320.55480.5884530.294226
M910440.954301075312864.2633520.81160.4316170.215809
M108828.6173835125512949.1259790.68180.5073360.253668
M112797.8369175627212180.4279360.22970.82190.41095
t6040.33691756272446.25635113.535600







Multiple Linear Regression - Regression Statistics
Multiple R0.985514095256932
R-squared0.971238031950088
Adjusted R-squared0.942476063900177
F-TEST (value)33.7681354163477
F-TEST (DF numerator)13
F-TEST (DF denominator)13
p-value7.43145109893817e-08
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation12172.2504070904
Sum Squared Residuals1926127839.64786

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Regression Statistics \tabularnewline
Multiple R & 0.985514095256932 \tabularnewline
R-squared & 0.971238031950088 \tabularnewline
Adjusted R-squared & 0.942476063900177 \tabularnewline
F-TEST (value) & 33.7681354163477 \tabularnewline
F-TEST (DF numerator) & 13 \tabularnewline
F-TEST (DF denominator) & 13 \tabularnewline
p-value & 7.43145109893817e-08 \tabularnewline
Multiple Linear Regression - Residual Statistics \tabularnewline
Residual Standard Deviation & 12172.2504070904 \tabularnewline
Sum Squared Residuals & 1926127839.64786 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4914&T=3

[TABLE]
[ROW][C]Multiple Linear Regression - Regression Statistics[/C][/ROW]
[ROW][C]Multiple R[/C][C]0.985514095256932[/C][/ROW]
[ROW][C]R-squared[/C][C]0.971238031950088[/C][/ROW]
[ROW][C]Adjusted R-squared[/C][C]0.942476063900177[/C][/ROW]
[ROW][C]F-TEST (value)[/C][C]33.7681354163477[/C][/ROW]
[ROW][C]F-TEST (DF numerator)[/C][C]13[/C][/ROW]
[ROW][C]F-TEST (DF denominator)[/C][C]13[/C][/ROW]
[ROW][C]p-value[/C][C]7.43145109893817e-08[/C][/ROW]
[ROW][C]Multiple Linear Regression - Residual Statistics[/C][/ROW]
[ROW][C]Residual Standard Deviation[/C][C]12172.2504070904[/C][/ROW]
[ROW][C]Sum Squared Residuals[/C][C]1926127839.64786[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4914&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4914&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.985514095256932
R-squared0.971238031950088
Adjusted R-squared0.942476063900177
F-TEST (value)33.7681354163477
F-TEST (DF numerator)13
F-TEST (DF denominator)13
p-value7.43145109893817e-08
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation12172.2504070904
Sum Squared Residuals1926127839.64786







Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolationForecastResidualsPrediction Error
1163414146290.66129032217123.3387096776
2163652147843.99462365615808.0053763441
3164603153341.99462365611261.0053763441
4165257168667.478494624-3410.47849462369
5168731171652.978494624-2921.97849462368
6171848177533.478494624-5685.47849462365
7175032181382.978494624-6350.97849462366
8179187187777.478494624-8590.47849462368
9187369197160.478494624-9791.47849462366
10194147201588.478494624-7441.47849462367
11200145201598.034946237-1453.03494623656
12203750204840.534946237-1090.53494623656
13206464218774.704301075-12310.7043010754
14205034220328.037634409-15294.0376344086
15211782225826.037634409-14044.0376344086
16244562241151.5215053763410.47849462368
17247059244137.0215053762921.97849462367
18255703250017.5215053765685.47849462366
19260218253867.0215053766350.97849462366
20268852260261.5215053768590.47849462367
21279436269644.5215053769791.47849462366
22281514274072.5215053767441.47849462367
23285458284004.9650537631453.03494623657
24288338287247.4650537631090.53494623657
25296369301181.634408602-4812.63440860222
26302221302734.967741935-513.967741935443
27311016308232.9677419352783.03225806454

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Actuals, Interpolation, and Residuals \tabularnewline
Time or Index & Actuals & InterpolationForecast & ResidualsPrediction Error \tabularnewline
1 & 163414 & 146290.661290322 & 17123.3387096776 \tabularnewline
2 & 163652 & 147843.994623656 & 15808.0053763441 \tabularnewline
3 & 164603 & 153341.994623656 & 11261.0053763441 \tabularnewline
4 & 165257 & 168667.478494624 & -3410.47849462369 \tabularnewline
5 & 168731 & 171652.978494624 & -2921.97849462368 \tabularnewline
6 & 171848 & 177533.478494624 & -5685.47849462365 \tabularnewline
7 & 175032 & 181382.978494624 & -6350.97849462366 \tabularnewline
8 & 179187 & 187777.478494624 & -8590.47849462368 \tabularnewline
9 & 187369 & 197160.478494624 & -9791.47849462366 \tabularnewline
10 & 194147 & 201588.478494624 & -7441.47849462367 \tabularnewline
11 & 200145 & 201598.034946237 & -1453.03494623656 \tabularnewline
12 & 203750 & 204840.534946237 & -1090.53494623656 \tabularnewline
13 & 206464 & 218774.704301075 & -12310.7043010754 \tabularnewline
14 & 205034 & 220328.037634409 & -15294.0376344086 \tabularnewline
15 & 211782 & 225826.037634409 & -14044.0376344086 \tabularnewline
16 & 244562 & 241151.521505376 & 3410.47849462368 \tabularnewline
17 & 247059 & 244137.021505376 & 2921.97849462367 \tabularnewline
18 & 255703 & 250017.521505376 & 5685.47849462366 \tabularnewline
19 & 260218 & 253867.021505376 & 6350.97849462366 \tabularnewline
20 & 268852 & 260261.521505376 & 8590.47849462367 \tabularnewline
21 & 279436 & 269644.521505376 & 9791.47849462366 \tabularnewline
22 & 281514 & 274072.521505376 & 7441.47849462367 \tabularnewline
23 & 285458 & 284004.965053763 & 1453.03494623657 \tabularnewline
24 & 288338 & 287247.465053763 & 1090.53494623657 \tabularnewline
25 & 296369 & 301181.634408602 & -4812.63440860222 \tabularnewline
26 & 302221 & 302734.967741935 & -513.967741935443 \tabularnewline
27 & 311016 & 308232.967741935 & 2783.03225806454 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4914&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]146290.661290322[/C][C]17123.3387096776[/C][/ROW]
[ROW][C]2[/C][C]163652[/C][C]147843.994623656[/C][C]15808.0053763441[/C][/ROW]
[ROW][C]3[/C][C]164603[/C][C]153341.994623656[/C][C]11261.0053763441[/C][/ROW]
[ROW][C]4[/C][C]165257[/C][C]168667.478494624[/C][C]-3410.47849462369[/C][/ROW]
[ROW][C]5[/C][C]168731[/C][C]171652.978494624[/C][C]-2921.97849462368[/C][/ROW]
[ROW][C]6[/C][C]171848[/C][C]177533.478494624[/C][C]-5685.47849462365[/C][/ROW]
[ROW][C]7[/C][C]175032[/C][C]181382.978494624[/C][C]-6350.97849462366[/C][/ROW]
[ROW][C]8[/C][C]179187[/C][C]187777.478494624[/C][C]-8590.47849462368[/C][/ROW]
[ROW][C]9[/C][C]187369[/C][C]197160.478494624[/C][C]-9791.47849462366[/C][/ROW]
[ROW][C]10[/C][C]194147[/C][C]201588.478494624[/C][C]-7441.47849462367[/C][/ROW]
[ROW][C]11[/C][C]200145[/C][C]201598.034946237[/C][C]-1453.03494623656[/C][/ROW]
[ROW][C]12[/C][C]203750[/C][C]204840.534946237[/C][C]-1090.53494623656[/C][/ROW]
[ROW][C]13[/C][C]206464[/C][C]218774.704301075[/C][C]-12310.7043010754[/C][/ROW]
[ROW][C]14[/C][C]205034[/C][C]220328.037634409[/C][C]-15294.0376344086[/C][/ROW]
[ROW][C]15[/C][C]211782[/C][C]225826.037634409[/C][C]-14044.0376344086[/C][/ROW]
[ROW][C]16[/C][C]244562[/C][C]241151.521505376[/C][C]3410.47849462368[/C][/ROW]
[ROW][C]17[/C][C]247059[/C][C]244137.021505376[/C][C]2921.97849462367[/C][/ROW]
[ROW][C]18[/C][C]255703[/C][C]250017.521505376[/C][C]5685.47849462366[/C][/ROW]
[ROW][C]19[/C][C]260218[/C][C]253867.021505376[/C][C]6350.97849462366[/C][/ROW]
[ROW][C]20[/C][C]268852[/C][C]260261.521505376[/C][C]8590.47849462367[/C][/ROW]
[ROW][C]21[/C][C]279436[/C][C]269644.521505376[/C][C]9791.47849462366[/C][/ROW]
[ROW][C]22[/C][C]281514[/C][C]274072.521505376[/C][C]7441.47849462367[/C][/ROW]
[ROW][C]23[/C][C]285458[/C][C]284004.965053763[/C][C]1453.03494623657[/C][/ROW]
[ROW][C]24[/C][C]288338[/C][C]287247.465053763[/C][C]1090.53494623657[/C][/ROW]
[ROW][C]25[/C][C]296369[/C][C]301181.634408602[/C][C]-4812.63440860222[/C][/ROW]
[ROW][C]26[/C][C]302221[/C][C]302734.967741935[/C][C]-513.967741935443[/C][/ROW]
[ROW][C]27[/C][C]311016[/C][C]308232.967741935[/C][C]2783.03225806454[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4914&T=4

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4914&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
1163414146290.66129032217123.3387096776
2163652147843.99462365615808.0053763441
3164603153341.99462365611261.0053763441
4165257168667.478494624-3410.47849462369
5168731171652.978494624-2921.97849462368
6171848177533.478494624-5685.47849462365
7175032181382.978494624-6350.97849462366
8179187187777.478494624-8590.47849462368
9187369197160.478494624-9791.47849462366
10194147201588.478494624-7441.47849462367
11200145201598.034946237-1453.03494623656
12203750204840.534946237-1090.53494623656
13206464218774.704301075-12310.7043010754
14205034220328.037634409-15294.0376344086
15211782225826.037634409-14044.0376344086
16244562241151.5215053763410.47849462368
17247059244137.0215053762921.97849462367
18255703250017.5215053765685.47849462366
19260218253867.0215053766350.97849462366
20268852260261.5215053768590.47849462367
21279436269644.5215053769791.47849462366
22281514274072.5215053767441.47849462367
23285458284004.9650537631453.03494623657
24288338287247.4650537631090.53494623657
25296369301181.634408602-4812.63440860222
26302221302734.967741935-513.967741935443
27311016308232.9677419352783.03225806454



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')