Home » date » 2010 » Dec » 03 »

workshop 7 tutorial verbetering maand

*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, 02 Dec 2010 23:39:29 +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/03/t1291333068432yg75ib50etzw.htm/, Retrieved Fri, 03 Dec 2010 00:37:48 +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/03/t1291333068432yg75ib50etzw.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 «
2 9 2 1 4 3 3 3 3 3 9 2 3 4 3 3 4 3 3 9 4 2 3 4 4 4 3 3 9 3 3 2 3 3 3 3 3 9 3 2 3 3 2 2 2 3 9 1 2 4 3 3 2 2 2 9 4 4 5 4 4 5 4 3 9 2 2 4 2 2 3 2 3 9 2 2 4 4 3 2 3 4 9 2 2 2 2 2 2 2 3 9 4 2 2 3 2 4 4 3 9 3 3 4 3 2 3 3 2 9 3 2 4 4 4 3 3 3 9 2 2 5 3 4 2 3 9 3 3 5 3 3 4 3 3 9 2 2 4 3 2 2 2 3 9 3 3 3 3 3 3 3 3 9 3 3 4 4 4 4 3 2 9 2 2 4 2 2 2 2 4 9 2 2 2 3 2 2 3 3 9 1 1 4 3 3 3 2 2 9 4 3 4 4 4 4 3 3 9 3 2 4 3 3 2 3 3 9 2 2 4 3 3 2 2 2 9 3 3 4 3 4 3 3 2 9 3 3 4 4 4 4 3 4 9 4 3 4 4 2 4 4 2 9 3 2 3 4 3 3 3 3 9 3 3 3 4 3 3 3 2 9 2 2 4 4 4 4 2 4 9 2 2 3 2 4 2 2 3 9 4 3 4 3 3 3 4 2 9 4 3 4 4 3 4 4 3 9 2 2 4 3 2 3 3 3 9 2 2 4 3 2 2 3 1 9 3 3 4 4 4 4 4 3 9 3 3 4 3 3 4 3 3 9 3 2 3 2 2 2 2 3 9 3 3 4 3 3 3 3 2 9 4 3 4 4 4 4 4 3 9 3 3 4 3 4 4 3 9 1 2 3 2 2 3 3 5 9 2 1 5 2 1 4 2 4 9 2 2 4 3 2 3 2 3 9 3 3 4 3 2 3 3 2 9 4 3 4 4 4 3 4 2 9 3 2 4 4 4 3 4 3 9 2 2 5 2 2 2 2 4 9 2 3 4 3 3 4 3 2 9 3 3 4 4 3 4 3 3 9 3 3 4 3 2 4 3 4 10 4 2 3 3 1 2 2 3 10 3 2 4 4 3 3 4 4 10 2 2 4 3 2 3 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 time7 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
Y[t] = + 9.44285459461262 -0.474922911650721month[t] -0.151181636688754X1t[t] + 1.09640691366409X2t[t] + 0.193188674870400X3t[t] -0.418873384753806X4t[t] -0.499506180003605X5t[t] -0.0597106309863434X6t[t] -0.595998253799732X7t[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)9.442854594612620.89760910.5200
month-0.4749229116507210.067022-7.086100
X1t-0.1511816366887540.140581-1.07540.2839540.141977
X2t1.096406913664090.1534057.147100
X3t0.1931886748704000.1278271.51130.1328530.066426
X4t-0.4188733847538060.042436-9.870700
X5t-0.4995061800036050.047291-10.562400
X6t-0.05971063098634340.111945-0.53340.5945680.297284
X7t-0.5959982537997320.051433-11.58800


