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 09:22:21 +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/t1290849729mi2309dns4hlm31.htm/, Retrieved Sat, 27 Nov 2010 10:22:20 +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/t1290849729mi2309dns4hlm31.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 time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Concernovermistakes[t] = + 23.2383107088989 + 1.26328736622854M1[t] -2.74211735976439M2[t] -1.31895065718594M3[t] -3.5721468074409M4[t] -3.8083207642031M5[t] -4.42911010558068M6[t] -3.12682252388133M7[t] -2.43991955756661M8[t] -1.44532428355956M9[t] -0.989190548014066M10[t] -2.68690296631471M11[t] + 0.00540472599296133t + 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.742117359764392.198123-1.24750.2142180.107109
M3-1.318950657185942.197968-0.60010.5493850.274692
M4-3.57214680744092.23949-1.59510.1128590.056429
M5-3.80832076420312.239164-1.70080.0911140.045557
M6-4.429110105580682.238881-1.97830.049780.02489
M7-3.126822523881332.238642-1.39670.1646080.082304
M8-2.439919557566612.238446-1.090.2775060.138753
M9-1.445324283559562.238294-0.64570.519470.259735
M10-0.9891905480140662.238185-0.4420.6591710.329586
M11-2.686902966314712.238119-1.20050.2318820.115941
t0.005404725992961330.0098710.54750.5848490.292424


