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 10:42:44 +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/t1290855198v7wn7cjdbuegvx1.htm/, Retrieved Sat, 27 Nov 2010 11:53:18 +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/t1290855198v7wn7cjdbuegvx1.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 «
0 24 18 17 25 24 0 25 18 18 17 25 0 17 16 18 18 17 0 18 20 16 18 18 0 18 16 20 16 18 0 16 18 16 20 16 1 20 17 18 16 20 1 16 23 17 18 16 1 18 30 23 17 18 1 17 23 30 23 17 1 23 18 23 30 23 1 30 15 18 23 30 1 23 12 15 18 23 1 18 21 12 15 18 1 15 15 21 12 15 1 12 20 15 21 12 1 21 31 20 15 21 1 15 27 31 20 15 1 20 34 27 31 20 1 31 21 34 27 31 1 27 31 21 34 27 1 34 19 31 21 34 1 21 16 19 31 21 1 31 20 16 19 31 1 19 21 20 16 19 1 16 22 21 20 16 1 20 17 22 21 20 1 21 24 17 22 21 1 22 25 24 17 22 1 17 26 25 24 17 1 24 25 26 25 24 1 25 17 25 26 25 1 26 32 17 25 26 1 25 33 32 17 25 1 17 13 33 32 17 1 32 32 13 33 32 1 33 25 32 13 33 1 13 29 25 32 13 1 32 22 29 25 32 1 25 18 22 29 25 1 29 17 18 22 29 1 22 20 17 18 22 1 18 15 20 17 18 1 17 20 15 20 17 1 20 33 20 15 20 1 15 29 33 20 15 1 20 23 29 33 20 1 33 26 23 29 33 1 29 18 26 23 29 1 23 20 18 26 23 1 26 11 20 18 26 1 18 28 11 20 18 1 20 26 28 11 20 1 11 22 26 28 11 1 28 17 22 26 28 1 26 12 17 22 26 1 22 14 12 17 22 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 time7 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Concernovermistakes[t] = + 4.33736380419233e-15 + 4.81096972513162e-16Month[t] -3.92793744225778e-17Y1[t] -9.27473958819082e-19Y2[t] + 3.88904353136391e-17Y3[t] + 1Y4[t] -1.70376654484216e-16M1[t] -5.54509482764853e-16M2[t] -9.08004524329228e-18M3[t] -2.60528232216317e-16M4[t] -1.29360887914371e-16M5[t] + 1.12553726951424e-15M6[t] -8.79059136696996e-17M7[t] -1.41501096448634e-17M8[t] -1.30646741044540e-17M9[t] -6.23166389836798e-18M10[t] -6.08428066208678e-17M11[t] + 5.40177177391998e-19t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)4.33736380419233e-1504.03239.1e-054.5e-05
Month4.81096972513162e-1600.76340.446510.223255
Y1-3.92793744225778e-170-1.87330.0631430.031572
Y2-9.27473958819082e-190-0.04430.9647110.482356
Y33.88904353136391e-1701.87060.0635140.031757
Y4104768139114217092800
M1-1.70376654484216e-160-0.30610.7600140.380007
M2-5.54509482764853e-160-0.99880.3196540.159827
M3-9.08004524329228e-180-0.01620.9870780.493539
M4-2.60528232216317e-160-0.46510.6426260.321313
M5-1.29360887914371e-160-0.230.8184030.409201
M61.12553726951424e-1502.01360.0459910.022995
M7-8.79059136696996e-170-0.15880.8740550.437027
M8-1.41501096448634e-170-0.02560.9796220.489811
M9-1.30646741044540e-170-0.02390.9809560.490478
M10-6.23166389836798e-180-0.01120.991070.495535
M11-6.08428066208678e-170-0.10890.9134570.456729
t5.40177177391998e-1900.20660.8366470.418323


