Home » date » 2010 » Dec » 15 »

*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: Wed, 15 Dec 2010 19:10:17 +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/Dec/15/t1292440157coib27v6fm69xgr.htm/, Retrieved Wed, 15 Dec 2010 20:09: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/Dec/15/t1292440157coib27v6fm69xgr.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 «
4 0 5 5 0 4 6 0 5 6 0 6 6 0 6 7 0 6 8 0 7 7 0 8 8 0 7 7 0 8 8 0 7 8 0 8 9 0 8 9 0 9 8 0 9 9 0 8 9 0 9 10 0 9 11 0 10 12 0 11 13 0 12 13 0 13 13 0 13 14 0 13 14 0 14 15 0 14 15 0 15 16 0 15 16 0 16 17 0 16 18 0 17 19 0 18 20 0 19 22 0 20 20 0 22 22 0 20 25 0 22 24 0 25 25 0 24 28 0 25 26 0 28 27 0 26 26 0 27 25 0 26 27 0 25 28 0 27 30 0 28 31 0 30 32 0 31 34 0 32 34 0 34 33 0 34 32 0 33 34 0 32 36 0 34 37 0 36 40 0 37 38 0 40 38 0 38 36 0 38 40 0 36 40 0 40 42 0 40 44 0 42 45 0 44 47 0 45 49 0 47 47 0 49 49 0 47 52 0 49 50 0 52 50 0 50 57 0 50 58 0 57 58 0 58 58 0 58 61 0 58 61 0 61 64 0 61 68 0 64 40 0 68 34 0 40 46 0 34 36 0 46 34 0 36 45 0 34 55 0 45 50 0 55 56 0 50 72 0 56 76 0 72 78 0 76 77 0 78 90 0 77 88 0 90 97 0 88 93 0 97 84 0 93 67 0 84 72 0 67 75 0 72 71 0 75 75 0 71 90 0 75 78 0 90 73 0 78 62 0 73 65 0 62 61 0 65 58 0 61 33 0 58 39 0 33 56 0 39 79 0 56 82 0 79 79 0 82 73 0 79 87 0 7 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time8 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
CO2-uitstoot[t] = + 0.0424296098248327 -5.07184841354021`Kyoto-protocol`[t] + 0.851676438315116`Y-1`[t] + 0.112139788243898t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.04242960982483270.9385340.04520.9639940.481997
`Kyoto-protocol`-5.071848413540213.214778-1.57770.116490.058245
`Y-1`0.8516764383151160.04000721.288400
t0.1121397882438980.0317213.53520.0005240.000262


