Home » date » 2010 » Dec » 22 »

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 22 Dec 2010 20:33: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/22/t1293049903mtwrrzaw87vwk3j.htm/, Retrieved Wed, 22 Dec 2010 21:31:46 +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/22/t1293049903mtwrrzaw87vwk3j.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 «
5 4 3 2 12 4 4 3 2 11 5 5 5 2 15 2 2 2 1 6 4 5 4 2 13 3 3 4 2 10 5 3 4 2 12 5 5 4 2 14 4 3 5 2 12 3 3 2 6 2 4 4 1 10 4 4 4 2 12 4 4 4 1 12 4 3 4 2 11 5 5 5 2 15 5 4 3 1 12 4 4 2 1 10 4 4 4 2 12 4 4 3 1 11 4 4 4 2 12 4 4 3 1 11 4 4 4 2 12 5 4 4 2 13 3 4 4 2 11 5 4 1 9 4 4 5 2 13 4 3 3 1 10 5 5 4 2 14 4 4 4 2 12 3 4 3 1 10 4 4 4 2 12 4 2 2 1 8 4 3 3 2 10 4 4 4 2 12 4 4 4 1 12 2 2 3 1 7 3 3 1 6 4 4 4 1 12 3 4 3 2 10 4 3 3 1 10 2 4 4 1 10 4 4 4 2 12 5 5 5 1 15 4 3 3 1 10 4 4 2 2 10 4 4 4 2 12 5 4 4 2 13 3 4 4 2 11 4 4 3 2 11 4 4 4 1 12 5 5 4 2 14 3 3 4 1 10 4 4 4 1 12 5 4 4 2 13 2 1 2 1 5 2 2 2 2 6 4 4 4 2 12 4 4 4 2 12 4 3 4 1 11 4 3 3 2 10 2 2 3 1 7 4 4 4 1 12 5 5 4 2 14 3 4 4 2 11 4 4 4 2 12 5 4 4 1 13 5 5 4 2 14 4 4 3 1 11 4 4 4 2 12 4 4 4 1 12 2 3 3 1 8 3 4 4 2 11 5 5 4 2 14 4 5 5 1 14 4 4 4 1 12 3 2 4 2 9 4 4 5 2 13 3 4 4 2 11 4 4 4 1 12 4 4 4 1 12 4 4 4 1 12 4 4 4 1 12 4 4 4 2 12 4 4 4 1 12 4 4 3 2 11 3 4 3 2 10 4 3 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 time7 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk
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
PCCS [t] = + 3.81711992673291 + 1.40873728291067CCS[t] -0.0100990965644928CHCS[t] -0.247946566002252AORT[t] -0.380978135850004G[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.817119926732910.8888984.29423.1e-051.5e-05
CCS1.408737282910670.1759478.006600
CHCS-0.01009909656449280.048768-0.20710.8362140.418107
AORT-0.2479465660022520.066991-3.70120.0002970.000148
G-0.3809781358500040.064076-5.945700


Multiple Linear Regression - Regression Statistics
Multiple R0.628911596512203
R-squared0.395529796227527
Adjusted R-squared0.380129281481732
F-TEST (value)25.6828945497105
F-TEST (DF numerator)4
F-TEST (DF denominator)157
p-value2.22044604925031e-16
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.65775037263514
Sum Squared Residuals431.457398781596


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1129.314613985321562.68538601467844
2117.905876702410883.09412329758912
3158.808621756752556.19137824324745
465.737525031570770.262474968429231
5137.647831039844135.35216896015587
6106.259291950062443.74070804993756
7129.076766515883792.92323348411621
8149.05656832275484.9434316772452
9127.420082666970874.57991733302913
1025.23127253866693-3.23127253866693
1145.35394474761535-1.35394474761535
1244.34404190991309-0.344041909913094
1344.59198847591535-0.591988475915345
1453.316282762852421.68371723714758
1554.599745688709270.400254311290735
1644.60208757247984-0.602087572479838
1745.37414294074434-1.37414294074434
1844.34404190991309-0.344041909913094
1944.98306570832984-0.983065708329842
2044.34404190991309-0.344041909913094
2144.98306570832984-0.983065708329842
2254.344041909913090.655958090086907
2333.96306377406309-0.96306377406309
2454.72502004576310.274979954236904
2545.68653832439084-1.68653832439084
2636.09339024672801-3.09339024672801
2753.648876339627911.35112366037209
2844.43670639781508-0.436706397815085
2945.31357766566959-1.31357766566959
3044.02985447547791-0.0298544754779104
3124.93259952981959-2.93259952981959
3233.11701032457174-0.11701032457174
3344.01975537891342-0.0197553789134175
3444.93259952981959-0.932599529819588
3525.70465489808409-3.70465489808409
3635.15467230933467-2.15467230933467
3742.649563822847611.35043617715239
3832.83691580946290.163084190537096
3934.39888285535032-1.39888285535032
4043.105060568594140.894939431405859
4142.609167436589641.39083256341036
4253.368781824519071.63121817548093
4332.939650089617180.0603499103828226
4422.60916743658964-0.609167436589638
4544.01790471950031-0.017904719500312
4643.749759960369070.250240039630925
4744.23555399580909-0.235553995809086
4834.00780562293582-1.00780562293582
4944.00780562293582-0.00780562293581912
5041.96004454160842.0399554583916
5144.6064330350946-0.606433035094596
5242.609167436589641.39083256341036
5342.34102267745841.6589773225416
5425.62643496936135-3.62643496936135
5523.91751232311661-1.91751232311661
5644.05830110575828-0.0583011057582832
5743.997706526371330.00229347362867353
5844.37868466222133-0.37868466222133
5932.980046475875150.0199535241248514
6035.27575412320482-2.27575412320482
6142.639464726283121.36053527371688
6241.96004454160842.0399554583916
6344.22545489924459-0.225454899244593
6444.00780562293582-0.00780562293581912
6543.749759960369070.250240039630925
6641.94994544504392.0500545549561
6733.97750833324234-0.977508333242341
6842.599068340025141.40093165997485
6943.997706526371330.00229347362867353
7033.46584051131516-0.46584051131516
7142.877312195720871.12268780427913
7243.378880921083560.621119078916436
7353.596530197392341.40346980260766
7442.568771050331671.43122894966833
7543.598872081162910.401127918837089
7654.028003816064810.971996183935195
7744.23555399580909-0.235553995809086
7844.00780562293582-0.00780562293581912
7942.588969243460651.41103075653935
8042.588969243460651.41103075653935
8142.588969243460651.41103075653935
8242.588969243460651.41103075653935
8343.997706526371330.00229347362867353
8432.588969243460650.411030756539348
8534.25575218893807-1.25575218893807
8624.39888285535032-2.39888285535031
8742.619266533154131.38073346684587
8843.997706526371330.00229347362867353
8943.997706526371330.00229347362867353
9034.62663122822358-1.62663122822358
9153.399079114212551.60092088578745
9243.967409236677850.0325907633221519
9343.997706526371330.00229347362867353
9443.997706526371330.00229347362867353
9523.99770652637133-1.99770652637133
9643.769958153498060.23004184650194
9724.36858556565684-2.36858556565684
9844.02800381606481-0.0280038160648048
9943.084862375465160.915137624534844
10041.980242734737382.01975726526262
10133.97750833324234-0.977508333242341
10251.970143638172893.02985636182711
10333.96740923667785-0.967409236677848
10432.599068340025150.400931659974855
10544.00780562293582-0.00780562293581912
10642.588969243460651.41103075653935
10743.997706526371330.00229347362867353
10842.969947379310661.03005262068934
10913.09496147202965-2.09496147202965
11044.04820200919379-0.0482020091937904
11143.368781824519070.631218175480929
11233.97750833324234-0.977508333242341
11344.38878375878582-0.388783758785823
11443.094961472029650.905038527970351
11543.769958153498060.23004184650194
11631.94994544504391.0500545549561
11745.24545683351134-1.24545683351134
11834.0381029126293-1.0381029126293
11944.00780562293582-0.00780562293581912
12033.99770652637133-0.997706526371327
12143.759859056933570.240140943066433
12243.987607429806830.0123925701931664
12343.368781824519070.631218175480929
12443.729561767240090.270438232759911
12553.358682727954581.64131727204542
12644.5963339385301-0.596333938530103
12732.609167436589640.390832563410362
12824.38878375878582-2.38878375878582
12934.02800381606481-1.02800381606481
13034.25575218893807-1.25575218893807
13132.609167436589640.390832563410362
13223.36102461172515-1.36102461172515
13334.0381029126293-1.0381029126293
13442.599068340025141.40093165997485
13542.588969243460651.41103075653935
13624.37868466222133-2.37868466222133
13732.619266533154130.380733466845869
13832.84701490602740.152985093972603
13934.89477598735482-1.89477598735482
14044.9149741804838-0.914974180483804
14123.38122280485414-1.38122280485414
14234.5339960446338-1.5339960446338
14351.990341831301883.00965816869812
14444.2153558026801-0.2153558026801
14523.09496147202965-1.09496147202965
14643.790156346627050.209843653372954
14743.987607429806830.0123925701931664
14842.588969243460651.41103075653935
14943.465840511315160.534159488684841
15023.62916937085639-1.62916937085639
15143.800255443191540.199744556808461
15234.74956370150684-1.74956370150684
15323.87711593685864-1.87711593685864
15434.93517237361279-1.93517237361279
15534.9149741804838-1.9149741804838
15653.409178210777041.59082178922296
15725.22525864038236-3.22525864038236
15824.43927924160829-2.43927924160829
15934.02800381606481-1.02800381606481
16045.26565502664033-1.26565502664033
16134.9149741804838-1.9149741804838
16233.79015634662705-0.790156346627046


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
81.21428466663986e-462.42856933327971e-461
99.72401155657777e-621.94480231131555e-611
100.029062730325160.058125460650320.97093726967484
110.9733372724823940.05332545503521280.0266627275176064
120.9762109080327940.04757818393441280.0237890919672064
130.9884250666905360.02314986661892810.011574933309464
140.9941807410539720.01163851789205670.00581925894602837
150.9898599419585730.02028011608285380.0101400580414269
160.9968631238257610.006273752348477550.00313687617423877
170.997182389337640.005635221324720590.0028176106623603
180.9963272278376040.007345544324792110.00367277216239605
190.9948879060723020.01022418785539490.00511209392769746
200.9934953356760220.01300932864795530.00650466432397766
210.9911457302163240.01770853956735170.00885426978367586
220.986880926134730.02623814773053810.0131190738652691
230.9960214907964940.007957018407011470.00397850920350573
240.9958301137304830.008339772539034680.00416988626951734
250.9999913228992251.73542015507761e-058.67710077538803e-06
260.9999998519167442.96166511527877e-071.48083255763939e-07
270.999999999437661.1246816272245e-095.62340813612249e-10
280.99999999886352.2729996830664e-091.1364998415332e-09
290.9999999993363141.32737233286993e-096.63686166434965e-10
300.9999999994119841.17603231544471e-095.88016157722354e-10
310.9999999999734025.31961083909417e-112.65980541954709e-11
320.999999999960627.87605576346731e-113.93802788173366e-11
330.9999999999124971.75006683240076e-108.75033416200382e-11
340.999999999817663.64679894058352e-101.82339947029176e-10
350.999999999968386.32391423207172e-113.16195711603586e-11
360.99999999995459.09986349273783e-114.54993174636892e-11
370.999999999998542.91968047635638e-121.45984023817819e-12
380.9999999999999983.1149472320037e-151.55747361600185e-15
3911.83785966735159e-169.18929833675794e-17
4014.10677367715446e-162.05338683857723e-16
4117.64031272289909e-163.82015636144954e-16
4211.44285936816876e-157.21429684084381e-16
4311.71423862801823e-158.57119314009114e-16
4418.08675799135246e-164.04337899567623e-16
4511.52844246175317e-157.64221230876587e-16
460.9999999999999983.5841898490094e-151.7920949245047e-15
470.9999999999999984.10463280398183e-152.05231640199091e-15
480.9999999999999983.47133988275581e-151.7356699413779e-15
490.9999999999999967.61956901065666e-153.80978450532833e-15
500.9999999999999983.31960766579632e-151.65980383289816e-15
5111.81711498988295e-159.08557494941473e-16
520.9999999999999992.62746809316963e-151.31373404658481e-15
530.9999999999999983.13697464127366e-151.56848732063683e-15
5416.54826117433778e-183.27413058716889e-18
5514.52733156080127e-182.26366578040063e-18
5611.11353539596407e-175.56767697982035e-18
5712.82525859347071e-171.41262929673536e-17
5814.27121248548555e-172.13560624274278e-17
5911.15221756325757e-165.76108781628786e-17
6013.23960004725349e-171.61980002362674e-17
6114.25220292832256e-172.12610146416128e-17
6213.58271349971884e-171.79135674985942e-17
6318.1422313729339e-174.07111568646694e-17
6412.02169584849665e-161.01084792424832e-16
6515.22016079244816e-162.61008039622408e-16
6615.19282916474025e-162.59641458237012e-16
6716.79131901155856e-163.39565950577928e-16
6811.19145355842847e-155.95726779214236e-16
690.9999999999999992.89222884394136e-151.44611442197068e-15
700.9999999999999976.43015490756988e-153.21507745378494e-15
710.9999999999999941.11808684303058e-145.5904342151529e-15
720.9999999999999872.56604709640991e-141.28302354820496e-14
730.999999999999983.95919058034335e-141.97959529017167e-14
740.9999999999999637.47543850495267e-143.73771925247634e-14
750.9999999999999784.4235366425544e-142.2117683212772e-14
760.9999999999999852.98468569070157e-141.49234284535078e-14
770.999999999999976.179554332207e-143.0897771661035e-14
780.999999999999931.38989390507797e-136.94946952538983e-14
790.9999999999998782.43043275579919e-131.21521637789959e-13
800.9999999999997874.25197253724514e-132.12598626862257e-13
810.999999999999637.417953485012e-133.708976742506e-13
820.9999999999993571.28635864727105e-126.43179323635525e-13
830.9999999999986082.78491398800905e-121.39245699400453e-12
840.9999999999971335.7334231193578e-122.8667115596789e-12
850.9999999999962557.49033165512327e-123.74516582756164e-12
860.999999999998383.23869245703562e-121.61934622851781e-12
870.999999999997415.17903746221495e-122.58951873110748e-12
880.9999999999943111.13779627598971e-115.68898137994855e-12
890.9999999999876522.46969769026866e-111.23484884513433e-11
900.9999999999833063.33885731367904e-111.66942865683952e-11
910.9999999999803553.92907669516658e-111.96453834758329e-11
920.9999999999566388.67230921168988e-114.33615460584494e-11
930.9999999999086461.82708527527122e-109.1354263763561e-11
940.999999999810123.79758450457725e-101.89879225228863e-10
950.9999999999464461.071086039332e-105.35543019665999e-11
960.9999999998832952.33410367279045e-101.16705183639522e-10
970.9999999999477081.0458466621165e-105.2292333105825e-11
980.9999999998916822.16635291488893e-101.08317645744447e-10
990.9999999998260233.47954718708567e-101.73977359354283e-10
1000.99999999972715.45801616220406e-102.72900808110203e-10
1010.9999999996171477.65705396203761e-103.82852698101881e-10
1020.999999999809713.80581200049977e-101.90290600024989e-10
1030.999999999757394.85218148987176e-102.42609074493588e-10
1040.9999999994692551.06148950960751e-095.30744754803753e-10
1050.9999999988457222.30855531471509e-091.15427765735754e-09
1060.999999998095853.80830106235355e-091.90415053117677e-09
1070.9999999958504058.2991905068539e-094.14959525342695e-09
1080.999999995538248.9235194183864e-094.4617597091932e-09
1090.9999999997973984.05203703347885e-102.02601851673943e-10
1100.9999999996158047.68393014411982e-103.84196507205991e-10
1110.9999999991129661.77406815991051e-098.87034079955254e-10
1120.9999999989382572.12348687329033e-091.06174343664516e-09
1130.999999998543062.91387936291309e-091.45693968145655e-09
1140.9999999973158955.36820990152843e-092.68410495076421e-09
1150.9999999942587941.14824109408404e-085.74120547042022e-09
1160.9999999948897151.02205696584199e-085.11028482920996e-09
1170.9999999976062264.7875483148114e-092.3937741574057e-09
1180.9999999954243879.15122631469904e-094.57561315734952e-09
1190.9999999894913582.10172831876253e-081.05086415938126e-08
1200.9999999850635792.98728422690446e-081.49364211345223e-08
1210.9999999654900126.90199765845291e-083.45099882922646e-08
1220.9999999177538451.64492310414121e-078.22461552070603e-08
1230.9999998314713133.37057374587674e-071.68528687293837e-07
1240.9999996036009637.92798073472457e-073.96399036736229e-07
1250.9999993368943521.32621129664098e-066.63105648320488e-07
1260.9999990292830961.94143380708242e-069.70716903541212e-07
1270.9999980346376893.93072462293769e-061.96536231146885e-06
1280.9999983969928873.20601422668481e-061.60300711334241e-06
1290.9999972544326585.4911346834239e-062.74556734171195e-06
1300.9999959018898778.19622024616001e-064.09811012308e-06
1310.9999919663852741.60672294517402e-058.0336147258701e-06
1320.9999843376023233.13247953546438e-051.56623976773219e-05
1330.999973968186095.20636278178865e-052.60318139089432e-05
1340.999951214462859.75710743018743e-054.87855371509371e-05
1350.9999099258792740.0001801482414517189.00741207258591e-05
1360.9999453488247180.0001093023505641715.46511752820853e-05
1370.9998882247042070.0002235505915858960.000111775295792948
1380.9997891548334530.0004216903330937190.000210845166546859
1390.999589129142720.0008217417145599930.000410870857279996
1400.9996170846877170.0007658306245656690.000382915312282834
1410.9992820763395940.001435847320811120.00071792366040556
1420.9986307786343380.002738442731323740.00136922136566187
1430.998421466600760.003157066798479830.00157853339923991
1440.996584920644310.006830158711378360.00341507935568918
1450.9989339779645260.002132044070947910.00106602203547395
1460.9977924876311850.004415024737629330.00220751236881467
1470.9949409475642820.01011810487143510.00505905243571756
1480.9887541488604380.02249170227912480.0112458511395624
1490.9816745040788360.03665099184232750.0183254959211638
1500.9618048754018670.07639024919626620.0381951245981331
1510.9344030824065820.1311938351868370.0655969175934183
1520.8985001580824240.2029996838351510.101499841917576
1530.8073754943006860.3852490113986270.192624505699314
1540.6618153950089930.6763692099820140.338184604991007


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1290.877551020408163NOK
5% type I error level1400.952380952380952NOK
10% type I error level1430.972789115646258NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/106ais1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/106ais1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/1hrly1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/1hrly1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/2hrly1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/2hrly1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/3sjlk1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/3sjlk1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/4sjlk1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/4sjlk1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/5sjlk1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/5sjlk1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/63sk41293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/63sk41293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/7d1jp1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/7d1jp1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/8d1jp1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/8d1jp1293049998.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/9d1jp1293049998.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293049903mtwrrzaw87vwk3j/9d1jp1293049998.ps (open in new window)


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