Multiple Linear Regression - Regression Statistics
Multiple R1
R-squared1
Adjusted R-squared1
F-TEST (value)1.54517351998080e+32
F-TEST (DF numerator)17
F-TEST (DF denominator)138
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.38557140118381e-15
Sum Squared Residuals2.64933518873427e-28


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12424-2.78094059747395e-15
22525-5.44714417592349e-15
31717-2.01448003217992e-15
41818-1.7943206687792e-15
51818-1.57896630058888e-15
616161.36158517749454e-14
72020-2.4478968431953e-17
81616-8.46447071885983e-17
91818-2.68307640627034e-17
1017173.51969071087913e-16
1123234.99225403250177e-17
123030-5.61826983878747e-18
1323231.40333193223468e-16
1418185.33143587853054e-16
1515151.82638529136962e-16
161212-8.51858151853435e-16
1721211.81118321402488e-16
181515-1.04089927418583e-15
1920208.68905365056777e-18
2031313.47496035037068e-16
212727-1.13452929414819e-16
223434-5.50880610228876e-16
232121-9.71782431739475e-18
2431319.17633345953578e-16
2519198.43840323396218e-17
2616165.26304722939423e-16
272020-3.62912457502288e-17
2821212.26000606975311e-16
2922221.46014318373566e-16
301717-8.85755180766048e-16
3124242.0634761352151e-16
322525-1.06699073102561e-17
3326261.37569879571892e-16
3425255.15667977205782e-16
351717-3.88671715746905e-16
3632321.28119388090600e-16
3733331.02795875827333e-15
381313-3.42218429605079e-16
3932321.09737859358912e-15
4025251.04960409331134e-16
4129293.43433662851039e-16
422222-1.21414505957499e-15
4318181.5089066713289e-17
441717-3.13077709770149e-16
4520201.08050016981271e-16
461515-1.04081508716525e-16
4720205.09053783649207e-18
483333-6.77037633318002e-16
4929293.68067243443831e-16
5023234.98267311043623e-16
5126261.13318664533623e-16
5218189.31828040949922e-17
5320201.69084539323079e-16
541111-2.12878628330826e-15
5528284.26759859098182e-16
5626261.59311257385769e-16
572222-1.57219973663983e-16
581717-1.61647669356920e-16
591212-1.84620810963793e-16
6014146.40032183300908e-17
611717-6.15011814537011e-17
6221214.55532419548847e-16
631919-8.36028461202848e-17
6418183.88113574062394e-16
6510105.91577161141298e-16
662929-1.06906215125811e-15
673131-7.5063682824846e-16
6819196.04293256070635e-17
69994.88884811762555e-16
7020201.27472036042820e-17
7128285.46016154890493e-16
721919-2.55729487632415e-16
7330303.36958093962252e-16
7429299.06404860375698e-16
752626-1.73045490530319e-16
7623232.95788714469433e-16
771313-1.70010252802666e-16
782121-1.11035905897941e-15
791919-4.71865114392251e-16
8028284.58691108479861e-16
812323-7.72871081408e-17
821818-2.34977002703771e-16
832121-7.92588078710189e-18
842020-4.85071415000544e-17
8523236.83122950647613e-17
8621215.45382382229961e-16
872121-2.18347577674226e-17
8815152.69955455374532e-16
8928283.42923458570385e-16
901919-1.24108549708277e-15
912626-1.44917472855324e-16
9210101.03529877900149e-16
931616-5.42192531619658e-18
9422221.31492329628296e-16
9519196.40113184927074e-19
963131-3.55325421319847e-16
9731316.23812709347345e-16
9829294.48511133579407e-16
9919199.84447519529594e-17
10022221.48369455405961e-16
10123231.04731215327645e-16
1021515-8.59833885976098e-16
10320206.33790964851763e-17
1041818-2.71566352542206e-16
10523232.68150174574504e-17
1062525-6.14068629333672e-17
1072121-1.43426824572586e-16
1082424-1.42195573198322e-16
10925253.20463263584223e-16
11017174.7112536615509e-16
11113135.92914009493947e-16
1122828-6.11174322028575e-17
11321217.49775751255453e-18
1142525-8.74233210476791e-16
115993.39519703089174e-16
1161616-4.09828560671594e-16
1171919-9.16329035510778e-17
11817173.82742557934268e-17
1192525-4.30716349444372e-17
12020207.15992127035986e-17
1212929-5.1868985404184e-17
12214145.66921273093873e-16
1232222-1.22009360869701e-16
12415153.80033168658979e-16
1251919-2.47443652875655e-16
1262020-1.21950205589789e-15
12715157.61879902482564e-17
1282020-5.13770929980642e-17
1291818-4.04998578851904e-16
13033331.13200315996529e-16
1312222-1.83329097340802e-17
1321616-1.95515497446614e-17
13317173.668292203444e-17
13416162.26004814267807e-16
1352121-2.26424014672734e-16
13626266.55826290334703e-16
13718181.97902654658564e-16
1381818-1.13369043987919e-15
13917171.98166970567537e-16
1402222-1.40985703105475e-16
14130304.11908593277208e-16
14230307.1452167182175e-17
14324241.52980013478875e-16
14421212.86925867748572e-17
1452121-1.12661746941434e-16
14629296.11764734441782e-16
14731315.92993199184e-16
14820201.45065774128054e-16
1491616-8.78628828934185e-17
1502222-8.38499677560063e-16
15120205.77590305542974e-17
15228281.52692429176434e-16
1533838-2.96384136048891e-16
1542222-1.21809666558945e-16
15520204.11182413504902e-17
15617172.93917324699361e-16


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
210.2068419550841780.4136839101683570.793158044915822
220.02550921427167690.05101842854335380.974490785728323
230.0009141398955988380.001828279791197680.999085860104401
240.5511909132844170.8976181734311660.448809086715583
250.2251217595985060.4502435191970120.774878240401494
260.5786811396673220.8426377206653550.421318860332678
270.2979094151649300.5958188303298610.70209058483507
280.9994141495892090.001171700821582410.000585850410791205
290.001539568537318180.003079137074636360.998460431462682
300.9965910235865850.006817952826829170.00340897641341458
310.7385639841833680.5228720316332640.261436015816632
320.1031803417480930.2063606834961850.896819658251907
330.001242895246290150.002485790492580310.99875710475371
340.9999999999939231.21537480974356e-116.07687404871778e-12
355.28070883448708e-091.05614176689742e-080.999999994719291
360.9999973731453445.25370931236236e-062.62685465618118e-06
370.9997669873970030.0004660252059943680.000233012602997184
380.9999998194141363.61171728434097e-071.80585864217048e-07
390.7959788763218150.408042247356370.204021123678185
402.22655301779770e-134.45310603559539e-130.999999999999777
4114.14290176542556e-232.07145088271278e-23
420.9999999985579852.88403028222329e-091.44201514111164e-09
430.9999920808372381.58383255238316e-057.91916276191582e-06
441.02483858173577e-172.04967716347153e-171
450.9917568274395420.01648634512091610.00824317256045803
460.6438617816753540.7122764366492920.356138218324646
472.28922427369592e-114.57844854739184e-110.999999999977108
480.9819761516468660.03604769670626740.0180238483531337
4912.44895399295222e-181.22447699647611e-18
500.9999998164853163.67029368241721e-071.83514684120860e-07
511.88402911278289e-133.76805822556578e-130.999999999999812
520.6139792132612560.7720415734774870.386020786738744
5311.61813139544665e-228.09065697723325e-23
540.2270565992155080.4541131984310170.772943400784492
550.0004230396477455540.0008460792954911080.999576960352254
560.7501386786971420.4997226426057160.249861321302858
5718.49365991134985e-194.24682995567493e-19
580.0001563907741747030.0003127815483494070.999843609225825
590.9999979188800174.16223996615922e-062.08111998307961e-06
602.92553019764412e-145.85106039528825e-140.99999999999997
610.9999423036636380.0001153926727246685.76963363623342e-05
620.9493633318512450.1012733362975100.0506366681487549
6312.10139163948217e-171.05069581974108e-17
644.68505334131025e-139.3701066826205e-130.999999999999531
650.9712803686109260.05743926277814780.0287196313890739
664.69648456370865e-079.3929691274173e-070.999999530351544
6711.21334710116660e-156.06673550583302e-16
6811.65716920747794e-268.2858460373897e-27
690.9999999999999491.02082481185954e-135.1041240592977e-14
7011.22556126608179e-156.12780633040893e-16
710.9474512590848630.1050974818302740.0525487409151371
729.82834652398156e-050.0001965669304796310.99990171653476
730.9928960248261780.01420795034764310.00710397517382154
740.9802644057675630.03947118846487420.0197355942324371
750.48489802842550.9697960568510.5151019715745
7613.04543037262142e-181.52271518631071e-18
7712.84687396344597e-231.42343698172299e-23
780.9505428008358020.09891439832839670.0494571991641983
790.9999983996334883.20073302433972e-061.60036651216986e-06
806.91688856797636e-050.0001383377713595270.99993083111432
814.73581449547768e-179.47162899095536e-171
823.24575045190729e-066.49150090381458e-060.999996754249548
830.9999999979674234.06515438636585e-092.03257719318293e-09
847.06944636455816e-081.41388927291163e-070.999999929305536
850.05859855837281930.1171971167456390.94140144162718
860.9999999895039182.09921632854160e-081.04960816427080e-08
876.85725137498871e-231.37145027499774e-221
889.3406292849308e-191.86812585698616e-181
895.53929991970288e-311.10785998394058e-301
900.6659520265770530.6680959468458950.334047973422947
910.9688105433505450.06237891329890930.0311894566494546
9213.34942337992808e-221.67471168996404e-22
9311.5766323499981e-167.8831617499905e-17
946.31164627924881e-081.26232925584976e-070.999999936883537
957.25712029610782e-081.45142405922156e-070.999999927428797
960.3822780636556820.7645561273113630.617721936344318
973.23923282284857e-066.47846564569713e-060.999996760767177
980.9349344252843270.1301311494313470.0650655747156733
990.999999999644657.107003654379e-103.5535018271895e-10
1003.70982890130601e-107.41965780261202e-100.999999999629017
1011.90055733742099e-173.80111467484199e-171
1020.9999999999999862.73986276952842e-141.36993138476421e-14
1030.9999686975867036.26048265938539e-053.13024132969270e-05
1040.9999996630012286.73997544312305e-073.36998772156153e-07
1056.93245230224467e-071.38649046044893e-060.99999930675477
1060.02069456422001520.04138912844003040.979305435779985
1070.99819913007370.003601739852598840.00180086992629942
1080.02057331362968210.04114662725936410.979426686370318
1092.60434156736602e-125.20868313473204e-120.999999999997396
1100.9999997832405324.33518935334193e-072.16759467667096e-07
1110.9999999997161865.67628644800374e-102.83814322400187e-10
1120.6291001654099960.7417996691800080.370899834590004
1133.48237828773776e-176.96475657547553e-171
1140.3995372314964520.7990744629929040.600462768503548
1152.46118888690497e-154.92237777380994e-150.999999999999998
1160.9999996033006057.93398790176333e-073.96699395088166e-07
1175.79651192877356e-091.15930238575471e-080.999999994203488
1180.9996076623858020.0007846752283965370.000392337614198269
1190.2598041822354210.5196083644708410.74019581776458
1200.999999657362246.8527551854046e-073.4263775927023e-07
1211.32309440786696e-082.64618881573392e-080.999999986769056
1222.80323653304202e-145.60647306608404e-140.999999999999972
1230.0001439354111759260.0002878708223518520.999856064588824
1240.8159814386909220.3680371226181560.184018561309078
1250.999987122534552.57549309014078e-051.28774654507039e-05
1260.1261490228111290.2522980456222580.873850977188871
1270.3685227793760360.7370455587520710.631477220623964
1280.6250344764882230.7499310470235550.374965523511777
1293.43678136196854e-126.87356272393708e-120.999999999996563
1300.9999836087216243.27825567518656e-051.63912783759328e-05
1310.06736337459637840.1347267491927570.932636625403622
1320.3719326477885360.7438652955770710.628067352211464
1330.4421567741239730.8843135482479460.557843225876027
1340.4003249031150780.8006498062301560.599675096884922
1350.9945423938172150.01091521236557000.00545760618278501


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level740.643478260869565NOK
5% type I error level810.704347826086957NOK
10% type I error level850.739130434782609NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290855198v7wn7cjdbuegvx1/10f26c1290854553.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290855198v7wn7cjdbuegvx1/10f26c1290854553.ps (open in new window)


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290855198v7wn7cjdbuegvx1/7mt791290854553.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290855198v7wn7cjdbuegvx1/7mt791290854553.ps (open in new window)


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


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


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