Multiple Linear Regression - Regression Statistics
Multiple R0.832845398414658
R-squared0.693631457660471
Adjusted R-squared0.67695833971002
F-TEST (value)41.6017843646172
F-TEST (DF numerator)8
F-TEST (DF denominator)147
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.33591350560788
Sum Squared Residuals262.345739486433


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
122.01308138089387-0.0130813808938687
234.14618457723569-1.14618457723569
331.635846150566281.36415384943372
433.66833622179248-0.668336221792475
533.92033304778847-0.92033304778847
633.91637881603277-0.916378816032772
723.55932844284918-1.55932844284918
834.62386611311509-1.62386611311509
932.750325540790480.249674459209521
1044.29719939436063-0.297199394360632
1132.264544966657170.735455033342833
1234.55421975153688-1.55421975153688
1322.03992709311178-0.0399270931117794
1432.862881420411080.137118579588917
1598.404370013891770.595629986108233
1699.41166402431451-0.411664024314514
1796.71106236656722.2889376334328
1897.6782766441441.32172335585599
1998.622477095644380.377522904355618
2097.1591395661.84086043400000
2199.7153872616963-0.715387261696308
2296.607355478693552.39264452130645
2398.458157096923640.541842903076357
2499.58878889336044-0.58878889336044
2597.984594149277211.01540585072279
2696.486280136544542.51371986345546
2797.981389871014551.01861012898545
2897.055432678126351.94456732187365
2997.500249295237331.49975070476267
3097.172095315870361.82790468412964
3197.284321666272421.71567833372759
3297.868833991393951.13116600860605
3396.966518232461022.03348176753898
3498.852447213324570.147552786675434
35910.5439499009276-1.54394990092764
3697.022567759357931.97743224064207
3797.307963100227681.69203689977232
3897.64714552412931.35285447587069
3998.403467534031020.596532465968982
4096.547644847707212.45235515229279
4193.313100192675485.68689980732452
4212.20097890491235-1.20097890491235
4322.32069329455131-0.320693294551308
4423.76513162386398-1.76513162386398
4532.850413163195990.149586836804005
4643.833691246597280.166308753402724
4734.24890352726165-1.24890352726165
4822.8767058272786-0.8767058272786
4922.62472845331259-0.624728453312588
5033.66142473599033-0.661424735990331
5131.716120262669771.28387973733023
5243.545999716636400.454000283363596
5333.40000596760518-0.400005967605177
5422.66962719006064-0.669627190060639
5521.930393811458360.06960618854164
5622.32818232229398-0.328182322293975
5723.68577019223034-1.68577019223034
5832.850579982759800.149420017240196
5914.17077705769191-3.17077705769191
6052.699398346071052.30060165392895
6123.51057823783091-1.51057823783091
6233.258615157061-0.258615157060998
6343.266896807476540.733103192523465
6443.884719705400470.115280294599528
6522.15269724022827-0.152697240228272
6632.556498359797830.443501640202166
6732.887399133283920.112600866716077
6833.42203267592099-0.422032675920988
6931.602991432406961.39700856759304
7013.60024263698929-2.60024263698929
7132.288806611732780.71119338826722
7231.884725669187281.11527433081272
7334.17011504627022-1.17011504627022
7443.730156787598220.269843212401775
7532.387892953280320.612107046719681
7642.862815864931041.13718413506896
7732.711634228242290.288365771757715
7832.999205059411480.000794940588517722
7922.98113258285137-0.98113258285137
8012.29475006219414-1.29475006219414
8127.11633540462837-5.11633540462837
8233.63339249129577-0.633392491295771
8343.325658718099110.674341281900886
8433.17663065659329-0.176630656593286
8543.96655570864690.0334442913531027
8653.870227991328041.12977200867196
8722.67210340849596-0.672103408495965
8823.59916760852306-1.59916760852306
8943.921656971898850.0783430281011534
9043.214519106541970.785480893458035
9133.26594808711277-0.265948087112771
9244.38835453719319-0.388354537193193
9344.29688353149078-0.296883531490783
9443.316236775709950.683763224290046
9543.870227991328040.129772008671959
9644.74384189367512-0.743841893675125
9726.54252996107965-4.54252996107965
9844.18738370691386-0.187383706913857
9943.987184745244080.0128152547559157
10044.67008877397351-0.670088773973514
10144.23717290050444-0.237172900504440
10244.1597443835173-0.159744383517297
10355.82038917626505-0.820389176265048
10444.74258998208894-0.742589982088943
10542.89366953014641.10633046985360
10644.66883686238733-0.668836862387332
10733.65521713541998-0.655217135419975
10844.71084390056898-0.710843900568978
10944.50575448205668-0.505754482056675
11044.49024960083001-0.490249600830005
11133.60318376824892-0.603183768248916
11234.27935733315491-1.27935733315491
11333.03176878280207-0.0317687828020683
11432.960557929941430.0394420700585694
11543.303861405162560.696138594837436
11632.363657196280950.636342803719051
11732.363657196280950.636342803719051
11843.120314344711990.87968565528801
11933.39779691892162-0.397796918921617
12033.74216723048077-0.74216723048077
12133.53127496280567-0.531274962805673
12233.46043299370045-0.460432993700451
12332.743154870473560.256845129526440
12433.46006410994504-0.460064109945035
12543.056352051154950.943647948845047
12631.182956383277631.81704361672237
12743.653252784815440.346747215184564
12834.27845485329416-1.27845485329416
12946.35633489063803-2.35633489063803
13011.48994020298125-0.489940202981251
13143.460064109945040.539935890054964
13233.26724431883005-0.267244318830050
13342.463702980065171.53629701993483
13442.410284780788701.58971521921130
13544.36365123249414-0.363651232494137
13633.03176878280207-0.0317687828020683
13734.46536890166213-1.46536890166213
13832.326270704425410.673729295574589
13943.640850083080390.359149916919610
14035.03176281901526-2.03176281901526
14132.514838832969700.485161167030297
14233.39779691892162-0.397796918921617
14343.309251357011700.690748642988304
14423.27186486515616-1.27186486515616
14533.18295041949082-0.182950419490822
14634.82549109766627-1.82549109766627
14732.675497727601010.324502272398989
14832.833959561605560.166040438394438
14932.900847298955090.0991527010449129
15042.057339691147741.94266030885226
15132.490255564616820.509744435383182
15244.80846784960512-0.808467849605116
15333.15746467127719-0.157464671277189
15442.556845871151351.44315412884865
15535.36768466059506-2.36768466059506
15632.779974020997680.220025979002319


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.05334342991601430.1066868598320290.946656570083986
130.01743936699813790.03487873399627570.982560633001862
140.02485817119769150.04971634239538290.975141828802308
150.008727142040480260.01745428408096050.99127285795952
160.005563781374947840.01112756274989570.994436218625052
170.006262212425308340.01252442485061670.993737787574692
180.002775563080306080.005551126160612160.997224436919694
190.001228796757972830.002457593515945660.998771203242027
200.0004640898246372810.0009281796492745630.999535910175363
210.002041521255631250.00408304251126250.997958478744369
220.01036389802192500.02072779604384990.989636101978075
230.008635672390980220.01727134478196040.99136432760902
240.006109235029060980.01221847005812200.993890764970939
250.00338207399066980.00676414798133960.99661792600933
260.003057389913616260.006114779827232510.996942610086384
270.002384121813441040.004768243626882080.997615878186559
280.002055045021862140.004110090043724280.997944954978138
290.001176770983002740.002353541966005480.998823229016997
300.0008223643939242120.001644728787848420.999177635606076
310.0005492792153540250.001098558430708050.999450720784646
320.0005087984983704510.001017596996740900.99949120150163
330.0006137396096545130.001227479219309030.999386260390346
340.0005829678747043280.001165935749408660.999417032125296
350.0007642252926387970.001528450585277590.999235774707361
360.0007904624863408080.001580924972681620.99920953751366
370.0008621939558745830.001724387911749170.999137806044125
380.001369135882643560.002738271765287120.998630864117356
390.003075876984335120.006151753968670240.996924123015665
400.03265897314644250.0653179462928850.967341026853557
410.4008681663014730.8017363326029460.599131833698527
420.9997538086348280.0004923827303445920.000246191365172296
430.999983151709673.36965806609238e-051.68482903304619e-05
440.99999609919387.80161240151947e-063.90080620075973e-06
450.9999948055925541.03888148924719e-055.19440744623593e-06
460.9999935072662131.29854675744658e-056.4927337872329e-06
470.9999959869042388.02619152315625e-064.01309576157812e-06
480.9999929004828031.41990343938368e-057.09951719691839e-06
490.9999930204611361.39590777280158e-056.97953886400791e-06
500.9999886451511322.2709697736734e-051.1354848868367e-05
510.9999844732580573.10534838870089e-051.55267419435045e-05
520.9999936195519841.27608960323095e-056.38044801615475e-06
530.9999914881092071.70237815854708e-058.5118907927354e-06
540.9999896296102232.07407795542818e-051.03703897771409e-05
550.9999894398511552.11202976903845e-051.05601488451922e-05
560.9999858643930792.82712138424194e-051.41356069212097e-05
570.9999824321792253.51356415501308e-051.75678207750654e-05
580.9999716215034535.67569930943644e-052.83784965471822e-05
590.999989529849472.09403010613926e-051.04701505306963e-05
600.9999984491876763.10162464780139e-061.55081232390069e-06
610.9999984464892433.10702151421813e-061.55351075710907e-06
620.9999976191039054.76179219081849e-062.38089609540924e-06
630.9999985123253862.97534922826259e-061.48767461413130e-06
640.999998356085673.28782865935373e-061.64391432967686e-06
650.9999978598326944.28033461108889e-062.14016730554445e-06
660.999996186335857.62732829980064e-063.81366414990032e-06
670.9999965705743226.8588513560866e-063.4294256780433e-06
680.9999950155236959.9689526109255e-064.98447630546275e-06
690.999991953554941.60928901209039e-058.04644506045194e-06
700.9999964326335687.13473286499744e-063.56736643249872e-06
710.9999941495909051.1700818188996e-055.850409094498e-06
720.9999901387243581.97225512838829e-059.86127564194144e-06
730.9999856576988842.86846022310108e-051.43423011155054e-05
740.9999917267218761.65465562483211e-058.27327812416055e-06
750.9999888143850362.23712299277285e-051.11856149638642e-05
760.9999956074292268.78514154753947e-064.39257077376973e-06
770.9999933590643321.32818713351153e-056.64093566755764e-06
780.9999950081068549.9837862921105e-064.99189314605525e-06
790.9999964492814087.1014371835832e-063.5507185917916e-06
800.9999981957075563.60858488824148e-061.80429244412074e-06
810.9999998606514362.78697127330956e-071.39348563665478e-07
820.9999999989419672.11606596973921e-091.05803298486961e-09
830.9999999993018081.39638399402073e-096.98191997010366e-10
840.9999999994937531.01249390819751e-095.06246954098756e-10
850.9999999990561511.88769707608614e-099.43848538043069e-10
860.9999999995434979.1300640282551e-104.56503201412755e-10
870.9999999998740852.51829922612369e-101.25914961306184e-10
880.9999999999949421.01153259957115e-115.05766299785576e-12
890.9999999999906311.8737570422458e-119.368785211229e-12
900.9999999999799364.0128189918622e-112.0064094959311e-11
910.9999999999865542.6891733364626e-111.3445866682313e-11
920.9999999999660826.783644897242e-113.391822448621e-11
930.999999999925451.49101845592559e-107.45509227962793e-11
940.9999999998185793.62842767286198e-101.81421383643099e-10
950.9999999995882158.23570539624442e-104.11785269812221e-10
960.9999999993316231.33675322488615e-096.68376612443075e-10
970.9999999999991681.66334659404346e-128.31673297021728e-13
980.9999999999977874.4265896809772e-122.2132948404886e-12
990.9999999999945711.08570659679548e-115.42853298397742e-12
1000.9999999999852752.94505112022479e-111.47252556011239e-11
1010.9999999999646497.070242064539e-113.5351210322695e-11
1020.9999999999089151.82170985746861e-109.10854928734304e-11
1030.999999999842933.14139099820627e-101.57069549910313e-10
1040.9999999997629264.74147656508791e-102.37073828254395e-10
1050.9999999998081163.83767621414964e-101.91883810707482e-10
1060.9999999995526178.94765236496539e-104.47382618248269e-10
1070.9999999994765181.04696378805167e-095.23481894025837e-10
1080.9999999990789111.84217760803723e-099.21088804018616e-10
1090.9999999978488464.30230815310365e-092.15115407655182e-09
1100.99999999973125.37600013387153e-102.68800006693576e-10
1110.9999999994276451.14471035885304e-095.72355179426518e-10
1120.9999999986869352.62613036374892e-091.31306518187446e-09
1130.9999999972379375.52412592831873e-092.76206296415936e-09
1140.9999999940940881.18118235505390e-085.90591177526948e-09
1150.9999999875782422.48435154251054e-081.24217577125527e-08
1160.999999975174824.96503611386481e-082.48251805693241e-08
1170.9999999527677679.44644669506648e-084.72322334753324e-08
1180.999999941790431.16419141759578e-075.82095708797889e-08
1190.999999874424662.5115068053868e-071.2557534026934e-07
1200.9999996941144356.11771130662753e-073.05885565331376e-07
1210.9999995319168089.36166383230297e-074.68083191615148e-07
1220.9999988954606152.20907877075577e-061.10453938537788e-06
1230.9999975651082534.86978349488229e-062.43489174744114e-06
1240.9999959293831458.141233710448e-064.070616855224e-06
1250.9999905356833381.89286333234370e-059.46431666171852e-06
1260.9999846193828943.07612342119976e-051.53806171059988e-05
1270.9999685249507326.29500985360561e-053.14750492680280e-05
1280.999938886650440.0001222266991187166.1113349559358e-05
1290.9998956453241980.0002087093516050830.000104354675802541
1300.9999530669557069.3866088587614e-054.6933044293807e-05
1310.9999209310484320.0001581379031367497.90689515683743e-05
1320.9998173162872870.000365367425425990.000182683712712995
1330.9997210449295320.0005579101409356940.000278955070467847
1340.9997193688407760.0005612623184486830.000280631159224341
1350.9997328288949650.0005343422100708150.000267171105035408
1360.9994082662834130.001183467433173650.000591733716586824
1370.9989731955122650.002053608975469970.00102680448773499
1380.9986928651037730.002614269792454570.00130713489622729
1390.9975923133808870.004815373238226320.00240768661911316
1400.9942141465046980.01157170699060500.00578585349530252
1410.987501115208780.02499776958243880.0124988847912194
1420.9683165192426130.06336696151477360.0316834807573868
1430.9244682364261220.1510635271477550.0755317635738777
1440.8800283608133490.2399432783733030.119971639186651


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1170.8796992481203NOK
5% type I error level1270.954887218045113NOK
10% type I error level1290.969924812030075NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/10b3cb1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/10b3cb1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/142fh1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/142fh1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/242fh1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/242fh1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/3wbe21291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/3wbe21291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/4wbe21291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/4wbe21291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/5wbe21291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/5wbe21291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/67kvn1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/67kvn1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/7icvq1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/7icvq1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/8icvq1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/8icvq1291333157.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/9icvq1291333157.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291333068432yg75ib50etzw/9icvq1291333157.ps (open in new window)


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