Home » date » 2008 » Dec » 20 »

Multiple Regression

*Unverified author*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sat, 20 Dec 2008 09:33:49 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8.htm/, Retrieved Sat, 20 Dec 2008 17:40:40 +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/2008/Dec/20/t12297912306qz6c913bxzscy8.htm/},
    year = {2008},
}
@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 = {2008},
    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 «
621 0 604 0 584 0 574 0 555 0 545 0 599 0 620 0 608 0 590 0 579 0 580 0 579 0 572 0 560 0 551 0 537 0 541 0 588 0 607 0 599 0 578 0 563 0 566 0 561 0 554 0 540 0 526 0 512 0 505 0 554 0 584 0 569 0 540 0 522 0 526 0 527 0 516 0 503 0 489 0 479 0 475 0 524 0 552 0 532 0 511 0 492 0 492 0 493 0 481 0 462 0 457 0 442 0 439 0 488 0 521 0 501 0 485 0 464 0 460 0 467 0 460 0 448 0 443 0 436 0 431 0 484 0 510 0 513 0 503 0 471 0 471 0 476 0 475 0 470 0 461 0 455 0 456 0 517 0 525 0 523 0 519 1 509 1 512 1 519 1 517 1 510 1 509 1 501 1 507 1 569 1 580 1 578 1 565 1 547 1 555 1 562 1 561 1 555 1 544 1 537 1 543 1 594 1 611 1 613 1 611 1 594 1 595 1 591 1 589 1 584 1 573 1 567 1 569 1 621 1 629 1 628 1 612 1 595 1 597 1 593 1 590 1 580 1 574 1 573 1 573 1 620 1 626 1 620 1 588 1 566 1 557 1 561 1 549 1 532 1 526 1 511 1 499 1 555 1 565 1 542 1 527 1 510 1 514 1 517 1 508 1 493 1 490 1 469 1 478 1 528 1 534 1 518 1 506 1 502 1
 
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 time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
X[t] = + 566.656504065041 + 129.841027874565Y[t] + 7.02847855058232M1[t] + 1.26130356770599M2[t] -9.4289483382472M3[t] -16.1961233211234M4[t] -25.9632983039996M5[t] -25.7304732868758M6[t] + 27.8100440379404M7[t] + 46.1967152089103M8[t] + 38.1987709952649M9[t] + 13.3669015604991M10[t] -2.40027342237711M11[t] -1.2328250171238t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)566.65650406504110.4970353.982600
Y129.84102787456510.2084212.71900
M17.0284785505823212.687710.5540.5804840.290242
M21.2613035677059912.6861540.09940.9209430.460472
M3-9.428948338247212.685623-0.74330.458550.229275
M4-16.196123321123412.686117-1.27670.2038140.101907
M5-25.963298303999612.687636-2.04630.042580.02129
M6-25.730473286875812.69018-2.02760.0444860.022243
M727.810044037940412.6937472.19080.0301060.015053
M846.196715208910312.6983373.6380.0003850.000192
M938.198770995264912.7039493.00680.0031260.001563
M1013.366901560499112.6861541.05370.2938410.14692
M11-2.4002734223771112.68771-0.18920.8502230.425112
t-1.23282501712380.114028-10.811600


