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:26:04 +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/t12908537073v177t2hu0fme6d.htm/, Retrieved Sat, 27 Nov 2010 11:28:29 +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/t12908537073v177t2hu0fme6d.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 0 25 0 17 0 18 0 18 0 16 1 20 1 16 1 18 1 17 1 23 1 30 1 23 1 18 1 15 1 12 1 21 1 15 1 20 1 31 1 27 1 34 1 21 1 31 1 19 1 16 1 20 1 21 1 22 1 17 1 24 1 25 1 26 1 25 1 17 1 32 1 33 1 13 1 32 1 25 1 29 1 22 1 18 1 17 1 20 1 15 1 20 1 33 1 29 1 23 1 26 1 18 1 20 1 11 1 28 1 26 1 22 1 17 1 12 1 14 1 17 1 21 1 19 1 18 1 10 1 29 1 31 1 19 1 9 1 20 1 28 1 19 1 30 1 29 1 26 1 23 1 13 1 21 1 19 1 28 1 23 1 18 1 21 1 20 1 23 1 21 1 21 1 15 1 28 1 19 1 26 1 10 1 16 1 22 1 19 1 31 1 31 1 29 1 19 1 22 1 23 1 15 1 20 1 18 1 23 1 25 1 21 1 24 1 25 1 17 1 13 1 28 1 21 1 25 1 9 1 16 1 19 1 17 1 25 1 20 1 29 1 14 1 22 1 15 1 19 1 20 1 15 1 20 1 18 1 33 1 22 1 16 1 17 1 16 1 21 1 26 1 18 1 18 1 17 1 22 1 30 1 30 1 24 1 21 1 21 1 29 1 31 1 20 1 16 1 22 1 20 1 28 1 38 1 22 1 20 1 17 1 28 1 22 1 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] = + 21.995337995338 + 1.40151515151515Month[t] + 1.35395854145854M1[t] -2.64955877455878M2[t] -1.22450466200466M3[t] -3.47943722943723M4[t] -3.71372377622378M5[t] -4.33262570762571M6[t] -3.13625957375957M7[t] -2.4474691974692M8[t] -1.45098651348651M9[t] -0.992965367965368M10[t] -2.68879037629038M11[t] + 0.00351731601731602t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)21.9953379953382.8995287.585800
Month1.401515151515152.5711520.54510.5865280.293264
M11.353958541458542.2099020.61270.5410490.270524
M2-2.649558774558782.209966-1.19890.2325170.116259
M3-1.224504662004662.21008-0.55410.5803950.290198
M4-3.479437229437232.251334-1.54550.1244050.062203
M5-3.713723776223782.251272-1.64960.1011870.050594
M6-4.332625707625712.251259-1.92450.0562460.028123
M7-3.136259573759572.244117-1.39750.1643840.082192
M8-2.44746919746922.243896-1.09070.2772040.138602
M9-1.450986513486512.243725-0.64670.5188570.259429
M10-0.9929653679653682.243603-0.44260.6587320.329366
M11-2.688790376290382.243529-1.19850.2326910.116346
t0.003517316017316020.0104830.33550.7377190.36886


