Home » date » 2010 » Dec » 02 »

*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 16:58:13 +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/02/t1291309251oi8x0vqgpp1qtlp.htm/, Retrieved Thu, 02 Dec 2010 18:00:51 +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/02/t1291309251oi8x0vqgpp1qtlp.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 «
1 1 4 4 3 1 21 2 4 1 3 3 1 1 21 1 5 2 2 3 2 1 24 1 2 1 4 5 4 2 21 1 1 1 3 4 1 2 21 2 1 1 5 4 2 22 2 2 1 3 5 3 2 22 1 1 1 5 5 1 1 20 2 1 1 3 3 1 1 21 1 1 1 4 4 3 21 2 3 2 5 5 5 2 21 1 1 1 3 3 3 1 22 2 1 1 3 4 1 1 22 1 1 1 4 4 2 1 23 2 2 1 4 4 2 1 23 2 4 2 4 4 5 2 21 2 1 1 3 5 2 2 24 1 1 1 5 3 2 1 23 1 1 1 4 5 2 2 21 1 2 1 3 3 2 1 23 1 3 1 3 4 3 2 32 2 1 1 3 4 3 1 21 2 1 2 3 4 3 2 21 1 1 1 4 3 1 2 21 1 1 2 5 5 1 1 21 2 1 1 4 4 4 2 21 2 2 4 5 5 1 1 20 2 1 1 3 2 3 1 24 2 1 1 4 5 2 1 22 2 1 1 2 4 1 2 22 2 1 1 5 5 2 2 21 1 1 1 2 4 1 2 21 1 1 1 3 5 2 1 21 2 1 1 3 3 1 2 21 1 1 1 3 3 1 1 23 2 1 1 3 4 1 1 23 2 1 1 4 4 1 2 21 2 1 1 3 5 3 1 20 1 1 1 5 5 3 2 21 2 1 1 2 3 1 1 20 1 1 1 3 5 3 2 21 1 1 1 3 5 1 1 22 2 4 1 4 4 2 2 21 1 1 1 5 5 3 1 22 2 1 1 3 3 2 1 22 2 4 3 3 4 1 2 22 1 2 2 3 5 1 1 22 1 2 1 3 3 1 1 21 2 1 1 3 5 1 1 21 2 1 1 3 4 1 2 21 1 2 2 3 3 3 1 23 2 1 1 4 5 2 2 23 2 1 1 3 4 2 2 23 1 1 1 2 5 2 1 22 1 1 1 3 3 4 1 24 2 1 1 3 5 3 1 23 2 1 1 3 4 3 2 21 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
X1[t] = + 31.7133444903618 -0.888380446729087X2[t] -0.911256916123055X3[t] -0.934267347790764X4[t] -0.857698947974369X5[t] -0.73976811275555X6[t] -0.825774142894657X7[t] -0.206548035295779X8[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)31.71334449036181.39492922.734700
X2-0.8883804467290870.096796-9.177900
X3-0.9112569161230550.097993-9.299200
X4-0.9342673477907640.092033-10.151400
X5-0.8576989479743690.045692-18.771200
X6-0.739768112755550.112197-6.593500
X7-0.8257741428946570.091381-9.036700
X8-0.2065480352957790.482639-0.4280.6692890.334645


