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:43:06 +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/t1290858083p1mjn6l04jv0nfd.htm/, Retrieved Sat, 27 Nov 2010 12:41:26 +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/t1290858083p1mjn6l04jv0nfd.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 25 17 18 18 16 20 16 18 17 23 30 23 18 15 12 21 15 20 31 27 34 21 31 19 16 20 21 22 17 24 25 26 25 17 32 33 13 32 25 29 22 18 17 20 15 20 33 29 23 26 18 20 11 28 26 22 17 12 14 17 21 19 18 10 29 31 19 9 20 28 19 30 29 26 23 13 21 19 28 23 18 21 20 23 21 21 15 28 19 26 10 16 22 19 31 31 29 19 22 23 15 20 18 23 25 21 24 25 17 13 28 21 25 9 16 19 17 25 20 29 14 22 15 19 20 15 20 18 33 22 16 17 16 21 26 18 18 17 22 30 30 24 21 21 29 31 20 16 22 20 28 38 22 20 17 28 22 31
 
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'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Concernovermistakes[t] = + 23.2383107088989 + 1.26328736622854M1[t] -2.74211735976442M2[t] -1.31895065718595M3[t] -3.57214680744093M4[t] -3.80832076420312M5[t] -4.42911010558069M6[t] -3.12682252388135M7[t] -2.43991955756662M8[t] -1.44532428355958M9[t] -0.989190548014078M10[t] -2.68690296631473M11[t] + 0.00540472599296128t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)23.23831070889891.78663413.006800
M11.263287366228542.1983220.57470.5664060.283203
M2-2.742117359764422.198123-1.24750.2142180.107109
M3-1.318950657185952.197968-0.60010.5493850.274692
M4-3.572146807440932.23949-1.59510.1128590.056429
M5-3.808320764203122.239164-1.70080.0911140.045557
M6-4.429110105580692.238881-1.97830.049780.02489
M7-3.126822523881352.238642-1.39670.1646080.082304
M8-2.439919557566622.238446-1.090.2775060.138753
M9-1.445324283559582.238294-0.64570.519470.259735
M10-0.9891905480140782.238185-0.4420.6591710.329586
M11-2.686902966314732.238119-1.20050.2318820.115941
t0.005404725992961280.0098710.54750.5848490.292424