Multiple Linear Regression - Regression Statistics
Multiple R0.288504216420314
R-squared0.0832346828922996
Adjusted R-squared0.001041930324023
F-TEST (value)1.01267666906711
F-TEST (DF numerator)13
F-TEST (DF denominator)145
p-value0.442297652472542
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.71983678896478
Sum Squared Residuals4743.89726939727


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12423.35281385281380.64718614718616
22519.35281385281395.64718614718614
31720.7813852813853-3.78138528138528
41818.52997002997-0.529970029970031
51818.2992007992008-0.299200799200804
61617.6838161838162-1.68381618381619
72020.2852147852148-0.285214785214788
81620.9775224775225-4.97752247752248
91821.9775224775225-3.97752247752247
101722.4390609390609-5.43906093906094
112320.74675324675322.25324675324675
123023.43906093906096.56093906093906
132324.7965367965368-1.7965367965368
141820.7965367965368-2.7965367965368
151522.2251082251082-7.22510822510823
161219.973692973693-7.97369297369297
172119.74292374292371.25707625707626
181519.1275391275391-4.12753912753913
192020.3274225774226-0.327422577422577
203121.01973026973039.98026973026973
212722.01973026973034.98026973026973
223422.481268731268711.5187312687313
232120.7889610389610.211038961038961
243123.48126873126877.51873126873127
251924.8387445887446-5.83874458874459
261620.8387445887446-4.83874458874459
272022.267316017316-2.26731601731602
282120.01590076590080.984099234099234
292219.78513153513152.21486846486846
301719.1697469197469-2.16974691974692
312420.36963036963043.63036963036963
322521.06193806193813.93806193806194
332622.06193806193813.93806193806194
342522.52347652347652.47652347652348
351720.8311688311688-3.83116883116883
363223.52347652347658.47652347652348
373324.88095238095248.11904761904762
381320.8809523809524-7.88095238095239
393222.30952380952389.69047619047619
402520.05810855810864.94189144189144
412919.82733932733939.17266067266068
422219.21195471195472.78804528804529
431820.4118381618382-2.41183816183816
441721.1041458541459-4.10414585414585
452022.1041458541459-2.10414585414585
461522.5656843156843-7.56568431568432
472020.8733766233766-0.873376623376624
483323.56568431568439.43431568431568
492924.92316017316024.07683982683982
502320.92316017316022.07683982683983
512622.35173160173163.6482683982684
521820.1003163503164-2.10031635031635
532019.86954711954710.13045288045288
541119.2541625041625-8.2541625041625
552820.4540459540467.54595404595405
562621.14635364635364.85364635364635
572222.1463536463536-0.146353646353647
581722.6078921078921-5.60789210789211
591220.9155844155844-8.91558441558442
601423.6078921078921-9.60789210789211
611724.965367965368-7.96536796536797
622120.9653679653680.0346320346320345
631922.3939393939394-3.39393939393939
641820.1425241425241-2.14252414252414
651019.9117549117549-9.9117549117549
662919.29637029637039.7036297036297
673120.496253746253710.5037462537463
681921.1885614385614-2.18856143856144
69922.1885614385614-13.1885614385614
702022.6500999000999-2.6500999000999
712820.95779220779227.0422077922078
721923.6500999000999-4.6500999000999
733025.00757575757584.99242424242424
742921.00757575757587.99242424242424
752622.43614718614723.56385281385281
762320.18473193473192.81526806526806
771319.9539627039627-6.9539627039627
782119.33857808857811.66142191142191
791920.5384615384615-1.53846153846154
802821.23076923076926.76923076923077
812322.23076923076920.769230769230769
821822.6923076923077-4.69230769230769
832121-5.43117525779457e-17
842023.6923076923077-3.69230769230769
852325.0497835497836-2.04978354978355
862121.0497835497835-0.0497835497835497
872122.478354978355-1.47835497835498
881520.2269397269397-5.22693972693973
892819.99617049617058.0038295038295
901919.3807858807859-0.380785880785881
912620.58066933066935.41933066933067
921021.272977022977-11.272977022977
931622.272977022977-6.27297702297702
942222.7345154845155-0.734515484515485
951921.0422077922078-2.04220779220779
963123.73451548451557.26548451548451
973125.09199134199135.90800865800866
982921.09199134199137.90800865800866
991922.5205627705628-3.52056277056277
1002220.26914751914751.73085248085248
1012320.03837828837832.96162171162171
1021519.4229936729937-4.42299367299367
1032020.6228771228771-0.622877122877123
1041821.3151848151848-3.31518481518482
1052322.31518481518480.684815184815185
1062522.77672327672332.22327672327672
1072121.0844155844156-0.0844155844155845
1082423.77672327672330.223276723276723
1092525.1341991341991-0.134199134199135
1101721.1341991341991-4.13419913419913
1111322.5627705627706-9.56277056277056
1122820.31135531135537.68864468864469
1132120.08058608058610.91941391941392
1142519.46520146520155.53479853479854
115920.6650849150849-11.6650849150849
1161621.3573926073926-5.35739260739261
1171922.3573926073926-3.35739260739261
1181722.8189310689311-5.81893106893107
1192521.12662337662343.87337662337663
1202023.8189310689311-3.81893106893107
1212925.17640692640693.82359307359307
1221421.1764069264069-7.17640692640693
1232222.6049783549784-0.604978354978355
1241520.3535631035631-5.3535631035631
1251920.1227938727939-1.12279387279387
1262019.50740925740930.492590742590742
1271520.7072927072927-5.70729270729271
1282021.3996003996004-1.3996003996004
1291822.3996003996004-4.3996003996004
1303322.861138861138910.1388611388611
1312221.16883116883120.831168831168831
1321623.8611388611389-7.86113886113886
1331725.2186147186147-8.21861471861472
1341621.2186147186147-5.21861471861472
1352122.6471861471861-1.64718614718615
1362620.39577089577095.6042291042291
1371820.1650016650017-2.16500166500167
1381819.549617049617-1.54961704961705
1391720.7495004995005-3.7495004995005
1402221.44180819180820.558191808191808
1413022.44180819180827.5581918081918
1423022.90334665334677.09665334665335
1432421.2110389610392.78896103896104
1442123.9033466533467-2.90334665334665
1452125.2608225108225-4.26082251082251
1462921.26082251082257.73917748917749
1473122.68939393939398.31060606060606
1482020.4379786879787-0.437978687978688
1491620.2072094572095-4.20720945720946
1502219.59182484182482.40817515817516
1512020.7917082917083-0.791708291708292
1522821.4840159840166.51598401598402
1533822.48401598401615.515984015984
1542222.9455544455544-0.945554445554446
1552021.2532467532468-1.25324675324675
1561723.9455544455544-6.94555444555444
1572825.30303030303032.6969696969697
1582221.30303030303030.696969696969697
1593122.73160173160178.26839826839827


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
170.1860182455973830.3720364911947660.813981754402617
180.08719650621020430.1743930124204090.912803493789796
190.03555637948631270.07111275897262550.964443620513687
200.146828135592670.2936562711853410.85317186440733
210.0852108640090950.170421728018190.914789135990905
220.1110053068677160.2220106137354320.888994693132284
230.1988819590775440.3977639181550880.801118040922456
240.1849105387795790.3698210775591570.815089461220421
250.247646620668560.495293241337120.75235337933144
260.2804495158546070.5608990317092130.719550484145393
270.2178213197678510.4356426395357030.782178680232149
280.174944158395840.3498883167916810.82505584160416
290.1259387737157230.2518775474314460.874061226284277
300.08942307228959980.17884614457920.9105769277104
310.06431444726376890.1286288945275380.935685552736231
320.05168321685810260.1033664337162050.948316783141897
330.03572991171932720.07145982343865450.964270088280673
340.03119842620409370.06239685240818740.968801573795906
350.0449192716899920.0898385433799840.955080728310008
360.03628672121165590.07257344242331180.963713278788344
370.05160555943949310.1032111188789860.948394440560507
380.08894689546552440.1778937909310490.911053104534476
390.1767434740068250.353486948013650.823256525993175
400.1565897915021450.313179583004290.843410208497855
410.1587165558855760.3174331117711520.841283444114424
420.1266604983483420.2533209966966850.873339501651658
430.1552360099134090.3104720198268190.84476399008659
440.2308571815271330.4617143630542660.769142818472867
450.2331795349668630.4663590699337250.766820465033137
460.3568371994479410.7136743988958810.643162800552059
470.3092322226901820.6184644453803640.690767777309818
480.3213009144002070.6426018288004130.678699085599793
490.2862926477871650.5725852955743290.713707352212835
500.2474208758257990.4948417516515990.7525791241742
510.2166468781934440.4332937563868880.783353121806556
520.1881357123635960.3762714247271910.811864287636404
530.1712073779209090.3424147558418180.828792622079091
540.2076187426514550.4152374853029110.792381257348544
550.219974393886240.4399487877724810.78002560611376
560.2001201437452620.4002402874905240.799879856254738
570.1715748700316240.3431497400632470.828425129968376
580.1831077672182340.3662155344364680.816892232781766
590.2385360828834870.4770721657669730.761463917116513
600.4722391657212880.9444783314425760.527760834278712
610.5101043458317490.9797913083365030.489895654168251
620.4623789262743080.9247578525486160.537621073725692
630.4226502055637640.8453004111275280.577349794436236
640.3763242872689610.7526485745379210.623675712731039
650.4702699391243610.9405398782487230.529730060875639
660.5998192441681030.8003615116637940.400180755831897
670.7071937871749760.5856124256500480.292806212825024
680.6724724579401780.6550550841196450.327527542059822
690.8164420702325770.3671158595348450.183557929767423
700.7863316373412290.4273367253175420.213668362658771
710.817870524375340.3642589512493210.182129475624661
720.8148040870634870.3703918258730250.185195912936513
730.8137663142539210.3724673714921570.186233685746079
740.8524121647285470.2951756705429060.147587835271453
750.8387788681449730.3224422637100550.161221131855027
760.8178088033262740.3643823933474520.182191196673726
770.8243916332096930.3512167335806140.175608366790307
780.7957521739589790.4084956520820430.204247826041021
790.7708920615650090.4582158768699810.229107938434991
800.8048351251629850.390329749674030.195164874837015
810.7716945443273230.4566109113453540.228305455672677
820.7529267123493960.4941465753012080.247073287650604
830.7125926384627580.5748147230744830.287407361537242
840.6896625019551710.6206749960896580.310337498044829
850.64658742536480.7068251492704010.353412574635201
860.600761836922440.798476326155120.39923816307756
870.5524486083469040.8951027833061930.447551391653096
880.5360912743003610.9278174513992780.463908725699639
890.602519543792020.794960912415960.39748045620798
900.5535563839642990.8928872320714030.446443616035701
910.6109288353347180.7781423293305650.389071164665282
920.7010563762889690.5978872474220630.298943623711031
930.7100593978904880.5798812042190240.289940602109512
940.6693323969609660.6613352060780690.330667603039034
950.6255046034588450.7489907930823110.374495396541155
960.7247729413521920.5504541172956170.275227058647808
970.7605792207378190.4788415585243620.239420779262181
980.8448323401156530.3103353197686930.155167659884347
990.8163009729138630.3673980541722740.183699027086137
1000.7858201898230910.4283596203538180.214179810176909
1010.7869651710184740.4260696579630510.213034828981526
1020.7614152601447250.477169479710550.238584739855275
1030.7699359247388370.4601281505223270.230064075261163
1040.7311247675037070.5377504649925850.268875232496293
1050.6880081616394850.6239836767210290.311991838360515
1060.651409531626030.6971809367479410.348590468373971
1070.601819313727420.796361372545160.39818068627258
1080.6349583721402190.7300832557195620.365041627859781
1090.6114725551332940.7770548897334110.388527444866706
1100.5672338006683740.8655323986632520.432766199331626
1110.6361322693798130.7277354612403740.363867730620187
1120.7307282491341470.5385435017317060.269271750865853
1130.729716589331610.540566821336780.27028341066839
1140.7760218070214490.4479563859571030.223978192978551
1150.7973479173939480.4053041652121040.202652082606052
1160.7686493363549430.4627013272901140.231350663645057
1170.7574974378278410.4850051243443180.242502562172159
1180.7824682068906210.4350635862187570.217531793109379
1190.7803046984847580.4393906030304850.219695301515242
1200.7717865126457490.4564269747085020.228213487354251
1210.861251708851840.2774965822963210.13874829114816
1220.8425818448911560.3148363102176880.157418155108844
1230.7999854681366540.4000290637266910.200014531863345
1240.7792050792486690.4415898415026630.220794920751331
1250.7548037087843040.4903925824313910.245196291215696
1260.7103011716092160.5793976567815690.289698828390784
1270.6521432049501050.6957135900997890.347856795049894
1280.5839591735191730.8320816529616540.416040826480827
1290.7701701774311370.4596596451377250.229829822568863
1300.8611609939063040.2776780121873920.138839006093696
1310.8246182924182210.3507634151635580.175381707581779
1320.7751926196661970.4496147606676070.224807380333803
1330.7429332537993740.5141334924012520.257066746200626
1340.7573880244318140.4852239511363720.242611975568186
1350.8364706664071290.3270586671857420.163529333592871
1360.8227227850658460.3545544298683080.177277214934154
1370.7511275611363960.4977448777272070.248872438863604
1380.6762972197553880.6474055604892250.323702780244612
1390.5791036759291080.8417926481417840.420896324070892
1400.5450791096961020.9098417806077960.454920890303898
1410.6609768054077950.6780463891844090.339023194592205
1420.6050593110316940.7898813779366130.394940688968306


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


http://www.freestatistics.org/blog/date/2010/Nov/27/t12908537073v177t2hu0fme6d/10hcs1290853552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t12908537073v177t2hu0fme6d/10hcs1290853552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/27/t12908537073v177t2hu0fme6d/20hcs1290853552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/27/t12908537073v177t2hu0fme6d/20hcs1290853552.ps (open in new window)


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


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


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


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


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


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


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


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