Home » date » 2010 » Dec » 09 »

Paper: Multiple Linear Regression (monthly dummies)

*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: Thu, 09 Dec 2010 12:25:49 +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/09/t12918980941hp18jpw03n7cwz.htm/, Retrieved Thu, 09 Dec 2010 13:34:55 +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/09/t12918980941hp18jpw03n7cwz.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
24 14 11 12 24 26 10 25 11 7 8 25 23 14 17 6 17 8 30 25 18 18 12 10 8 19 23 15 18 8 12 9 22 19 18 16 10 12 7 22 29 11 20 10 11 4 25 25 17 16 11 11 11 23 21 19 18 16 12 7 17 22 7 17 11 13 7 21 25 12 23 13 14 12 19 24 13 30 12 16 10 19 18 15 23 8 11 10 15 22 14 18 12 10 8 16 15 14 15 11 11 8 23 22 16 12 4 15 4 27 28 16 21 9 9 9 22 20 12 15 8 11 8 14 12 12 20 8 17 7 22 24 13 31 14 17 11 23 20 16 27 15 11 9 23 21 9 21 9 14 13 19 21 11 31 14 10 8 18 23 12 19 11 11 8 20 28 11 16 8 15 9 23 24 14 20 9 15 6 25 24 18 21 9 13 9 19 24 11 22 9 16 9 24 23 14 17 9 13 6 22 23 17 25 16 18 16 26 24 12 26 11 18 5 29 18 14 25 8 12 7 32 25 14 17 9 17 9 25 21 15 32 16 9 6 29 26 11 33 11 9 6 28 22 15 13 16 12 5 17 22 14 32 12 18 12 28 22 11 25 12 12 7 29 23 12 29 14 18 10 26 30 17 22 9 14 9 25 23 15 18 10 15 8 14 17 9 17 9 16 5 25 23 16 20 10 10 8 26 23 13 15 12 11 8 20 25 15 20 14 14 10 18 24 11 33 14 9 6 32 24 10 29 10 12 8 25 23 16 23 14 17 7 25 21 13 26 16 5 4 23 2 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'Sir Ronald Aylmer Fisher' @ 193.190.124.24
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
PS[t] = + 6.14877022785273 + 0.353909374463323CM[t] -0.340140308890912D[t] + 0.187547743317141PE[t] -0.0218597760694683PC[t] + 0.414511745648744O[t] -0.055790671462666`H `[t] + 1.91304219854686M1[t] + 3.20749012754116M2[t] + 2.29146189157973M3[t] + 1.04229613763446M4[t] + 1.11536866188866M5[t] + 2.25591011160927M6[t] + 0.866676009591269M7[t] + 2.79259992654015M8[t] + 0.816064160614426M9[t] + 0.182942017830659M10[t] + 0.206770309169597M11[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.148770227852733.2636521.8840.0616220.030811
CM0.3539093744633230.0587626.022800
D-0.3401403088909120.12035-2.82630.0053940.002697
PE0.1875477433171410.1039631.8040.0733690.036685
PC-0.02185977606946830.130768-0.16720.867480.43374
O0.4145117456487440.0743235.577100
`H `-0.0557906714626660.132543-0.42090.6744510.337225
M11.913042198546861.336921.43090.1546620.077331
M23.207490127541161.3544922.3680.019240.00962
M32.291461891579731.3448331.70390.0906020.045301
M41.042296137634461.369510.76110.4478850.223942
M51.115368661888661.3637550.81790.4148140.207407
M62.255910111609271.3639161.6540.1003530.050177
M70.8666760095912691.3600190.63730.5249940.262497
M82.792599926540151.3547532.06130.0411080.020554
M90.8160641606144261.3351050.61120.5420270.271014
M100.1829420178306591.3447020.1360.8919790.445989
M110.2067703091695971.3619990.15180.8795510.439775


Multiple Linear Regression - Regression Statistics
Multiple R0.657416140227832
R-squared0.43219598143206
Adjusted R-squared0.3637373408955
F-TEST (value)6.31324224443585
F-TEST (DF numerator)17
F-TEST (DF denominator)141
p-value8.03553890094122e-11
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.39580543571185
Sum Squared Residuals1625.94073256663


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12423.81377962494220.186220375057788
22524.35310806328500.646891936715029
33024.78784461468975.21215538531025
41919.8772607017328-0.877260701732849
52219.83871117513252.16128882486746
62224.1705249670097-2.17052496700972
72522.08216893636532.9178310636347
82320.32966828856342.67033171143661
91718.7192363779055-1.71923637790550
102120.5850360280630.414963971936982
111921.6599863942585-2.65998639425846
121922.0908852371785-3.09088523717846
131523.6632219875176-8.66322198751764
141618.7821513979123-2.78215139791227
152320.12208396738482.87791603261521
162723.51687280372483.48312719627516
172220.74691153410491.25308846589509
181417.1849983434503-3.18499834345029
192223.6308076260435-1.63080762604348
202325.4960347074826-2.4960347074826
212321.48720067293621.51279932706383
221921.1350869194662-2.13508691946615
231823.1296481378974-5.12964813789736
242022.0122834048641-2.01228340486415
252322.78693060690990.213069393090103
262524.99929236722430.000707632775675614
271924.3870333911222-5.38703339112219
282423.47253648155490.527463518445079
292221.11162621736150.888373782638507
302624.11506655940541.88493344059460
312922.42224909625166.57775090374837
323226.74726077290945.25273922709065
332520.77949121277534.22050878722474
342923.93494632047065.06505367952938
352824.13217586228183.8678241377182
361715.78681019687471.21318980312527
372826.92433178759291.07566821240705
382925.08414758997463.91585241002544
392628.5858122280069-2.58581222800692
402523.04165032345801.95834967654203
411419.4160261152381-5.41602611523811
422522.89246134456572.10753865543434
432621.20132128332354.79867871667654
442021.5824076018632-1.58240760186320
451821.0227127084867-3.02271270848667
463224.19590349288097.80409650711906
472523.9343234253181.06567657468202
482520.54148264955054.45851735044952
492322.11767668490510.882323315094906
502123.908273522058-2.90827352205798
512024.9063893658019-4.90638936580193
521515.8764028453032-0.87640284530316
533026.02559473430673.97440526569328
542426.5557566659754-2.55575666597541
552623.88649183001672.1135081699833
562422.95782446003501.04217553996505
572220.82562862495761.17437137504239
581414.1871184963506-0.187118496350568
592420.89050562733973.1094943726603
602421.70942917593462.29057082406538
612424.169688300541-0.169688300540989
622421.66408019423102.33591980576903
631919.1169778063536-0.116977806353572
643127.16897129146613.83102870853388
652226.4021944756145-4.40219447561446
662722.42198740134834.57801259865168
671917.10484960952791.89515039047207
682523.69209478307071.30790521692927
692024.4773365505020-4.47733655050204
702120.22654891581740.773451084182563
712726.41269179950040.587308200499596
722323.1423493748509-0.142349374850932
732526.4659751165094-1.46597511650937
742023.9267728341495-3.92677283414946
752223.4983695363039-1.49836953630393
762322.88561256447660.114387435523365
772524.35616234472880.643837655271192
782524.52448360503790.475516394962088
791723.0619840643732-6.06198406437317
801923.0605867841818-4.06058678418185
812523.15969669115311.8403033088469
821921.7904476894089-2.79044768940894
832022.0052612871699-2.00526128716993
842621.13303077951914.86696922048086
852321.19393940912341.80606059087655
862726.32853650849810.671463491501924
871721.7285482193295-4.72854821932953
881723.0255857841869-6.02558578418692
891719.5722677137679-2.57226771376791
902222.9247158231212-0.924715823121187
912122.8220553771362-1.82205537713623
923230.01620694267511.98379305732486
932124.4486440456690-3.44864404566895
942123.2662700860218-2.26627008602179
951820.1513689601983-2.15136896019830
961820.0586416129406-2.05864161294062
972323.2628299258930-0.26282992589297
981922.2712196601799-3.27121966017988
992021.5972940494516-1.59729404945163
1002121.5499573417065-0.549957341706525
1012023.6147074741298-3.61470747412985
1021719.9923647998927-2.99236479989269
1031819.6029285633576-1.60292856335762
1041921.9742713767137-2.97427137671375
1052221.49124962525410.508750374745933
1061517.5735081371596-2.57350813715963
1071417.2600761736985-3.26007617369846
1081825.186978645569-7.18697864556898
1092421.78521515605242.21478484394758
1103525.11246333031109.88753666968903
1112919.65299046693639.34700953306367
1122121.6843188351038-0.684318835103755
1132018.13468898664151.86531101335854
1142224.3299317082594-2.32993170825941
1151316.2610351212007-3.2610351212007
1162625.02678271876640.973217281233622
1171716.07090457891300.929095421087023
1182519.00299081031645.99700918968363
1192019.46312005560950.536879944390472
1201916.99932991962982.00067008037024
1212123.1645906951455-2.16459069514546
1222222.7316573108145-0.731657310814519
1232423.60546849375910.394531506240948
1242122.5851984251227-1.58519842512267
1252625.59526445976970.404735540230294
1262421.38273899887652.61726100112351
1271619.5603147467725-3.56031474677254
1282323.7349476798571-0.734947679857064
1291820.3710345866985-2.37103458669855
1301621.1908014811978-5.19080148119779
1312623.11748770985542.88251229014461
1321917.72589472849711.27410527150287
1332117.19946343150243.80053656849757
1342123.8168540089534-2.81685400895344
1352219.26320762866282.73679237133718
1362319.50387934728563.4961206527144
1372924.62096246688234.37903753311771
1382119.78770206219181.21229793780821
1392120.05093031455130.949069685448718
1402323.1818954345004-0.181895434500434
1412722.88504032081324.11495967918679
1422524.38365816410590.616341835894139
1432119.73584683130771.26415316869225
1441015.4672663388472-5.46726633884718
1452023.0429323517082-3.04293235170825
1462623.97898852076902.02101147923097
1472424.7331758273740-0.733175827373961
1482931.8117532548780-2.81175325487804
1491918.56488230232170.435117697678269
1502422.71726772086571.28273227913428
1511920.3128634310799-1.31286343107994
1522425.2000184493812-1.20001844938116
1532221.26182400393590.738175996064113
1541722.5276834587409-5.52768345874089
1552422.10750773556491.89249226443507
1562521.14561793574383.85438206425619
1573024.40942492165695.59057507834313
1581922.0424546916396-3.04245469163955
1592221.01480440482360.985195595176392


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
210.8349192780705520.3301614438588970.165080721929448
220.7358217647087850.528356470582430.264178235291215
230.6307488624849540.7385022750300920.369251137515046
240.5280372866308290.9439254267383420.471962713369171
250.4881764847802830.9763529695605660.511823515219717
260.3935520919218370.7871041838436740.606447908078163
270.4824545569909430.9649091139818850.517545443009057
280.39862948437070.79725896874140.6013705156293
290.3543228812255020.7086457624510040.645677118774498
300.2753310142167590.5506620284335180.724668985783241
310.540265241736320.919469516527360.45973475826368
320.7060391230923860.5879217538152270.293960876907614
330.6621494238849150.6757011522301690.337850576115085
340.6744987122635190.6510025754729630.325501287736481
350.7151116834094350.569776633181130.284888316590565
360.6720317484146760.6559365031706480.327968251585324
370.6562734917396580.6874530165206830.343726508260342
380.6827458495206170.6345083009587660.317254150479383
390.7686382310581710.4627235378836570.231361768941829
400.7256791719596340.5486416560807310.274320828040366
410.7395954092680330.5208091814639350.260404590731967
420.6984658293002890.6030683413994230.301534170699711
430.7115531318390490.5768937363219020.288446868160951
440.67986797887320.6402640422535990.320132021126800
450.693517838008990.612964323982020.30648216199101
460.7783578561926380.4432842876147240.221642143807362
470.7360569176809750.527886164638050.263943082319025
480.7837104889355570.4325790221288870.216289511064443
490.7387326741816370.5225346516367260.261267325818363
500.7131142345349180.5737715309301630.286885765465082
510.7654325025696440.4691349948607130.234567497430356
520.7263859119054440.5472281761891120.273614088094556
530.7701976411662730.4596047176674530.229802358833727
540.7705220693366770.4589558613266460.229477930663323
550.7471392381914230.5057215236171540.252860761808577
560.7072734943548030.5854530112903940.292726505645197
570.6601819510003770.6796360979992450.339818048999623
580.6287910533651270.7424178932697460.371208946634873
590.6576985457230580.6846029085538850.342301454276942
600.6288324632532020.7423350734935960.371167536746798
610.5805520069742260.8388959860515470.419447993025774
620.5552385353774470.8895229292451050.444761464622552
630.5072587863549270.9854824272901460.492741213645073
640.5010775959267430.9978448081465130.498922404073257
650.6118811983627590.7762376032744820.388118801637241
660.672722907280840.6545541854383210.327277092719161
670.6545355591673330.6909288816653340.345464440832667
680.6127700765875870.7744598468248260.387229923412413
690.6749801391592610.6500397216814780.325019860840739
700.6387134847315960.7225730305368080.361286515268404
710.5909877517646530.8180244964706940.409012248235347
720.543799151211470.912401697577060.45620084878853
730.5031113568405590.9937772863188830.496888643159441
740.524315150555920.951369698888160.47568484944408
750.4814635785119190.9629271570238380.518536421488081
760.4352081652285570.8704163304571150.564791834771443
770.3857291615693560.7714583231387120.614270838430644
780.3389235363549610.6778470727099230.661076463645039
790.437131875590110.874263751180220.56286812440989
800.4641343198284550.928268639656910.535865680171545
810.4294525561849490.8589051123698970.570547443815051
820.4272369685305070.8544739370610150.572763031469493
830.3980649079271260.7961298158542530.601935092072874
840.4878070242056520.9756140484113040.512192975794348
850.4502403156526230.9004806313052470.549759684347377
860.4118529635497890.8237059270995780.588147036450211
870.4566220416804230.9132440833608470.543377958319577
880.5745710060881610.8508579878236790.425428993911839
890.5561999939178630.8876000121642740.443800006082137
900.510673325366040.978653349267920.48932667463396
910.4708263761510940.9416527523021880.529173623848906
920.4590944359164630.9181888718329260.540905564083537
930.4639928117219310.9279856234438620.536007188278069
940.4335923363141960.8671846726283920.566407663685804
950.4070360371969580.8140720743939160.592963962803042
960.3692430815389240.7384861630778480.630756918461076
970.3254257365809250.6508514731618510.674574263419075
980.3323862836443050.664772567288610.667613716355695
990.3145659399926850.629131879985370.685434060007315
1000.2704736123976240.5409472247952490.729526387602376
1010.2871191751233080.5742383502466160.712880824876692
1020.2817646820423390.5635293640846790.71823531795766
1030.2423970289808580.4847940579617160.757602971019142
1040.2261763600490680.4523527200981350.773823639950932
1050.1887782055315100.3775564110630210.81122179446849
1060.1650919378843780.3301838757687570.834908062115622
1070.156453487020270.312906974040540.84354651297973
1080.2643245377564260.5286490755128520.735675462243574
1090.2426483274554890.4852966549109780.757351672544511
1100.6341171095247360.7317657809505280.365882890475264
1110.8507484401791610.2985031196416770.149251559820839
1120.8139914609147410.3720170781705180.186008539085259
1130.7759615878890930.4480768242218130.224038412110907
1140.7855355629252240.4289288741495510.214464437074776
1150.776946957457270.4461060850854610.223053042542730
1160.7264541671304560.5470916657390880.273545832869544
1170.6716286401308560.6567427197382890.328371359869144
1180.9005331003262080.1989337993475850.0994668996737924
1190.8786091903370740.2427816193258530.121390809662926
1200.847052660953130.3058946780937420.152947339046871
1210.8367373362778460.3265253274443090.163262663722154
1220.7899530561872230.4200938876255540.210046943812777
1230.7326147587105280.5347704825789440.267385241289472
1240.6881550560795550.623689887840890.311844943920445
1250.669903677875150.66019264424970.33009632212485
1260.610471883159790.779056233680420.38952811684021
1270.6127005845584270.7745988308831470.387299415441573
1280.5334111667164810.9331776665670370.466588833283519
1290.4675908061657850.935181612331570.532409193834215
1300.424052747310030.848105494620060.57594725268997
1310.4422978268619880.8845956537239760.557702173138012
1320.4311349232079770.8622698464159550.568865076792023
1330.4306332549663080.8612665099326170.569366745033692
1340.3376698369297230.6753396738594470.662330163070276
1350.2915119782290510.5830239564581030.708488021770949
1360.414861610578560.829723221157120.58513838942144
1370.3061108463975260.6122216927950510.693889153602474
1380.729257376270670.541485247458660.27074262372933


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 level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/10mop11291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/10mop11291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/1fna71291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/1fna71291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/2qe9s1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/2qe9s1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/3qe9s1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/3qe9s1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/4qe9s1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/4qe9s1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/5069v1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/5069v1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/6069v1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/6069v1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/7bf8g1291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/7bf8g1291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/8mop11291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/8mop11291897534.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/9mop11291897534.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t12918980941hp18jpw03n7cwz/9mop11291897534.ps (open in new window)


 
Parameters (Session):
par1 = 5 ; par2 = Include Monthly Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 5 ; par2 = Include Monthly Dummies ; par3 = No 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