Multiple Linear Regression - Regression Statistics
Multiple R0.28522990922753
R-squared0.081356101117945
Adjusted R-squared0.00585112312763891
F-TEST (value)1.07749321016146
F-TEST (DF numerator)12
F-TEST (DF denominator)146
p-value0.383217157247469
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.70605193364234
Sum Squared Residuals4753.61818573583


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12424.5070028011204-0.507002801120426
22520.50700280112044.49299719887955
31721.9355742296919-4.93557422969187
41819.6877828054299-1.68778280542987
51819.4570135746606-1.45701357466063
61618.841628959276-2.84162895927602
72020.1493212669683-0.149321266968327
81620.841628959276-4.84162895927602
91821.841628959276-3.84162895927602
101722.3031674208145-5.30316742081448
112320.61085972850682.38914027149321
123023.30316742081456.69683257918552
132324.571859513036-1.57185951303598
141820.571859513036-2.57185951303598
151522.0004309416074-7.00043094160741
161219.7526395173454-7.7526395173454
172119.52187028657621.47812971342383
181518.9064856711916-3.90648567119155
192020.2141779788839-0.214177978883861
203120.906485671191610.0935143288084
212721.90648567119165.09351432880845
223422.3680241327311.63197586727
232120.67571644042230.324283559577677
243123.368024132737.63197586726998
251924.6367162249515-5.63671622495152
261620.6367162249515-4.63671622495152
272022.0652876535229-2.06528765352295
282119.81749622926091.18250377073906
292219.58672699849172.4132730015083
301718.9713423831071-1.97134238310709
312420.27903469079943.7209653092006
322520.97134238310714.02865761689291
332621.97134238310714.02865761689291
342522.43288084464562.56711915535445
351720.7405731523379-3.74057315233786
363223.43288084464568.56711915535445
373324.70157293686718.29842706313294
381320.7015729368671-7.70157293686705
393222.13014436543859.86985563456151
402519.88235294117655.11764705882353
412919.65158371040729.34841628959276
422219.03619909502262.96380090497738
431820.3438914027149-2.34389140271493
441721.0361990950226-4.03619909502263
452022.0361990950226-2.03619909502262
461522.4977375565611-7.49773755656109
472020.8054298642534-0.805429864253394
483323.49773755656119.50226244343891
492924.76642964878264.23357035121741
502320.76642964878262.23357035121741
512622.1950010773543.80499892264598
521819.947209653092-1.94720965309201
532019.71644042232280.283559577677225
541119.1010558069382-8.10105580693816
552820.40874811463057.59125188536953
562621.10105580693824.89894419306184
572222.1010558069382-0.101055806938159
581722.5625942684766-5.56259426847662
591220.8702865761689-8.87028657616893
601423.5625942684766-9.56259426847662
611724.8312863606981-7.83128636069813
622120.83128636069810.168713639301874
631922.2598577892696-3.25985778926955
641820.0120663650075-2.01206636500754
651019.7812971342383-9.78129713423831
662919.16591251885379.8340874811463
673120.47360482654610.526395173454
681921.1659125188537-2.16591251885369
69922.1659125188537-13.1659125188537
702022.6274509803922-2.62745098039216
712820.93514328808457.06485671191554
721923.6274509803922-4.62745098039216
733024.89614307261375.10385692738634
742920.89614307261378.10385692738634
752622.32471450118513.67528549881491
762320.07692307692312.92307692307692
771319.8461538461538-6.84615384615385
782119.23076923076921.76923076923077
791920.5384615384615-1.53846153846154
802821.23076923076926.76923076923077
812322.23076923076920.76923076923077
821822.6923076923077-4.69230769230769
8321213.2564351063781e-16
842023.6923076923077-3.69230769230769
852324.9609997845292-1.9609997845292
862120.96099978452920.0390002154708037
872122.3895712131006-1.38957121310062
881520.1417797888386-5.14177978883861
892819.91101055806948.08898944193062
901919.2956259426848-0.295625942684766
912620.60331825037715.39668174962293
921021.2956259426848-11.2956259426848
931622.2956259426848-6.29562594268477
942222.7571644042232-0.757164404223228
951921.0648567119155-2.06485671191554
963123.75716440422327.24283559577677
973125.02585649644475.97414350355527
982921.02585649644477.97414350355527
991922.4544279250162-3.45442792501616
1002220.20663650075411.79336349924585
1012319.97586726998493.02413273001508
1021519.3604826546003-4.3604826546003
1032020.6681749622926-0.668174962292609
1041821.3604826546003-3.3604826546003
1052322.36048265460030.639517345399699
1062522.82202111613882.17797888386124
1072121.1297134238311-0.129713423831071
1082423.82202111613880.177978883861235
1092525.0907132083603-0.0907132083602677
1101721.0907132083603-4.09071320836027
1111322.5192846369317-9.5192846369317
1122820.27149321266977.72850678733032
1132120.04072398190050.959276018099547
1142519.42533936651585.57466063348416
115920.7330316742081-11.7330316742081
1161621.4253393665158-5.42533936651584
1171922.4253393665158-3.42533936651584
1181722.8868778280543-5.8868778280543
1192521.19457013574663.80542986425339
1202023.8868778280543-3.8868778280543
1212925.15556992027583.8444300797242
1221421.1555699202758-7.1555699202758
1232222.5841413488472-0.58414134884723
1241520.3363499245852-5.33634992458522
1251920.105580693816-1.10558069381599
1262019.49019607843140.509803921568628
1271520.7978883861237-5.79788838612368
1282021.4901960784314-1.49019607843137
1291822.4901960784314-4.49019607843137
1303322.951734539969810.0482654600302
1312221.25942684766210.740573152337858
1321623.9517345399698-7.95173453996983
1331725.2204266321913-8.22042663219134
1341621.2204266321913-5.22042663219134
1352122.6489980607628-1.64899806076277
1362620.40120663650085.59879336349925
1371820.1704374057315-2.17043740573152
1381819.5550527903469-1.55505279034691
1391720.8627450980392-3.86274509803922
1402221.55505279034690.444947209653092
1413022.55505279034697.4449472096531
1423023.01659125188546.98340874811463
1432421.32428355957772.67571644042232
1442124.0165912518854-3.01659125188537
1452125.2852833441069-4.28528334410687
1462921.28528334410697.71471665589313
1473122.71385477267838.2861452273217
1482020.4660633484163-0.466063348416289
1491620.2352941176471-4.23529411764706
1502219.61990950226242.38009049773756
1512020.9276018099548-0.92760180995475
1522821.61990950226246.38009049773756
1533822.619909502262415.3800904977376
1542223.0814479638009-1.08144796380091
1552021.3891402714932-1.38914027149321
1561724.0814479638009-7.0814479638009
1572825.35014005602242.64985994397759
1582221.35014005602240.649859943977591
1593122.77871148459388.22128851540616


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
160.0565687891798080.1131375783596160.943431210820192
170.08396590286636230.1679318057327250.916034097133638
180.03675370365560190.07350740731120380.963246296344398
190.01660350692601120.03320701385202230.98339649307399
200.312585351259280.625170702518560.68741464874072
210.3286148626139420.6572297252278830.671385137386058
220.5835695504026580.8328608991946830.416430449597342
230.5125775574487160.9748448851025680.487422442551284
240.4350768539344050.8701537078688110.564923146065595
250.4356932326064430.8713864652128860.564306767393557
260.4254374509219410.8508749018438810.574562549078059
270.3632286031034670.7264572062069330.636771396896533
280.3198454469390390.6396908938780790.680154553060961
290.2534115456451710.5068230912903410.746588454354829
300.1962270708508560.3924541417017120.803772929149144
310.1535474152353080.3070948304706160.846452584764692
320.1154563250446780.2309126500893570.884543674955322
330.08638575701200440.1727715140240090.913614242987996
340.06475200707836230.1295040141567250.935247992921638
350.06553397806891050.1310679561378210.93446602193109
360.05346705863579910.1069341172715980.9465329413642
370.07937975078786820.1587595015757360.920620249212132
380.1154456975070340.2308913950140680.884554302492966
390.2259739251750370.4519478503500730.774026074824963
400.2075484123508790.4150968247017580.792451587649121
410.2157552766096960.4315105532193920.784244723390304
420.1788697102837970.3577394205675930.821130289716203
430.1825569456630550.3651138913261090.817443054336945
440.2333467049759810.4666934099519620.766653295024019
450.2245379529176250.449075905835250.775462047082375
460.3327341107623060.6654682215246130.667265889237694
470.2858862167369910.5717724334739830.714113783263009
480.2988102964962080.5976205929924160.701189703503792
490.2660599457068820.5321198914137650.733940054293118
500.229703268482850.45940653696570.77029673151715
510.2011733528030080.4023467056060150.798826647196992
520.1738607160987470.3477214321974940.826139283901253
530.1576771347227830.3153542694455660.842322865277217
540.1924007412257350.384801482451470.807599258774265
550.2075496220910390.4150992441820780.792450377908961
560.1897334305611070.3794668611222130.810266569438894
570.1612459585207490.3224919170414980.838754041479251
580.1707444086428890.3414888172857790.82925559135711
590.2242320229088980.4484640458177950.775767977091102
600.4609120739564590.9218241479129180.539087926043541
610.5014305250866170.9971389498267660.498569474913383
620.45381518799240.90763037598480.5461848120076
630.4152288042606610.8304576085213220.584771195739339
640.3696705552662060.7393411105324120.630329444733794
650.4664845519614290.9329691039228580.533515448038571
660.5954420787678560.8091158424642880.404557921232144
670.7016964649808540.5966070700382920.298303535019146
680.6682458475542260.6635083048915480.331754152445774
690.8183619169538240.3632761660923520.181638083046176
700.7891072173910010.4217855652179980.210892782608999
710.818227264174560.3635454716508810.181772735825441
720.8177122578938030.3645754842123940.182287742106197
730.8164666044843360.3670667910313290.183533395515664
740.8545936669320240.2908126661359520.145406333067976
750.8411383969734970.3177232060530050.158861603026503
760.8204185292014780.3591629415970440.179581470798522
770.82789180572460.34421638855080.1721081942754
780.799732914680830.4005341706383390.200267085319169
790.7767359515332970.4465280969334060.223264048466703
800.809604318584410.3807913628311820.190395681415591
810.7767377669082980.4465244661834050.223262233091702
820.7593945934975280.4812108130049450.240605406502472
830.7197659700180040.5604680599639920.280234029981996
840.6991786990077660.6016426019844680.300821300992234
850.657209179418880.6855816411622410.34279082058112
860.6121663804469440.7756672391061110.387833619553056
870.5646568261454220.8706863477091560.435343173854578
880.5494093168107120.9011813663785770.450590683189288
890.6156106735462390.7687786529075230.384389326453761
900.5673805890841390.8652388218317220.432619410915861
910.6246036865667030.7507926268665940.375396313433297
920.7178463028691080.5643073942617840.282153697130892
930.7285482207796030.5429035584407950.271451779220397
940.6888737952200880.6222524095598240.311126204779912
950.6466870120534250.706625975893150.353312987946575
960.7431035187634440.5137929624731110.256896481236556
970.777891527307270.4442169453854590.22210847269273
980.8585325361706610.2829349276586780.141467463829339
990.8321005714386370.3357988571227250.167899428561363
1000.8033941028503350.3932117942993310.196605897149665
1010.8049573252774460.3900853494451080.195042674722554
1020.7813168608594010.4373662782811980.218683139140599
1030.7907533047618720.4184933904762560.209246695238128
1040.7549716645877160.4900566708245680.245028335412284
1050.7135011138895010.5729977722209980.286498886110499
1060.6778812208463510.6442375583072980.322118779153649
1070.6299411566294330.7401176867411340.370058843370567
1080.6638938422117420.6722123155765150.336106157788258
1090.6418551965041050.7162896069917890.358144803495895
1100.5995031641378370.8009936717243260.400496835862163
1110.6686974552879730.6626050894240550.331302544712027
1120.7600179129265610.4799641741468790.239982087073439
1130.7599349846009130.4801300307981730.240065015399087
1140.804048531435980.3919029371280390.195951468564019
1150.8263038591849720.3473922816300570.173696140815028
1160.8014280051313520.3971439897372960.198571994868648
1170.7922123556419310.4155752887161380.207787644358069
1180.8166422457415840.3667155085168330.183357754258416
1190.8148526024959420.3702947950081160.185147397504058
1200.808800081930460.3823998361390790.191199918069539
1210.8889959879687980.2220080240624040.111004012031202
1220.8738175262990020.2523649474019950.126182473700997
1230.8373104087836270.3253791824327460.162689591216373
1240.8201259495205160.3597481009589680.179874050479484
1250.7995898587390280.4008202825219440.200410141260972
1260.7605692808524710.4788614382950570.239430719147529
1270.7092241365552410.5815517268895190.290775863444759
1280.6463844365574220.7072311268851560.353615563442578
1290.8203310206480160.3593379587039690.179668979351984
1300.8978813961703470.2042372076593060.102118603829653
1310.869181159672490.2616376806550190.13081884032751
1320.8299942961866910.3400114076266180.170005703813309
1330.8049245211517040.3901509576965920.195075478848296
1340.8204827419050180.3590345161899640.179517258094982
1350.8883964034493210.2232071931013570.111603596550679
1360.8804851765983690.2390296468032620.119514823401631
1370.8268843242758710.3462313514482580.173115675724129
1380.7693506710280980.4612986579438050.230649328971902
1390.6906217191153860.6187565617692280.309378280884614
1400.670097739426810.659804521146380.32990226057319
1410.787931922864370.4241361542712610.21206807713563
1420.7617356497866740.4765287004266530.238264350213326
1430.6265153087565560.7469693824868880.373484691243444


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level10.0078125OK
10% type I error level20.015625OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/10inx91290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/10inx91290858170.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/24dhi1290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/24dhi1290858170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/34dhi1290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/34dhi1290858170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/44dhi1290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/44dhi1290858170.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/54dhi1290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/54dhi1290858170.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/9qeg61290858170.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290858083p1mjn6l04jv0nfd/9qeg61290858170.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