Multiple Linear Regression - Regression Statistics
Multiple R0.788247462298977
R-squared0.621334061820778
Adjusted R-squared0.58642159943546
F-TEST (value)17.7969131756821
F-TEST (DF numerator)13
F-TEST (DF denominator)141
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation31.6848820233807
Sum Squared Residuals141554.376585813


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1621572.45215759849748.5478424015029
2604565.45215759849938.5478424015009
3584553.52908067542230.4709193245779
4574545.52908067542228.4709193245776
5555534.52908067542220.4709193245778
6545533.52908067542211.4709193245778
7599585.83677298311413.1632270168857
8620602.9906191369617.0093808630394
9608593.75984990619114.2401500938085
10590567.69515545430222.3048445456982
11579550.69515545430228.3048445456981
12580551.86260385955528.1373961404449
13579557.65825739301421.3417426069863
14572550.65825739301421.3417426069864
15560538.73518046993721.2648195300634
16551530.73518046993720.2648195300634
17537519.73518046993717.2648195300634
18541518.73518046993722.2648195300634
19588571.04287277762916.9571272223711
20607588.19671893147518.8032810685249
21599578.96594970070620.0340502992942
22578552.90125524881625.0987447511837
23563535.90125524881627.0987447511837
24566537.06870365407028.9312963459304
25561542.86435718752818.1356428124719
26554535.86435718752818.1356428124721
27540523.94128026445116.058719735549
28526515.94128026445110.058719735549
29512504.9412802644517.05871973554897
30505503.9412802644511.05871973554898
31554556.248972572143-2.24897257214335
32584573.40281872599010.5971812740105
33569564.172049495224.82795050477976
34540538.1073550433311.89264495666931
35522521.1073550433310.892644956669311
36526522.2748034485843.72519655141602
37527528.070456982043-1.07045698204253
38516521.070456982042-5.07045698204234
39503509.147380058965-6.14738005896543
40489501.147380058965-12.1473800589654
41479490.147380058965-11.1473800589654
42475489.147380058965-14.1473800589654
43524541.455072366658-17.4550723666577
44552558.608918520504-6.60891852050391
45532549.378149289735-17.3781492897347
46511523.313454837845-12.3134548378451
47492506.313454837845-14.3134548378451
48492507.480903243098-15.4809032430984
49493513.276556776557-20.2765567765569
50481506.276556776557-25.2765567765567
51462494.35347985348-32.3534798534798
52457486.35347985348-29.3534798534798
53442475.35347985348-33.3534798534799
54439474.35347985348-35.3534798534799
55488526.661172161172-38.6611721611722
56521543.815018315018-22.8150183150183
57501534.584249084249-33.5842490842491
58485508.51955463236-23.5195546323595
59464491.519554632360-27.5195546323595
60460492.687003037613-32.6870030376128
61467498.482656571071-31.4826565710714
62460491.482656571071-31.4826565710711
63448479.559579647994-31.5595796479943
64443471.559579647994-28.5595796479942
65436460.559579647994-24.5595796479943
66431459.559579647994-28.5595796479943
67484511.867271955687-27.8672719556866
68510529.021118109533-19.0211181095327
69513519.790348878764-6.7903488787635
70503493.7256544268749.27434557312606
71471476.725654426874-5.72565442687393
72471477.893102832127-6.89310283212723
73476483.688756365586-7.68875636558575
74475476.688756365586-1.68875636558556
75470464.7656794425095.23432055749134
76461456.7656794425094.23432055749133
77455445.7656794425099.23432055749131
78456444.76567944250911.2343205574913
79517497.07337175020119.926628249799
80525514.22721790404710.7727820959528
81523504.99644867327818.0035513267221
82519608.772782095953-89.7727820959529
83509591.772782095953-82.7727820959529
84512592.940230501206-80.9402305012062
85519598.735884034665-79.7358840346647
86517591.735884034665-74.7358840346645
87510579.812807111588-69.8128071115876
88509571.812807111588-62.8128071115876
89501560.812807111588-59.8128071115876
90507559.812807111588-52.8128071115876
91569612.12049941928-43.1204994192800
92580629.274345573126-49.2743455731261
93578620.043576342357-42.0435763423569
94565593.978881890467-28.9788818904673
95547576.978881890467-29.9788818904673
96555578.146330295721-23.1463302957206
97562583.941983829179-21.9419838291791
98561576.941983829179-15.9419838291789
99555565.018906906102-10.0189069061020
100544557.018906906102-13.018906906102
101537546.018906906102-9.01890690610207
102543545.018906906102-2.01890690610205
103594597.326599213794-3.32659921379437
104611614.480445367641-3.48044536764051
105613605.2496761368717.75032386312873
106611579.18498168498231.8150183150183
107594562.18498168498231.8150183150183
108595563.35243009023531.647569909765
109591569.14808362369421.8519163763065
110589562.14808362369326.8519163763067
111584550.22500670061633.7749932993836
112573542.22500670061630.7749932993836
113567531.22500670061635.7749932993835
114569530.22500670061638.7749932993835
115621582.53269900830938.4673009916912
116629599.68654516215529.3134548378451
117628590.45577593138637.5442240686143
118612564.39108147949647.6089185205039
119595547.39108147949647.6089185205039
120597548.55852988474948.4414701152506
121593554.35418341820838.6458165817920
122590547.35418341820842.6458165817922
123580535.43110649513144.5688935048691
124574527.43110649513146.5688935048692
125573516.43110649513156.5688935048691
126573515.43110649513157.5688935048691
127620567.73879880282352.2612011971768
128626584.89264495666941.1073550433306
129620575.661875725944.3381242740999
130588549.59718127401038.4028187259895
131566532.5971812740133.4028187259895
132557533.76462967926423.2353703207362
133561539.56028321272221.4397167872776
134549532.56028321272216.4397167872778
135532520.63720628964511.3627937103547
136526512.63720628964513.3627937103547
137511501.6372062896459.36279371035469
138499500.637206289645-1.63720628964529
139555552.9448985973382.05510140266239
140565570.098744751184-5.09874475118376
141542560.867975520414-18.8679755204145
142527534.803281068525-7.80328106852495
143510517.803281068525-7.80328106852495
144514518.970729473778-4.97072947377825
145517524.766383007237-7.7663830072368
146508517.766383007237-9.7663830072366
147493505.84330608416-12.8433060841597
148490497.84330608416-7.84330608415967
149469486.84330608416-17.8433060841597
150478485.84330608416-7.84330608415972
151528538.150998391852-10.1509983918520
152534555.304844545698-21.3048445456982
153518546.074075314929-28.0740753149289
154506520.009380863039-14.0093808630394
155502503.009380863039-1.00938086303938


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
170.01908098073432470.03816196146864930.980919019265675
180.01929042258023370.03858084516046750.980709577419766
190.007718955100786580.01543791020157320.992281044899213
200.00262519809741910.00525039619483820.99737480190258
210.001040063773068100.002080127546136190.998959936226932
220.0003400512666972940.0006801025333945880.999659948733303
239.63957957329703e-050.0001927915914659410.999903604204267
242.8060660014031e-055.6121320028062e-050.999971939339986
251.29939485075426e-052.59878970150851e-050.999987006051492
263.77898644219506e-067.55797288439012e-060.999996221013558
279.96877818441493e-071.99375563688299e-060.999999003122181
282.98741653610171e-075.97483307220342e-070.999999701258346
297.52903704183283e-081.50580740836657e-070.99999992470963
302.22893707441682e-084.45787414883363e-080.99999997771063
317.01204539059853e-091.40240907811971e-080.999999992987955
321.84012333404186e-093.68024666808372e-090.999999998159877
334.38748045967440e-108.77496091934879e-100.999999999561252
342.39430569120931e-104.78861138241862e-100.99999999976057
352.62438096591543e-105.24876193183087e-100.999999999737562
361.65120758746045e-103.30241517492089e-100.99999999983488
371.15028668960566e-102.30057337921132e-100.999999999884971
386.92608710272117e-111.38521742054423e-100.99999999993074
392.72730124089226e-115.45460248178451e-110.999999999972727
401.33184414288370e-112.66368828576741e-110.999999999986682
413.68749115874959e-127.37498231749918e-120.999999999996313
429.6145563472652e-131.92291126945304e-120.999999999999039
432.52856888986096e-135.05713777972191e-130.999999999999747
446.2986784252851e-141.25973568505702e-130.999999999999937
452.15223759446316e-144.30447518892632e-140.999999999999978
466.17958481469962e-151.23591696293992e-140.999999999999994
472.67386613406426e-155.34773226812851e-150.999999999999997
481.54059722871203e-153.08119445742406e-150.999999999999998
498.34188603489296e-161.66837720697859e-151
504.83386985633041e-169.66773971266082e-161
514.92147745928162e-169.84295491856324e-161
521.62576381493857e-163.25152762987713e-161
535.57604260152468e-171.11520852030494e-161
541.6701113144847e-173.3402226289694e-171
555.32907309271629e-181.06581461854326e-171
561.2296917972602e-182.4593835945204e-181
573.11765117438682e-196.23530234877363e-191
587.02807457174604e-201.40561491434921e-191
591.61279931557583e-203.22559863115165e-201
606.3303200161202e-211.26606400322404e-201
611.43117471224090e-212.86234942448181e-211
623.23090451751574e-226.46180903503147e-221
638.98441728791089e-231.79688345758218e-221
644.56565189256116e-239.13130378512231e-231
659.02332165597748e-231.80466433119550e-221
661.16774619689209e-222.33549239378419e-221
672.62806317911439e-225.25612635822877e-221
683.65205754717838e-227.30411509435675e-221
693.97293901126147e-207.94587802252293e-201
701.98648253666234e-173.97296507332468e-171
715.97898015257913e-171.19579603051583e-161
721.21351215411415e-162.42702430822831e-161
732.46733182148956e-164.93466364297912e-161
741.43000668144550e-152.86001336289099e-150.999999999999999
752.36698484184752e-144.73396968369505e-140.999999999999976
761.93750610564518e-133.87501221129035e-130.999999999999806
772.28534108264910e-124.57068216529821e-120.999999999997715
782.60529518264041e-115.21059036528081e-110.999999999973947
795.1433630772657e-101.02867261545314e-090.999999999485664
809.49420386755708e-101.89884077351142e-090.99999999905058
813.05136168191135e-096.1027233638227e-090.999999996948638
824.22428784123323e-098.44857568246646e-090.999999995775712
835.98148402479127e-091.19629680495825e-080.999999994018516
841.12733248728723e-082.25466497457446e-080.999999988726675
852.07443651001808e-084.14887302003616e-080.999999979255635
864.34866948933640e-088.69733897867279e-080.999999956513305
871.05287377238076e-072.10574754476152e-070.999999894712623
882.80465421640188e-075.60930843280377e-070.999999719534578
898.6310207731261e-071.72620415462522e-060.999999136897923
903.25812578888216e-066.51625157776431e-060.99999674187421
911.21171861953919e-052.42343723907837e-050.999987882813805
922.85411206028041e-055.70822412056083e-050.999971458879397
937.18225860828422e-050.0001436451721656840.999928177413917
940.0003074442648078620.0006148885296157240.999692555735192
950.001412771339348360.002825542678696730.998587228660652
960.005916516648805210.01183303329761040.994083483351195
970.01796300329326480.03592600658652960.982036996706735
980.04882877014762420.09765754029524830.951171229852376
990.1136839762512790.2273679525025570.886316023748721
1000.2465702407689880.4931404815379760.753429759231012
1010.4523739493810860.9047478987621720.547626050618914
1020.6821623145769940.6356753708460130.317837685423006
1030.8756756071704850.248648785659030.124324392829515
1040.9571537026768040.08569259464639250.0428462973231962
1050.9845030029906520.03099399401869520.0154969970093476
1060.99443306271540.01113387456919830.00556693728459916
1070.9983086337930430.003382732413914530.00169136620695726
1080.9993465248951140.001306950209771180.000653475104885589
1090.9997927522767160.0004144954465677690.000207247723283884
1100.9999234378930830.0001531242138345677.65621069172837e-05
1110.9999582555002458.34889995098125e-054.17444997549063e-05
1120.9999861043807292.77912385418954e-051.38956192709477e-05
1130.9999939359031181.21281937645322e-056.0640968822661e-06
1140.9999971873286045.62534279134788e-062.81267139567394e-06
1150.999998796075172.40784966106446e-061.20392483053223e-06
1160.9999995244024849.5119503307383e-074.75597516536915e-07
1170.9999994481347381.10373052400566e-065.5186526200283e-07
1180.9999993247449821.35051003664539e-066.75255018322695e-07
1190.9999993636766381.27264672308890e-066.36323361544452e-07
1200.999998749525422.50094916108164e-061.25047458054082e-06
1210.9999978574685644.28506287260259e-062.14253143630129e-06
1220.9999953158414369.36831712857371e-064.68415856428685e-06
1230.9999892101111722.15797776558450e-051.07898888279225e-05
1240.999975389642614.92207147783472e-052.46103573891736e-05
1250.9999684737009796.30525980423011e-053.15262990211506e-05
1260.999967581144396.48377112197536e-053.24188556098768e-05
1270.9999531233758879.37532482253167e-054.68766241126584e-05
1280.9999272344672320.0001455310655365637.27655327682814e-05
1290.9999896198124122.07603751754419e-051.03801875877210e-05
1300.99999153237631.69352474007217e-058.46762370036083e-06
1310.999980571220353.88575593010375e-051.94287796505188e-05
1320.999949487110540.0001010257789185945.05128894592972e-05
1330.9998919354147670.0002161291704651540.000108064585232577
1340.999729096022620.0005418079547611210.000270903977380561
1350.9992770741170080.001445851765984360.000722925882992179
1360.9977778584304630.004444283139074550.00222214156953728
1370.997688684147710.004622631704581570.00231131585229079
1380.9867607088157080.02647858236858450.0132392911842923


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1070.877049180327869NOK
5% type I error level1150.942622950819672NOK
10% type I error level1170.959016393442623NOK
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/10s6kg1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/10s6kg1229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/1kabz1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/1kabz1229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/2bta81229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/2bta81229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/3s9mz1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/3s9mz1229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/4m6621229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/4m6621229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/5m3l11229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/5m3l11229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/6rxxb1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/6rxxb1229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/7etqw1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/7etqw1229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/87hu31229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/87hu31229790821.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/96r8p1229790821.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12297912306qz6c913bxzscy8/96r8p1229790821.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