Multiple Linear Regression - Regression Statistics
Multiple R0.988522052468713
R-squared0.977175848216957
Adjusted R-squared0.976775424501465
F-TEST (value)2440.3545804382
F-TEST (DF numerator)3
F-TEST (DF denominator)171
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation6.00814902705278
Sum Squared Residuals6172.73315904807


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
144.41295158964428-0.412951589644282
253.673414939573061.32658506042694
364.637231166131991.36276883386801
465.60104739269110.398952607308896
565.7131871809350.286812819064998
675.82532696917891.1746730308211
786.789143195737921.21085680426208
877.75295942229693-0.752959422296928
987.013422772225710.986577227774287
1077.97723899878472-0.977238998784724
1187.237702348713510.762297651286491
1288.20151857527252-0.20151857527252
1398.313658363516420.686341636483582
1499.27747459007544-0.277474590075435
1589.38961437831933-1.38961437831933
1698.650077728248110.349922271751888
1799.61389395480713-0.613893954807129
18109.726033743051030.273966256948972
191110.689849969610.310150030389961
201211.65366619616910.346333803830944
211312.61748242272810.382517577271932
221313.5812986492871-0.581298649287079
231313.693438437531-0.693438437530977
241413.80557822577490.194421774225125
251414.7693944523339-0.769394452333892
261514.88153424057780.11846575942221
271515.8453504671368-0.845350467136801
281615.95749025538070.0425097446193007
291616.9213064819397-0.921306481939717
301717.0334462701836-0.0334462701836146
311817.99726249674260.00273750325737411
321918.96107872330160.0389212766983568
332019.92489494986070.0751050501393455
342220.88871117641971.11128882358033
352022.7042038412938-2.7042038412938
362221.11299075290750.887009247092532
372522.92848341778162.07151658221841
382425.5956525209708-1.59565252097084
392524.85611587089960.143884129100383
402825.81993209745862.18006790254137
412628.4871012006479-2.48710120064788
422726.89588811226150.104111887738456
432627.8597043388206-1.85970433882056
442527.1201676887493-2.12016768874934
452726.38063103867810.619368961321879
462828.1961237035522-0.196123703552249
473029.15993993011130.840060069888737
483130.97543259498540.0245674050146054
493231.93924882154440.0607511784555911
503432.90306504810341.09693495189658
513434.7185577129775-0.718557712977551
523334.8306975012215-1.83069750122145
533234.0911608511502-2.09116085115023
543433.3516242010790.648375798920985
553635.16711686595310.832883134046858
563736.98260953082730.0173904691727267
574037.94642575738632.05357424261371
583840.6135948605755-2.61359486057553
593839.0223817721892-1.0223817721892
603639.1345215604331-3.1345215604331
614037.54330847204682.45669152795324
624041.0621540135511-1.06215401355113
634241.1742938017950.825706198204974
644442.98978646666921.01021353333084
654544.80527913154330.194720868456715
664745.76909535810231.2309046418977
674947.58458802297641.41541197702357
684749.4000806878506-2.40008068785056
694947.80886759946421.19113240053578
705249.62436026433842.37563973566165
715052.2915293675276-2.2915293675276
725050.7003162791413-0.700316279141265
735750.81245606738526.18754393261484
745856.88633092383491.11366907616513
755857.85014715039390.149852849606112
765857.96228693863780.037713061362214
776158.07442672688172.92557327311832
786160.74159583007090.25840416992907
796460.85373561831483.14626438168517
806863.52090472150414.47909527849593
814067.0397502630084-27.0397502630084
823443.3049497784291-9.30494977842909
834638.30703093678237.69296906321771
843648.6392879848076-12.6392879848076
853440.2346633899003-6.23466338990031
864538.6434503015146.35654969848602
875548.12403091122426.87596908877585
885056.7529350826192-6.75293508261921
895652.60669267928753.39330732071247
907257.828891097422114.1711089025779
917671.56785389870794.43214610129213
927875.08669944021222.91330055978776
937776.90219210508640.0978078949136302
949076.162655455015213.8373445449848
958887.34658894135550.653411058644447
969785.755375852969211.2446241470308
979393.5326035860492-0.532603586049171
988490.2380376210326-6.2380376210326
996782.6850894644405-15.6850894644405
1007268.31872980132743.68127019867262
1017572.68925178114692.31074821885314
1027175.3564208843361-4.35642088433611
1037572.06185491931952.93814508068047
1049075.580700460823914.4192995391761
1057888.4679868237945-10.4679868237945
1067378.360009352257-5.36000935225705
1076274.2137669489254-12.2137669489254
1086564.9574659157030.0425340842970153
1096167.6246350188922-6.62463501889223
1105864.3300690538757-6.33006905387566
1113361.8871795271742-28.8871795271742
1123940.7074083575402-1.70740835754021
1135645.929606775674810.0703932243252
1147960.520246015275718.4797539847243
1158280.22094388476721.77905611523276
1167982.8881129879565-3.88811298795648
1177380.445223461255-7.44522346125504
1188775.447304619608211.5526953803918
1198587.4829145442638-2.48291454426376
1208385.8917014558774-2.89170145587743
1218284.300488367491-2.30048836749109
1228383.5609517174199-0.560951717419872
1239284.52476794397897.47523205602111
1249592.30199567705882.69800432294116
1259794.9691647802482.03083521975192
1268796.7846574451222-9.7846574451222
1278488.380032850215-4.38003285021494
1288485.9371433235135-1.93714332351349
1298986.04928311175742.95071688824261
13010390.419805091576912.5801949084231
131106102.4554150162323.5445849837676
132109105.1225841194223.87741588057836
133106107.789753222611-1.78975322261089
134105105.346863695909-0.346863695909438
135115104.60732704583810.3926729541618
136120113.2362312172336.76376878276672
137124117.6067531970536.39324680294725
138121121.125598738557-0.125598738557119
139131118.68270921185612.3172907881443
140139127.31161338325111.6883866167493
141133134.237164678016-1.23716467801554
142119129.239245836369-10.2392458363687
143123117.4279154882015.57208451179897
144120120.946761029705-0.946761029705388
145128118.5038715030049.49612849699606
146134125.4294227977698.57057720223125
147126130.651621215903-4.65162121590336
148115123.950349497626-8.95034949762632
149106114.694048464404-8.69404846440395
15099107.141100307812-8.1411003078118
151100101.29150502785-1.29150502784989
15299102.255321254409-3.25532125440891
15399101.515784604338-2.51578460433769
154100101.627924392582-1.62792439258158
155100102.591740619141-2.5917406191406
156108102.7038804073855.2961195926155
157109109.629431702149-0.629431702149322
158115110.5932479287084.40675207129167
159114115.815446346843-1.81544634684293
160108115.075909696772-7.07590969677171
161113110.0779908551252.92200914487509
162118114.4485128349443.55148716505561
163122118.8190348147643.18096518523613
164118122.337880356268-4.33788035626822
165121119.0433143912521.95668560874834
166118121.710483494441-3.7104834944409
167121119.2675939677391.73240603226054
168121121.934763070929-0.934763070928698
169112122.046902859173-10.0469028591726
170119114.493954702584.50604529741954
171116120.56782955903-4.56782955903017
172110113.053091618789-3.05309161878851
173111108.0551727771422.94482722285829
174106109.018989003701-3.01898900370073
175108104.8727466003693.12725339963095


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.0008218300969848140.001643660193969630.999178169903015
80.000158812402381480.000317624804762960.999841187597619
91.89381812833468e-053.78763625666936e-050.999981061818717
101.25029840413732e-052.50059680827465e-050.99998749701596
111.84311609912246e-063.68623219824493e-060.999998156883901
122.61305492100515e-075.22610984201029e-070.999999738694508
132.74277774161488e-085.48555548322977e-080.999999972572223
142.69047186175295e-095.3809437235059e-090.999999997309528
151.60805828469912e-093.21611656939825e-090.999999998391942
161.94899343336464e-103.89798686672927e-100.9999999998051
172.62446243821172e-115.24892487642345e-110.999999999973755
182.84860917108138e-125.69721834216275e-120.999999999997151
196.36555091011624e-131.27311018202325e-120.999999999999363
203.02005667864535e-136.0401133572907e-130.999999999999698
211.40187875012143e-132.80375750024285e-130.99999999999986
221.68689201221631e-143.37378402443261e-140.999999999999983
231.84447719755587e-153.68895439511173e-150.999999999999998
243.44143229705924e-166.88286459411848e-161
253.66480563605496e-177.32961127210993e-171
266.47997226914037e-181.29599445382807e-171
276.75611243594189e-191.35122248718838e-181
281.14109064245456e-192.28218128490911e-191
291.16873117847802e-202.33746235695604e-201
301.8976619747484e-213.7953239494968e-211
313.5764135842975e-227.15282716859501e-221
326.97321815696626e-231.39464363139325e-221
331.26083974038722e-232.52167948077443e-231
341.30932598127292e-232.61865196254583e-231
354.72260564544272e-239.44521129088543e-231
363.004223867798e-236.008447735596e-231
372.31857484277915e-224.63714968555829e-221
385.93207523129173e-231.18641504625835e-221
391.04775510905661e-232.09551021811322e-231
403.49294976565681e-236.98589953131362e-231
413.74962883141827e-237.49925766283653e-231
426.58143025440552e-241.3162860508811e-231
431.98840660346123e-243.97681320692245e-241
448.0312891360986e-251.60625782721972e-241
452.05070097964059e-254.10140195928119e-251
463.29663622456245e-266.59327244912491e-261
471.2236440463811e-262.4472880927622e-261
482.23575485062035e-274.4715097012407e-271
494.06616126379041e-288.13232252758083e-281
501.90042443054267e-283.80084886108533e-281
512.83037081359115e-295.66074162718229e-291
527.97215989765368e-301.59443197953074e-291
532.88199067026211e-305.76398134052422e-301
547.74781271394615e-311.54956254278923e-301
552.66635827197622e-315.33271654395244e-311
564.62128078595882e-329.24256157191764e-321
579.609146446249e-321.9218292892498e-311
586.60939933288359e-321.32187986657672e-311
591.0663829875254e-322.13276597505081e-321
601.48968014096096e-322.97936028192192e-321
614.17964485263909e-328.35928970527819e-321
626.93844759399843e-331.38768951879969e-321
632.30414968229917e-334.60829936459834e-331
649.562560655017e-341.9125121310034e-331
651.9784863007931e-343.9569726015862e-341
669.00723732863456e-351.80144746572691e-341
674.05898437398682e-358.11796874797364e-351
682.12986405116737e-354.25972810233474e-351
697.64952371243945e-361.52990474248789e-351
709.87062331323163e-361.97412466264633e-351
715.15001381625357e-361.03000276325071e-351
728.75528514131646e-371.75105702826329e-361
733.26478515277502e-336.52957030555004e-331
747.3723787803947e-341.47447575607894e-331
751.37357277782799e-342.74714555565598e-341
762.54226909029318e-355.08453818058635e-351
771.986772713324e-353.97354542664799e-351
783.72785255470529e-367.45570510941057e-361
792.60733228306951e-365.21466456613901e-361
804.79835521986541e-369.59671043973082e-361
811.23645448073457e-122.47290896146915e-120.999999999998764
823.02848740339667e-116.05697480679334e-110.999999999969715
834.36450099723679e-118.72900199447358e-110.999999999956355
842.50094734700134e-095.00189469400268e-090.999999997499053
853.49549242900941e-096.99098485801882e-090.999999996504508
864.4890849855576e-098.97816997111519e-090.999999995510915
876.5905389121441e-091.31810778242882e-080.99999999340946
888.76420499810168e-091.75284099962034e-080.999999991235795
895.92332718001453e-091.18466543600291e-080.999999994076673
902.49453054110895e-074.98906108221789e-070.999999750546946
912.57214653132561e-075.14429306265122e-070.999999742785347
921.93234261643068e-073.86468523286135e-070.999999806765738
931.09331359105048e-072.18662718210097e-070.99999989066864
942.10292939376098e-064.20585878752197e-060.999997897070606
951.23481951248022e-062.46963902496044e-060.999998765180487
964.7468425184947e-069.4936850369894e-060.999995253157482
973.02067981358668e-066.04135962717336e-060.999996979320186
983.59036848804231e-067.18073697608463e-060.999996409631512
996.92941639184309e-050.0001385883278368620.999930705836082
1005.18668087591253e-050.0001037336175182510.99994813319124
1013.5006111633665e-057.001222326733e-050.999964993888366
1022.82973731601422e-055.65947463202843e-050.99997170262684
1031.96306152402374e-053.92612304804747e-050.99998036938476
1040.0001731203470645320.0003462406941290650.999826879652935
1050.0003683065592314940.0007366131184629870.999631693440769
1060.0003370062462752150.000674012492550430.999662993753725
1070.001139180983854670.002278361967709340.998860819016145
1080.0007831385823036560.001566277164607310.999216861417696
1090.000874612146877180.001749224293754360.999125387853123
1100.0009423942212713060.001884788442542610.999057605778729
1110.2842993543248750.5685987086497510.715700645675125
1120.2766252712829740.5532505425659480.723374728717026
1130.3147472842517950.6294945685035890.685252715748205
1140.6301940272238410.7396119455523180.369805972776159
1150.5879801358836510.8240397282326990.412019864116349
1160.5732964439523870.8534071120952270.426703556047613
1170.6271602919305890.7456794161388230.372839708069411
1180.7123360536554830.5753278926890330.287663946344517
1190.688087280480020.6238254390399610.311912719519981
1200.6693959229412080.6612081541175850.330604077058793
1210.6476312199032360.7047375601935270.352368780096764
1220.6136345112029480.7727309775941050.386365488797052
1230.6112342367004410.7775315265991180.388765763299559
1240.5682470515267330.8635058969465340.431752948473267
1250.5227375044830390.9545249910339220.477262495516961
1260.6645495948454060.6709008103091880.335450405154594
1270.6957031838990560.6085936322018890.304296816100944
1280.7063140380586690.5873719238826630.293685961941331
1290.677549187756980.6449016244860410.322450812243021
1300.7320319567872030.5359360864255950.267968043212797
1310.6934924784632050.6130150430735890.306507521536795
1320.6526822121576720.6946355756846570.347317787842328
1330.6388032227720660.7223935544558690.361196777227934
1340.615690878827690.7686182423446190.38430912117231
1350.6416896260263120.7166207479473750.358310373973688
1360.6220418927009360.7559162145981280.377958107299064
1370.6032706048282690.7934587903434620.396729395171731
1380.5527527258463410.8944945483073180.447247274153659
1390.6919013871198790.6161972257602420.308098612880121
1400.8438684592201970.3122630815596060.156131540779803
1410.8105299716290290.3789400567419430.189470028370972
1420.863549773019880.2729004539602410.136450226980121
1430.8678167666582810.2643664666834380.132183233341719
1440.8324719405144790.3350561189710420.167528059485521
1450.9288504234895080.1422991530209850.0711495765104925
1460.9945253950619370.01094920987612630.00547460493806317
1470.9966853099268740.006629380146251750.00331469007312587
1480.9960066181676440.007986763664711760.00399338183235588
1490.9939591281478410.01208174370431740.00604087185215872
1500.993731964568310.01253607086337840.0062680354316892
1510.9897083968152230.02058320636955470.0102916031847773
1520.986610713731030.02677857253794160.0133892862689708
1530.9842796597404650.03144068051907040.0157203402595352
1540.9831450995219740.03370980095605150.0168549004780257
1550.9916727484448220.01665450311035640.00832725155517822
1560.9862056141567220.02758877168655520.0137943858432776
1570.9828924278630440.03421514427391170.0171075721369558
1580.9716589270314940.05668214593701280.0283410729685064
1590.9536050741975440.09278985160491290.0463949258024564
1600.989927331692020.02014533661596160.0100726683079808
1610.9957507849763380.008498430047324190.0042492150236621
1620.9971263426132660.005747314773468820.00287365738673441
1630.9926752922919180.01464941541616430.00732470770808216
1640.988620564697190.02275887060561770.0113794353028089
1650.973992254755070.05201549048986150.0260077452449308
1660.960777109215960.07844578156808140.0392228907840407
1670.908936801467890.1821263970642180.0910631985321092
1680.865677710122530.2686445797549410.134322289877471


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1080.666666666666667NOK
5% type I error level1210.746913580246914NOK
10% type I error level1250.771604938271605NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/10svjn1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/10svjn1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/1mvmt1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/1mvmt1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/2emlw1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/2emlw1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/3emlw1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/3emlw1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/4emlw1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/4emlw1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/57vkh1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/57vkh1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/67vkh1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/67vkh1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/70m2k1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/70m2k1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/80m2k1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/80m2k1292440203.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/9svjn1292440203.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292440157coib27v6fm69xgr/9svjn1292440203.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal 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