Multiple Linear Regression - Regression Statistics
Multiple R0.285229909227530
R-squared0.0813561011179448
Adjusted R-squared0.0058511231276388
F-TEST (value)1.07749321016146
F-TEST (DF numerator)12
F-TEST (DF denominator)146
p-value0.383217157247471
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.5070028011206-0.507002801120587
22520.50700280112044.49299719887957
31721.9355742296919-4.93557422969188
41819.6877828054298-1.68778280542985
51819.4570135746607-1.45701357466066
61618.841628959276-2.84162895927602
72020.1493212669683-0.149321266968339
81620.841628959276-4.84162895927602
91821.841628959276-3.84162895927600
101722.3031674208145-5.30316742081448
112320.61085972850682.38914027149322
123023.30316742081456.6968325791855
132324.5718595130360-1.57185951303597
141820.571859513036-2.57185951303599
151522.0004309416074-7.00043094160741
161219.7526395173454-7.7526395173454
172119.52187028657621.47812971342383
181518.9064856711916-3.90648567119155
192020.2141779788839-0.21417797888386
203120.906485671191610.0935143288084
212721.90648567119165.09351432880845
223422.3680241327311.6319758672700
232120.67571644042230.324283559577679
243123.368024132737.63197586727
251924.6367162249515-5.63671622495151
261620.6367162249515-4.63671622495152
272022.0652876535229-2.06528765352294
282119.81749622926091.18250377073907
292219.58672699849172.4132730015083
301718.9713423831071-1.97134238310709
312420.27903469079943.72096530920060
322520.97134238310714.02865761689292
332621.97134238310714.02865761689291
342522.43288084464552.56711915535445
351720.7405731523379-3.74057315233786
363223.43288084464558.56711915535446
373324.70157293686708.29842706313296
381320.7015729368671-7.70157293686706
393222.13014436543859.86985563456152
402519.88235294117655.11764705882353
412919.65158371040729.34841628959276
422219.03619909502262.96380090497738
431820.3438914027149-2.34389140271493
441721.0361990950226-4.03619909502262
452022.0361990950226-2.03619909502262
461522.4977375565611-7.49773755656108
472020.8054298642534-0.805429864253393
483323.49773755656119.50226244343892
492924.76642964878264.23357035121742
502320.76642964878262.23357035121740
512622.1950010773543.80499892264598
521819.947209653092-1.94720965309201
532019.71644042232280.283559577677226
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.56259426847661
611724.8312863606981-7.83128636069812
622120.83128636069810.168713639301869
631922.2598577892695-3.25985778926955
641820.0120663650075-2.01206636500754
651019.7812971342383-9.7812971342383
662919.16591251885379.8340874811463
673120.47360482654610.526395173454
681921.1659125188537-2.16591251885369
69922.1659125188537-13.1659125188537
702022.6274509803922-2.62745098039216
712820.93514328808457.06485671191554
721923.6274509803921-4.62745098039214
733024.89614307261375.10385692738635
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.769230769230769
821822.6923076923077-4.69230769230769
832121-1.1518563880486e-15
842023.6923076923077-3.69230769230768
852324.9609997845292-1.96099978452919
862120.96099978452920.0390002154707971
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.757164404223229
951921.0648567119155-2.06485671191554
963123.75716440422327.24283559577678
973125.02585649644475.97414350355528
982921.02585649644477.97414350355526
991922.4544279250162-3.45442792501616
1002220.20663650075421.79336349924585
1012319.97586726998493.02413273001508
1021519.3604826546003-4.3604826546003
1032020.6681749622926-0.668174962292612
1041821.3604826546003-3.3604826546003
1052322.36048265460030.639517345399697
1062522.82202111613882.17797888386124
1072121.1297134238311-0.129713423831073
1082423.82202111613880.177978883861245
1092525.0907132083603-0.090713208360257
1101721.0907132083603-4.09071320836027
1111322.5192846369317-9.5192846369317
1122820.27149321266977.72850678733031
1132120.04072398190050.959276018099546
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.88687782805429
1212925.15556992027583.84443007972420
1221421.1555699202758-7.15556992027581
1232222.5841413488472-0.584141348847231
1241520.3363499245852-5.33634992458522
1251920.105580693816-1.10558069381599
1262019.49019607843140.509803921568626
1271520.7978883861237-5.79788838612368
1282021.4901960784314-1.49019607843137
1291822.4901960784314-4.49019607843137
1303322.951734539969810.0482654600302
1312221.25942684766210.740573152337855
1321623.9517345399698-7.95173453996983
1331725.2204266321913-8.22042663219133
1341621.2204266321913-5.22042663219135
1352122.6489980607628-1.64899806076277
1362620.40120663650085.59879336349924
1371820.1704374057315-2.17043740573152
1381819.5550527903469-1.55505279034691
1391720.8627450980392-3.86274509803922
1402221.55505279034690.44494720965309
1413022.55505279034697.4449472096531
1423023.01659125188546.98340874811463
1432421.32428355957772.67571644042232
1442124.0165912518854-3.01659125188536
1452125.2852833441069-4.28528334410686
1462921.28528334410697.71471665589312
1473122.71385477267838.2861452273217
1482020.4660633484163-0.466063348416294
1491620.2352941176471-4.23529411764706
1502219.61990950226242.38009049773755
1512020.9276018099548-0.927601809954756
1522821.61990950226246.38009049773756
1533822.619909502262415.3800904977376
1542223.0814479638009-1.08144796380091
1552021.3891402714932-1.38914027149322
1561724.0814479638009-7.0814479638009
1572825.35014005602242.6498599439776
1582221.35014005602240.649859943977581
1593122.77871148459388.22128851540616


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
160.05656878917980830.1131375783596170.943431210820192
170.08396590286636240.1679318057327250.916034097133638
180.03675370365560180.07350740731120370.963246296344398
190.01660350692601130.03320701385202260.983396493073989
200.312585351259280.625170702518560.68741464874072
210.3286148626139420.6572297252278830.671385137386058
220.5835695504026580.8328608991946830.416430449597342
230.5125775574487160.9748448851025680.487422442551284
240.4350768539344050.870153707868810.564923146065595
250.4356932326064440.8713864652128880.564306767393556
260.425437450921940.850874901843880.57456254907806
270.3632286031034680.7264572062069350.636771396896532
280.3198454469390400.6396908938780810.68015455306096
290.2534115456451710.5068230912903430.746588454354829
300.1962270708508570.3924541417017130.803772929149143
310.1535474152353070.3070948304706140.846452584764693
320.1154563250446780.2309126500893570.884543674955321
330.08638575701200450.1727715140240090.913614242987995
340.06475200707836260.1295040141567250.935247992921637
350.06553397806891080.1310679561378220.934466021931089
360.05346705863579960.1069341172715990.9465329413642
370.07937975078786760.1587595015757350.920620249212132
380.1154456975070340.2308913950140690.884554302492966
390.2259739251750370.4519478503500740.774026074824963
400.2075484123508790.4150968247017570.792451587649121
410.2157552766096950.4315105532193910.784244723390304
420.1788697102837960.3577394205675930.821130289716204
430.1825569456630540.3651138913261090.817443054336946
440.2333467049759820.4666934099519640.766653295024018
450.2245379529176250.449075905835250.775462047082375
460.3327341107623070.6654682215246140.667265889237693
470.2858862167369890.5717724334739770.714113783263011
480.2988102964962080.5976205929924150.701189703503792
490.2660599457068830.5321198914137650.733940054293117
500.229703268482850.45940653696570.77029673151715
510.2011733528030070.4023467056060130.798826647196993
520.1738607160987470.3477214321974930.826139283901253
530.1576771347227820.3153542694455630.842322865277218
540.1924007412257350.384801482451470.807599258774265
550.207549622091040.415099244182080.79245037790896
560.1897334305611070.3794668611222130.810266569438893
570.1612459585207490.3224919170414990.83875404147925
580.1707444086428890.3414888172857790.82925559135711
590.2242320229088980.4484640458177960.775767977091102
600.460912073956460.921824147912920.53908792604354
610.5014305250866170.9971389498267660.498569474913383
620.45381518799240.90763037598480.5461848120076
630.4152288042606610.8304576085213220.584771195739339
640.3696705552662060.7393411105324110.630329444733794
650.4664845519614280.9329691039228570.533515448038572
660.5954420787678570.8091158424642870.404557921232143
670.7016964649808540.5966070700382920.298303535019146
680.6682458475542270.6635083048915460.331754152445773
690.8183619169538230.3632761660923540.181638083046177
700.7891072173910020.4217855652179970.210892782608998
710.818227264174560.3635454716508810.181772735825440
720.81771225789380.3645754842123980.182287742106199
730.8164666044843360.3670667910313280.183533395515664
740.8545936669320240.2908126661359510.145406333067976
750.8411383969734980.3177232060530040.158861603026502
760.8204185292014790.3591629415970420.179581470798521
770.82789180572460.34421638855080.1721081942754
780.7997329146808290.4005341706383420.200267085319171
790.7767359515332990.4465280969334030.223264048466701
800.8096043185844090.3807913628311820.190395681415591
810.7767377669082990.4465244661834030.223262233091701
820.7593945934975270.4812108130049470.240605406502473
830.7197659700180040.5604680599639930.280234029981996
840.6991786990077670.6016426019844660.300821300992233
850.657209179418880.685581641162240.34279082058112
860.6121663804469440.7756672391061110.387833619553056
870.5646568261454230.8706863477091530.435343173854577
880.5494093168107110.9011813663785770.450590683189288
890.6156106735462390.7687786529075220.384389326453761
900.5673805890841370.8652388218317260.432619410915863
910.6246036865667040.7507926268665920.375396313433296
920.7178463028691090.5643073942617820.282153697130891
930.7285482207796030.5429035584407940.271451779220397
940.6888737952200870.6222524095598260.311126204779913
950.6466870120534260.7066259758931490.353312987946574
960.7431035187634440.5137929624731110.256896481236556
970.777891527307270.4442169453854590.222108472692729
980.8585325361706610.2829349276586770.141467463829339
990.8321005714386380.3357988571227230.167899428561361
1000.8033941028503340.3932117942993320.196605897149666
1010.8049573252774450.390085349445110.195042674722555
1020.7813168608594020.4373662782811970.218683139140598
1030.7907533047618720.4184933904762550.209246695238128
1040.7549716645877160.4900566708245680.245028335412284
1050.7135011138895010.5729977722209970.286498886110499
1060.677881220846350.64423755830730.32211877915365
1070.6299411566294340.7401176867411320.370058843370566
1080.6638938422117420.6722123155765170.336106157788258
1090.6418551965041060.7162896069917880.358144803495894
1100.5995031641378370.8009936717243260.400496835862163
1110.6686974552879730.6626050894240540.331302544712027
1120.7600179129265610.4799641741468790.239982087073439
1130.7599349846009140.4801300307981720.240065015399086
1140.804048531435980.3919029371280390.195951468564020
1150.8263038591849720.3473922816300560.173696140815028
1160.8014280051313530.3971439897372940.198571994868647
1170.7922123556419320.4155752887161370.207787644358068
1180.8166422457415850.366715508516830.183357754258415
1190.8148526024959420.3702947950081160.185147397504058
1200.8088000819304610.3823998361390770.191199918069539
1210.8889959879687980.2220080240624040.111004012031202
1220.8738175262990020.2523649474019960.126182473700998
1230.8373104087836270.3253791824327470.162689591216373
1240.8201259495205160.3597481009589690.179874050479484
1250.7995898587390270.4008202825219450.200410141260973
1260.7605692808524720.4788614382950560.239430719147528
1270.7092241365552390.5815517268895220.290775863444761
1280.6463844365574230.7072311268851540.353615563442577
1290.8203310206480150.359337958703970.179668979351985
1300.8978813961703470.2042372076593060.102118603829653
1310.869181159672490.261637680655020.13081884032751
1320.8299942961866910.3400114076266180.170005703813309
1330.8049245211517050.390150957696590.195075478848295
1340.8204827419050180.3590345161899640.179517258094982
1350.8883964034493210.2232071931013570.111603596550678
1360.8804851765983690.2390296468032620.119514823401631
1370.8268843242758710.3462313514482580.173115675724129
1380.7693506710280980.4612986579438040.230649328971902
1390.6906217191153860.6187565617692280.309378280884614
1400.670097739426810.659804521146380.32990226057319
1410.787931922864370.424136154271260.21206807713563
1420.7617356497866740.4765287004266510.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/t1290849729mi2309dns4hlm31/105bdw1290849728.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290849729mi2309dns4hlm31/105bdw1290849728.ps (open in new window)


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


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


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/27/t1290849729mi2309dns4hlm31/95bdw1290849728.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t1290849729mi2309dns4hlm31/95bdw1290849728.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
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