Home » date » 2010 » Nov » 27 »

Workshop 8 Regression Analysis of Time Series

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sat, 27 Nov 2010 11:39:05 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux.htm/, Retrieved Sat, 27 Nov 2010 12:37:37 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
24 18 17 25 24 25 18 18 17 25 17 16 18 18 17 18 20 16 18 18 18 16 20 16 18 16 18 16 20 16 20 17 18 16 20 16 23 17 18 16 18 30 23 17 18 17 23 30 23 17 23 18 23 30 23 30 15 18 23 30 23 12 15 18 23 18 21 12 15 18 15 15 21 12 15 12 20 15 21 12 21 31 20 15 21 15 27 31 20 15 20 34 27 31 20 31 21 34 27 31 27 31 21 34 27 34 19 31 21 34 21 16 19 31 21 31 20 16 19 31 19 21 20 16 19 16 22 21 20 16 20 17 22 21 20 21 24 17 22 21 22 25 24 17 22 17 26 25 24 17 24 25 26 25 24 25 17 25 26 25 26 32 17 25 26 25 33 32 17 25 17 13 33 32 17 32 32 13 33 32 33 25 32 13 33 13 29 25 32 13 32 22 29 25 32 25 18 22 29 25 29 17 18 22 29 22 20 17 18 22 18 15 20 17 18 17 20 15 20 17 20 33 20 15 20 15 29 33 20 15 20 23 29 33 20 33 26 23 29 33 29 18 26 23 29 23 20 18 26 23 26 11 20 18 26 18 28 11 20 18 20 26 28 11 20 11 22 26 28 11 28 17 22 26 28 26 12 17 22 26 22 14 12 17 22 17 17 14 12 17 12 21 17 14 12 14 19 21 17 14 17 18 19 21 17 21 10 18 19 21 19 29 10 18 19 18 31 29 10 18 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


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


Multiple Linear Regression - Estimated Regression Equation
Concernovermistakes[t] = -1.7562780158085e-14 + 1.53241564413974e-16Y1[t] -6.31065648645808e-18Y2[t] -1.77275820171837e-16Y3[t] + 1Y4[t] + 5.51714686945489e-16M1[t] + 8.53864962316541e-16M2[t] + 4.08923417553911e-16M3[t] + 5.83790269313932e-16M4[t] -4.12738543583127e-15M5[t] + 3.66459573819441e-16M6[t] + 1.39671603645796e-16M7[t] + 1.97031416598575e-16M8[t] + 7.66447169580341e-17M9[t] + 2.83259325707545e-17M10[t] + 1.64776501725111e-16M11[t] + 1.06828021625867e-17t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-1.7562780158085e-140-5.18831e-060
Y11.53241564413974e-1602.13250.034720.01736
Y2-6.31065648645808e-180-0.08790.9300690.465035
Y3-1.77275820171837e-160-2.47780.0144190.007209
Y4101387919676317484200
M15.51714686945489e-1600.28850.7733920.386696
M28.53864962316541e-1600.44740.6553090.327654
M34.08923417553911e-1600.21250.8320.416
M45.83790269313932e-1600.30310.762260.38113
M5-4.12738543583127e-150-2.13560.0344640.017232
M63.66459573819441e-1600.19080.8489240.424462
M71.39671603645796e-1600.07330.9416660.470833
M81.97031416598575e-1600.10350.9176970.458849
M97.66447169580341e-1700.04080.9675490.483774
M102.83259325707545e-1700.01480.9882070.494104
M111.64776501725111e-1600.08570.9318590.465929
t1.06828021625867e-1701.25390.2119950.105998