Multiple Linear Regression - Regression Statistics
Multiple R0.883180283143714
R-squared0.780007412533811
Adjusted R-squared0.769876174953131
F-TEST (value)76.9903386750383
F-TEST (DF numerator)7
F-TEST (DF denominator)152
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.78385098401767
Sum Squared Residuals2176.26429692623


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
112.37564895991937-1.37564895991937
246.14311915507773-2.14311915507773
352.830974247813362.16902575218664
420.05046258669448261.94953741330552
514.26253565923562-3.26253565923562
612.47666933890264-1.47666933890264
712.66649797142566-1.66649797142566
814.26973280413983-3.26973280413983
917.95501355998322-6.95501355998322
101-0.6696396366674591.66963963666746
1151.062854782111813.93714521788819
1233.99892979487694-0.998929794876938
1335.67283129314951-2.67283129314951
1442.338333173401881.66166682659812
1540.4802368523167863.51976314768321
1641.211467116085352.78853288391465
1731.223528686557871.77647131344213
1854.792255875781170.207744124218827
1942.970851387586321.02914861241368
2033.14070758999186-0.140707589991859
213-6.40070747938669.4007074793866
2233.76170026082644-0.761700260826441
2333.77374906108701-0.773749061087005
2446.27809530476642-2.27809530476642
2554.902381681639240.097618318360758
2640.6773057834264053.32269421657359
2755.76008062961361-0.760080629613611
2833.17191234565729-0.171912345657287
2943.133425817541820.86657418245818
3023.9987958326032-1.9987958326032
3153.796625530480971.20337446951903
3225.59626289333312-3.59626289333312
3333.99112476551619-0.991124765516188
3436.4846433400622-3.4846433400622
3534.96374467914868-1.96374467914868
3634.07536423241959-1.07536423241959
3744.85649478057757-0.856494780577566
3834.67733491012305-1.67733491012305
3952.145600501602372.85439949839763
4028.27660963582733-6.27660963582733
4132.885368614357920.114631385642081
4231.567360304980901.43263969501910
4344.68500597721006-0.68500597721006
4452.222168901418762.77783109858124
4532.019768211724460.980231788275538
4633.70624176716831-0.706241767168311
4733.95867670352577-0.958676703525767
4836.67914257509741-3.67914257509741
4934.90238168163924-1.90238168163924
5034.56394071514268-1.56394071514268
5133.14123084690257-0.141230846902569
5241.341459521776692.65854047822331
5332.969608081261320.0303919187386763
5423.87319393029737-1.87319393029737
5531.372274982805151.62772501719485
5631.364469953444401.63553004655560
5732.20820680543680.791793194563202
5842.961937014174311.03806298582569
5924.73856394535875-2.73856394535875
6052.885368614357922.11463138564208
6144.60982761620436-0.609827616204356
6225.64214979439479-3.64214979439479
6324.77048875043846-2.77048875043846
6433.28275820092964-0.282758200929639
6542.176282000357091.82371799964291
6651.287901553628003.712098446372
6734.93306318039396-1.93306318039396
6835.73543759698394-2.73543759698394
6943.021408891160180.978591108839819
7034.05248776302562-1.05248776302562
7144.70788244660403-0.707882446604029
7232.939060544780350.0609394552196528
7332.058351165138270.941648834861732
7444.87950521224528-0.879505212245275
7523.95743339720077-1.95743339720077
7623.95743339720077-1.95743339720077
7743.042506027106490.957493972893511
7823.94523786445451-1.94523786445451
7946.5612117398786-2.5612117398786
8034.00017310120193-1.00017310120193
8153.819635962148681.18036403785132
8235.79076212836833-2.79076212836833
8335.56133762367858-2.56133762367858
8444.93306318039396-0.933063180393961
8533.08753891648014-0.0875389164801413
8634.76157437702646-1.76157437702646
8743.991124765516190.00887523448381165
8834.93306318039396-1.93306318039396
8932.557755316994760.442244683005242
9035.79076212836833-2.79076212836833
9127.5675230218265-5.5675230218265
9242.027669666383551.97233033361645
9332.732378547210830.267621452789174
9451.287901553628003.712098446372
9532.284775205253190.715224794746806
9652.168610933270082.83138906672992
9741.40478587502542.5952141249746
9833.91469032797353-0.914690327973533
9936.53053024112388-3.53053024112388
10054.902381681639240.097618318360758
10141.232577022243612.76742297775639
10231.897690030904171.10230996909583
10350.1575245450378914.84247545496211
1044-0.3738044118983084.37380441189831
10524.68500597721006-2.68500597721006
10653.968114333848481.03188566615152
10742.370257978481591.62974202151841
10826.53053024112388-4.53053024112388
10926.53833527048463-4.53833527048463
11055.4744466209335-0.474446620933496
11141.852161463561502.14783853643850
11245.29858008439244-1.29858008439244
11326.54649863356439-4.54649863356439
11454.436356670758810.56364332924119
11543.777534690993220.222465309006783
116419.7286004117406-15.7286004117406
1171-0.9560944228103191.95609442281032
11835.56128901813658-2.56128901813658
11915.21108328739417-4.21108328739417
12012.82793626805588-1.82793626805588
121120.6557608275857-19.6557608275857
1221-1.279976277848362.27997627784836
12310.9004652310764880.0995347689235117
12414.56257664818728-3.56257664818728
12511.67268140582246-0.672681405822456
126219.843094768985-17.843094768985
1272118.73433815325192.26566184674808
1282320.49424568166362.5057543183364
1292118.70227938589852.29772061410153
1302114.55092149666826.44907850333182
1312016.10892664750513.89107335249488
1322117.22601154950973.77398845049033
1332422.26633597260961.73366402739041
1342316.23752901438586.76247098561423
1352218.81077259079463.18922740920543
1362119.71296840101991.28703159898007
1372221.55724935860880.442750641391246
1382121.4501334223114-0.450133422311382
1392116.33397341902134.66602658097869
1402117.36629559721173.63370440278825
1412218.27755251333483.7224474866652
1422018.92870342601341.07129657398661
1432117.19042906067073.80957093932931
1442119.01732062609041.98267937390965
1452217.92100210525484.0789978947452
1462119.68104359594021.31895640405978
1472320.52492718041832.47507281958168
1482319.75323426258313.24676573741694
1492419.58298876554064.41701123445945
1503220.786799747098511.2132002529015
1512218.99568746302143.00431253697862
1522220.74091284603681.25908715396319
1532019.07140185114970.928598148850251
1542120.78679974709850.213200252901513
1552319.66847153876893.33152846123106
1562120.52492718041830.475072819581682
1572123.2726472545575-2.27264725455749
1582318.99483345133344.00516654866664
1592420.76340002079383.23659997920619
1602219.01732062609042.98267937390965


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.1554639513810500.3109279027620990.84453604861895
120.1109128955327630.2218257910655260.889087104467237
130.04958615634422770.09917231268845550.950413843655772
140.02084048629510320.04168097259020640.979159513704897
150.01079522349712230.02159044699424450.989204776502878
160.004197091201798880.008394182403597750.995802908798201
170.001540236361641840.003080472723283670.998459763638358
180.0007252663821437970.001450532764287590.999274733617856
190.0003927656439605460.0007855312879210910.99960723435604
200.0002665502999691110.0005331005999382230.99973344970003
210.0001432015833439660.0002864031666879330.999856798416656
225.15532690979813e-050.0001031065381959630.999948446730902
231.89879780348999e-053.79759560697997e-050.999981012021965
241.27962791659137e-052.55925583318273e-050.999987203720834
256.17040342322235e-061.23408068464447e-050.999993829596577
266.91560578102104e-061.38312115620421e-050.999993084394219
273.02233855638431e-066.04467711276863e-060.999996977661444
281.10529244638445e-062.21058489276891e-060.999998894707554
293.68633496957395e-077.3726699391479e-070.999999631366503
303.0121984190711e-076.0243968381422e-070.999999698780158
311.81429955987243e-073.62859911974486e-070.999999818570044
321.43003224228268e-072.86006448456536e-070.999999856996776
337.04116255306589e-081.40823251061318e-070.999999929588374
342.39830634811741e-084.79661269623483e-080.999999976016936
359.1127957400767e-091.82255914801534e-080.999999990887204
363.54808022550136e-097.09616045100272e-090.99999999645192
371.47668488418799e-092.95336976837597e-090.999999998523315
387.3700595096255e-101.4740119019251e-090.999999999262994
395.17398374010846e-101.03479674802169e-090.999999999482602
403.68018105661827e-107.36036211323654e-100.999999999631982
411.48381760372402e-102.96763520744803e-100.999999999851618
426.51923087821082e-111.30384617564216e-100.999999999934808
432.46061006394588e-114.92122012789176e-110.999999999975394
441.22872381096429e-112.45744762192859e-110.999999999987713
453.86012132249383e-127.72024264498766e-120.99999999999614
461.21831008163146e-122.43662016326291e-120.999999999998782
475.24936227917484e-131.04987245583497e-120.999999999999475
481.98319984199235e-133.96639968398469e-130.999999999999802
497.90931989288633e-141.58186397857727e-130.99999999999992
502.34353607295710e-144.68707214591419e-140.999999999999977
517.63046900492085e-151.52609380098417e-140.999999999999992
522.42759349231032e-154.85518698462063e-150.999999999999998
537.40934870769284e-161.48186974153857e-151
541.00412145078997e-152.00824290157994e-151
553.06840316468986e-166.13680632937972e-161
561.11866139961425e-162.23732279922850e-161
573.27413330754563e-176.54826661509127e-171
581.04731399008913e-172.09462798017825e-171
595.517589434278e-181.1035178868556e-171
604.66157955337024e-189.32315910674048e-181
611.48318597733071e-182.96637195466143e-181
621.48449770582779e-182.96899541165558e-181
637.11670164579306e-191.42334032915861e-181
642.23543556722614e-194.47087113445227e-191
657.64658781243808e-201.52931756248762e-191
665.34775044247164e-201.06955008849433e-191
671.71461233651706e-203.42922467303412e-201
684.53300427593439e-219.06600855186879e-211
691.45665275687773e-212.91330551375546e-211
704.45971830417149e-228.91943660834298e-221
711.47471749569893e-222.94943499139785e-221
725.41033635344792e-231.08206727068958e-221
731.64897805869278e-233.29795611738555e-231
745.3593302638376e-241.07186605276752e-231
753.03453001264190e-246.06906002528381e-241
761.59785301529071e-243.19570603058141e-241
777.14020622664366e-251.42804124532873e-241
784.3276392162937e-258.6552784325874e-251
791.75651896493056e-253.51303792986113e-251
805.4266878613196e-261.08533757226392e-251
813.35040923086611e-266.70081846173221e-261
821.11104193468001e-262.22208386936003e-261
833.95423287638295e-277.9084657527659e-271
841.50541602382247e-273.01083204764494e-271
854.16409304432627e-288.32818608865254e-281
861.09752245291131e-282.19504490582262e-281
872.81426876966845e-295.62853753933689e-291
889.3538254970244e-301.87076509940488e-291
892.65851745962428e-305.31703491924856e-301
909.89962008969118e-311.97992401793824e-301
911.26997242195615e-302.53994484391231e-301
923.81353175232462e-317.62706350464924e-311
931.00921317444842e-312.01842634889683e-311
946.12268790970224e-321.22453758194045e-311
951.79345096663399e-323.58690193326799e-321
966.05303839435888e-331.21060767887178e-321
974.63161064696674e-339.26322129393349e-331
981.87582738675623e-333.75165477351246e-331
994.22793814228283e-348.45587628456566e-341
1003.11270941433688e-346.22541882867376e-341
1011.32953161950206e-342.65906323900412e-341
1025.05185468252413e-351.01037093650483e-341
1033.66185528842847e-357.32371057685693e-351
1048.2497565979814e-361.64995131959628e-351
1053.79435166114653e-367.58870332229307e-361
1063.21236919651021e-366.42473839302043e-361
1078.9274092961232e-371.78548185922464e-361
1084.10109031187917e-378.20218062375834e-371
1099.70524758501e-381.941049517002e-371
1101.21508271972970e-372.43016543945940e-371
1111.04190643431426e-372.08381286862852e-371
1122.96229609787904e-385.92459219575807e-381
1131.08278835334840e-382.16557670669681e-381
1141.23635198924795e-382.47270397849591e-381
1151.36257660419212e-382.72515320838424e-381
1162.10202111180223e-384.20404222360445e-381
1175.91740691012132e-381.18348138202426e-371
1182.33536847214855e-384.67073694429709e-381
1191.69987175204676e-383.39974350409352e-381
1203.4662425336193e-396.9324850672386e-391
1215.46170252921793e-311.09234050584359e-301
1224.07105411588352e-288.14210823176704e-281
1231.68196470622117e-283.36392941244234e-281
1245.59561503083533e-291.11912300616707e-281
1251.9276568801026e-293.8553137602052e-291
1266.1598099702658e-091.23196199405316e-080.99999999384019
1270.1409128423852900.2818256847705800.85908715761471
1280.6309127612621450.738174477475710.369087238737855
1290.7968615974872090.4062768050255830.203138402512791
1300.880290378019280.2394192439614410.119709621980721
1310.90172493070980.1965501385803980.0982750692901991
1320.9164808327959250.1670383344081510.0835191672040753
1330.9184180460249840.1631639079500320.0815819539750162
1340.9395433922989160.1209132154021680.0604566077010838
1350.9267545113545930.1464909772908140.073245488645407
1360.908511375848740.1829772483025190.0914886241512593
1370.8772143780048450.2455712439903090.122785621995155
1380.8416974893689130.3166050212621730.158302510631087
1390.8042233077004780.3915533845990450.195776692299522
1400.7571472033600910.4857055932798180.242852796639909
1410.6960614326779430.6078771346441140.303938567322057
1420.7518968687811450.496206262437710.248103131218855
1430.6797923703338060.6404152593323880.320207629666194
1440.5872048076671480.8255903846657030.412795192332852
1450.5068548627796150.986290274440770.493145137220385
1460.4022261738731650.804452347746330.597773826126835
1470.305596541144930.611193082289860.69440345885507
1480.2025356818772860.4050713637545720.797464318122714
1490.1662394035340380.3324788070680760.833760596465962


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1110.798561151079137NOK
5% type I error level1130.81294964028777NOK
10% type I error level1140.820143884892086NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/10gzil1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/10gzil1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/1sy2r1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/1sy2r1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/2sy2r1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/2sy2r1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/3k8kc1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/3k8kc1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/4k8kc1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/4k8kc1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/5k8kc1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/5k8kc1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/6vhjx1291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/6vhjx1291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/7oqi01291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/7oqi01291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/8oqi01291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/8oqi01291309082.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/9oqi01291309082.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291309251oi8x0vqgpp1qtlp/9oqi01291309082.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