Multiple Linear Regression - Regression Statistics
Multiple R1
R-squared1
Adjusted R-squared1
F-TEST (value)1.38555603953635e+31
F-TEST (DF numerator)16
F-TEST (DF denominator)139
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.7694682348403e-15
Sum Squared Residuals3.16194798679795e-27


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
124243.8833668017645e-15
225254.45949864142709e-15
317179.24241541089069e-16
418184.61125481661534e-15
51818.0000000000001-5.2838819902124e-14
616161.42903065268707e-15
720201.36495432382927e-15
816168.62610667874181e-16
918185.385162280699e-16
1017171.14134724725819e-15
1123236.77059428648565e-16
1230301.44269847361675e-15
1323239.23376994723665e-16
1418183.57872526570919e-16
1515151.60625699562735e-15
161212-3.13768077881969e-16
1721214.58122455760425e-15
1815151.10819056724008e-15
192020-3.00412238663075e-16
2031314.18079129209161e-16
212727-6.59870099632231e-16
2234341.50838782343258e-15
2321215.74856950270073e-16
2431311.91725469604935e-16
2519193.97360753177649e-16
2616161.82846371929563e-16
2720207.58688484990028e-16
282121-8.25587317799867e-17
2922224.77556542915548e-15
3017177.7268116238042e-17
3124243.23872723740033e-16
3225257.1858264967758e-16
332626-2.65699034964752e-16
3425252.39564313396915e-16
3517176.77955131316204e-18
363232-4.23274989947867e-16
3733337.19464650024768e-16
3813132.21002884148810e-16
393232-1.08317613326465e-15
402525-4.26204267647754e-17
4129294.03430405574265e-15
4222221.92733860855692e-16
4318181.22093747056774e-15
4417175.42641586692203e-16
452020-3.17490407277616e-17
4615154.49681474651189e-16
4720206.17884216224246e-17
483333-4.99447296271356e-17
492929-2.30636069946821e-16
502323-4.93557801480265e-16
5126264.67131380782594e-16
521818-5.51391905569948e-16
5320204.82041746905647e-15
5411115.62837511020103e-16
5528284.43682276802976e-16
5626264.53580448336131e-16
5722228.16383967145096e-16
5817171.04003494524507e-15
5912121.21575771263536e-15
6014141.05530801366609e-15
6117172.58244596485335e-16
6221214.11103018301472e-16
631919-6.23213761956564e-16
641818-2.49544840487703e-16
6510105.08633773046969e-15
6629292.18274583820431e-16
673131-1.39537572062567e-16
6819197.60050037056527e-17
69992.07828696186418e-15
702020-4.24867113968091e-16
712828-4.95327202783598e-16
721919-2.56586669411225e-16
733030-2.94734700887257e-16
742929-2.24982440947062e-16
752626-1.54437400140707e-16
7623231.17018086590954e-16
7713134.59427953539157e-15
782121-2.78300564777496e-17
7919194.54335758518357e-16
802828-3.21432289026417e-16
8123232.8989312050447e-16
8218182.31657706169282e-16
8321211.05984757410361e-16
8420202.54946825848687e-16
852323-2.45313405579323e-17
862121-1.08898687193293e-15
8721211.91453368756590e-16
881515-1.26039559772029e-15
8928285.21634196147695e-15
901919-1.15787610935093e-16
912626-7.80520164552607e-16
9210107.45283462474208e-17
931616-6.85542411714772e-16
942222-4.17135619658525e-16
951919-5.58947702664968e-16
963131-2.48956073048628e-16
973131-1.37221574703373e-15
982929-1.14723453120047e-15
991919-2.08057630789501e-17
1002222-6.76818886995344e-16
10123234.47765782721385e-15
10215151.73801391999369e-16
1032020-2.42404276582120e-16
1041818-1.74542254220035e-16
1052323-5.0088390501433e-16
1062525-3.80313282769418e-16
1072121-2.37904433571677e-16
10824242.00275718784968e-16
1092525-1.91431027897035e-15
1101717-5.58342749060412e-16
1111313-1.40710916698716e-15
11228281.75995896134614e-16
11321214.03046582140411e-15
1142525-4.82354893085692e-16
115996.89065339052152e-16
1161616-2.40086398543306e-16
11719191.47893093936049e-17
1181717-5.9288506949058e-16
11925253.42323038189620e-16
1202020-5.80880133139499e-16
1212929-1.90678530886190e-16
1221414-4.23766047950214e-16
1232222-5.8728954152505e-16
1241515-3.19402314866737e-16
12519193.86754219561692e-15
1262020-1.92965636460651e-16
1271515-1.19521799753211e-15
1282020-1.01099848319274e-16
1291818-3.70971395359309e-16
1303333-3.75911377823661e-16
1312222-1.03332081491370e-16
13216166.10360191008753e-16
1331717-1.10274938207982e-15
1341616-1.36236237856146e-16
1352121-3.67959796887542e-16
1362626-6.25967858144466e-16
13718183.98524618749881e-15
1381818-1.09112738562669e-15
1391717-9.73264151218723e-16
1402222-7.98596428699453e-16
1413030-9.5286344792078e-16
1423030-1.28014199738019e-15
1432424-1.08402396967233e-15
1442121-7.67478554022456e-16
1452121-1.05195774581381e-15
1462929-1.55921676195035e-15
14731312.96219792594985e-16
1482020-7.81800159129695e-16
14916163.36943713149333e-15
1502222-1.85207110127491e-15
1512020-8.65491491899326e-16
1522828-1.51027061293384e-15
1533838-2.70290251643311e-16
1542222-1.13941904906277e-15
1552020-5.05014469905607e-16
1561717-1.42819354333347e-15


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
20001
210.7198569902060510.5602860195878970.280143009793949
220.6688704017773420.6622591964453160.331129598222658
230.9999999993995681.20086454992663e-096.00432274963313e-10
240.9981270241271030.003745951745793840.00187297587289692
250.624580340825710.750839318348580.37541965917429
260.003396989792859650.00679397958571930.99660301020714
279.9767331149575e-061.9953466229915e-050.999990023266885
280.001815940950455900.003631881900911790.998184059049544
2913.52060044205043e-421.76030022102521e-42
300.1152225418355530.2304450836711060.884777458164447
310.8945101541712210.2109796916575570.105489845828779
324.20093452951982e-078.40186905903964e-070.999999579906547
330.999166137847940.00166772430411970.00083386215205985
340.9039315198659180.1921369602681630.0960684801340816
353.50665838375945e-147.0133167675189e-140.999999999999965
360.003081441942471950.006162883884943890.996918558057528
370.9999526026675149.47946649724211e-054.73973324862106e-05
3812.51978653927511e-181.25989326963756e-18
390.9999993691938111.26161237711984e-066.30806188559922e-07
405.4032760369708e-081.08065520739416e-070.99999994596724
411.00468160381728e-502.00936320763456e-501
420.2425017333819110.4850034667638220.757498266618089
4312.02689835650921e-311.01344917825461e-31
441.31080341509135e-072.62160683018271e-070.999999868919659
451.68024958632601e-363.36049917265202e-361
4614.71401815579007e-472.35700907789503e-47
471.32996657080606e-122.65993314161213e-120.99999999999867
480.8588513068035980.2822973863928040.141148693196402
4911.61790360674534e-158.0895180337267e-16
500.4301768549851720.8603537099703440.569823145014828
511.91053786076928e-113.82107572153855e-110.999999999980895
520.9999999996385777.22845374287005e-103.61422687143502e-10
530.7129521084945490.5740957830109020.287047891505451
540.3073553186733530.6147106373467070.692644681326646
5512.73867528362786e-161.36933764181393e-16
5611.12434355453661e-175.62171777268305e-18
5711.52666504243120e-667.63332521215599e-67
580.998637905381460.002724189237079720.00136209461853986
590.0002830768534015140.0005661537068030280.999716923146599
6012.18763530392175e-201.09381765196088e-20
611.02792430928911e-292.05584861857822e-291
621.28437643878008e-112.56875287756016e-110.999999999987156
6312.37120455812057e-571.18560227906028e-57
640.3546642055720540.7093284111441090.645335794427946
650.01369502515538730.02739005031077460.986304974844613
663.09346679149556e-116.18693358299111e-110.999999999969065
670.9999999924844561.50310883626835e-087.51554418134173e-09
6811.02180632946562e-255.10903164732808e-26
690.01221805446546630.02443610893093260.987781945534534
700.9811043161765660.03779136764686850.0188956838234343
713.70882949261692e-127.41765898523383e-120.999999999996291
721.77388725673243e-053.54777451346485e-050.999982261127433
733.42208057123584e-236.84416114247167e-231
741.72198694246963e-153.44397388493927e-150.999999999999998
7513.77256458762366e-181.88628229381183e-18
760.01059939274458920.02119878548917830.98940060725541
770.003622208900528680.007244417801057370.996377791099471
781.89346081350575e-073.7869216270115e-070.999999810653919
790.3840768026482020.7681536052964040.615923197351798
800.03425756239393180.06851512478786360.965742437606068
811.64100341945322e-073.28200683890644e-070.999999835899658
820.9999999999999983.80363030273808e-151.90181515136904e-15
830.9842636393586050.0314727212827910.0157363606413955
840.902476693025790.195046613948420.09752330697421
850.01528734955052280.03057469910104550.984712650449477
8614.45540391287694e-222.22770195643847e-22
870.6387927140374680.7224145719250640.361207285962532
880.0003951117602994820.0007902235205989630.9996048882397
890.4198539473154910.8397078946309820.580146052684509
900.9994970276802320.001005944639536480.00050297231976824
9114.80783924920889e-212.40391962460444e-21
920.07901206521163070.1580241304232610.920987934788369
932.23324791439416e-234.46649582878832e-231
941.82338215052376e-413.64676430104752e-411
9514.38157791146543e-202.19078895573271e-20
960.9998862168703550.0002275662592902420.000113783129645121
9712.13189876735798e-361.06594938367899e-36
980.9257683726852050.1484632546295900.0742316273147949
9911.49716268527926e-207.48581342639629e-21
1002.41685087831017e-224.83370175662034e-221
1011.23616848682666e-062.47233697365332e-060.999998763831513
1020.9999999999966246.75230777931435e-123.37615388965717e-12
10311.60221162372101e-198.01105811860506e-20
10411.33355724651577e-186.66778623257883e-19
1050.006341294665475530.01268258933095110.993658705334524
1060.999999524097859.51804297828143e-074.75902148914072e-07
1070.003539032792356680.007078065584713360.996460967207643
1080.2577751650399600.5155503300799190.74222483496004
1092.37044670337765e-094.7408934067553e-090.999999997629553
1100.9999999994825081.03498362521580e-095.17491812607898e-10
1110.9997076061276770.0005847877446451870.000292393872322593
1120.1706232527766940.3412465055533880.829376747223306
1130.1619037429473640.3238074858947290.838096257052636
1140.951898302445590.09620339510882130.0481016975544106
1150.9999781688903964.36622192074711e-052.18311096037356e-05
1160.99999994020561.19588798993041e-075.97943994965203e-08
1170.999961644684847.67106303215058e-053.83553151607529e-05
1180.9999999999372761.25448972025979e-106.27244860129895e-11
1190.9999994175596361.16488072826451e-065.82440364132257e-07
1200.000878936902242040.001757873804484080.999121063097758
1210.9495469907369350.1009060185261300.0504530092630648
1220.999999669190956.61618098027346e-073.30809049013673e-07
1230.00918416318680710.01836832637361420.990815836813193
1240.9999999998121173.75766265532907e-101.87883132766454e-10
1250.9969594550853920.006081089829216750.00304054491460837
1260.1916309525663760.3832619051327510.808369047433624
1270.8982955057843870.2034089884312270.101704494215613
1280.993919878063490.01216024387301850.00608012193650925
1290.9999153730121270.0001692539757454558.46269878727273e-05
1300.9988779986672530.002244002665493130.00112200133274657
1310.9985832939541540.002833412091692870.00141670604584644
1320.9999999008149881.98370023309739e-079.91850116548697e-08
1330.998241876479660.00351624704067920.0017581235203396
1340.9334149842134130.1331700315731740.0665850157865868
1350.9710444371288810.05791112574223740.0289555628711187
1360.3559132207422790.7118264414845580.644086779257721


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level790.675213675213675NOK
5% type I error level880.752136752136752NOK
10% type I error level910.777777777777778NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/10c2p31290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/10c2p31290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/1yaad1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/1yaad1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/2yaad1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/2yaad1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/3yaad1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/3yaad1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/4rj9x1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/4rj9x1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/5rj9x1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/5rj9x1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/6rj9x1290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/6rj9x1290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/71s801290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/71s801290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/8c2p31290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/8c2p31290857931.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/9c2p31290857931.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290857846vmmtep45uqbavux/9c2p31290857931.ps (open in new window)


 
Parameters (Session):
par1 = 2 ; par2 = Include Monthly Dummies ; par3 = No 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)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
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))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
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')
qqline(mysum$resid)
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()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
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('http://www.xycoon.com/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<br />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<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />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')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by