Home » date » 2010 » Dec » 03 »

eigen tutorial workshop 7

*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:26:25 +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/t12913322918nv0mn84ijp1irz.htm/, Retrieved Fri, 03 Dec 2010 00:24:52 +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/t12913322918nv0mn84ijp1irz.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 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
Y[t] = + 10.1280554387145 -0.470936587537932month[t] -0.0930357075258933X1t[t] + 0.693450393160914X2t[t] + 0.194198919311925X3t[t] -0.380079809268144X4t[t] -0.446582546175459X5t[t] -0.109724075319391X6t[t] -0.575762104826707X7t[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)10.12805543871451.0191369.937900
month-0.4709365875379320.073403-6.415800
X1t-0.09303570752589330.157682-0.590.5560810.278041
X2t0.6934503931609140.1404994.93562e-061e-06
X3t0.1941989193119250.11861.63740.103680.05184
X4t-0.3800798092681440.047458-8.008800
X5t-0.4465825461754590.052889-8.443800
X6t-0.1097240753193910.129533-0.84710.398330.199165
X7t-0.5757621048267070.057452-10.021600


Multiple Linear Regression - Regression Statistics
Multiple R0.77836401948727
R-squared0.60585054683238
Adjusted R-squared0.58440023645591
F-TEST (value)28.2443720486671
F-TEST (DF numerator)8
F-TEST (DF denominator)147
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.51291998127982
Sum Squared Residuals336.472249854092


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
122.63735519946088-0.637355199460879
233.91453191046331-0.91453191046331
332.014148827495080.98585117250492
433.54282243963296-0.54282243963296
534.17563969210553-1.17563969210553
634.10932748029378-1.10932748029378
723.10396127229466-1.10396127229466
834.7332300528921-1.7332300528921
933.06044985867303-0.0604498586730324
1044.45455628958764-0.45455628958764
1132.517432704975510.482567295024489
1234.37780282443227-1.37780282443227
1322.41110752965229-0.411107529652291
1433.18814604107764-0.188146041077645
1597.502959124318841.49704087568116
1698.756450003160210.243549996839792
1796.562640884172472.43735911582753
1897.199389946028421.80061005397158
1997.986488979021581.01351102097842
2097.259825141518991.74017485848101
2199.06952204760714-0.0695220476071383
2296.152691253663782.84730874633622
2397.795709531034741.20429046896526
2498.952132298718770.0478677012812281
2597.451773572891951.54822642710805
2696.0478657363752.952134263625
2797.378888901707381.62111109829262
2896.849875511010292.15012448898971
2997.332601908311111.66739809168889
3096.721562106758222.27843789324178
3197.108641072151081.89135892784892
3297.251192719302771.74880728069723
3396.423046987612532.57695301238747
3498.200143381665360.799856618334642
3599.79825013749423-0.798250137494232
3696.513903765882322.48609623411768
3796.809508731157932.19049126884207
3897.397864103149441.60213589685056
3997.83185338216011.16814661783990
4096.042967178344392.95703282165561
4192.974856292929546.02514370707046
4212.47190737963854-1.47190737963854
4322.73880044503947-0.738800445039467
4423.7383527620878-1.73835276208780
4532.93055770369380.0694422963061973
4643.565823389303110.434176610696893
4733.92703590152165-0.927035901521648
4823.22222239534975-1.22222239534975
4922.74467681373758-0.744676813737584
5033.32840313157911-0.328403131579106
5131.755267638960171.24473236103983
5243.441507254743210.558492745256792
5333.04735080206362-0.0473508020636241
5422.71600811108564-0.716008111085636
5522.0938511084702-0.0938511084702017
5622.32954636754024-0.329546367540238
5723.68724554182292-1.68724554182292
5832.483569032095370.516430967904633
5914.19815189564958-3.19815189564958
6052.390533324569472.60946667543053
6123.54905240080649-1.54905240080649
6232.946839946064320.0531600539356767
6343.307165732554770.69283426744523
6443.510812241128150.489187758871851
6522.14390831176167-0.143908311761672
6632.657823403534030.342176596465974
6732.885852989035090.114147010964912
6833.46651365189241-0.466513651892411
6931.697082931408561.30291706859144
7013.96930846483143-2.96930846483143
7132.370779301791780.629220698208224
7231.973820599634571.02617940036543
7333.80641720640376-0.806417206403759
7443.281952846937510.718047153062494
7532.439270442859630.560729557140371
7642.910207030397561.08979296960244
7732.817171322871670.182828677128333
7833.02012163081252-0.0201216308125202
7922.66727099279548-0.66727099279548
8012.63615385700680-1.63615385700680
8126.61905578312423-4.61905578312423
8233.8166428702124-0.816642870212404
8343.295685425092590.704314574907406
8433.81016203344423-0.810162033444226
8543.842778827267350.157221172732646
8654.122049241090360.877950758909642
8723.21771156082402-1.21771156082402
8823.35367049568929-1.35367049568929
8943.87144752991930.128552470080698
9043.436563060944260.563436939055741
9133.1859613497732-0.185961349773203
9244.12363151982792-0.12363151982792
9344.14031988762142-0.140319887621417
9443.647450348049680.352549651950318
9544.12204924109036-0.122049241090358
9644.49978682985707-0.499786829857073
9725.89070373802253-3.89070373802253
9844.29124176325308-0.291241763253080
9943.752112574093130.247887425906866
10044.40036918805393-0.400369188053926
10144.03059581230203-0.0305958123020261
10244.03697774657928-0.0369777465792789
10355.43260268767979-0.43260268767979
10444.63966298407505-0.63966298407505
10542.928830266494241.07116973350576
10644.5402453422719-0.540245342271903
10733.44452727395908-0.444527273959075
10844.64140855405793-0.641408554057934
10944.33425661319710-0.334256613197095
11044.22253029047496-0.222530290474955
11133.83340055313204-0.833400553132043
11234.01977050762967-1.01977050762967
11333.23328440694286-0.233284406942864
11432.815016747078460.184983252921540
11543.022695659283280.97730434071672
11632.568148900093010.431851099906994
11732.568148900093010.431851099906994
11843.315823155856950.684176844143055
11933.59539210912579-0.595392109125789
12033.88262673596361-0.882626735963607
12133.67986695311832-0.679866953118323
12233.6058890677376-0.6058890677376
12332.989461643612690.0105383563873116
12433.26159929325392-0.261599293253920
12543.208930365580390.79106963441961
12631.789328472975171.21067152702483
12743.455798212565840.544201787434155
12834.34866476547092-1.34866476547092
12946.33516935992365-2.33516935992365
13012.31685837746780-1.31685837746780
13143.261599293253920.73840070674608
13233.41169014842568-0.411690148425675
13342.95923123355211.04076876644790
13443.010770601319880.989229398680119
13544.10514054158659-0.105140541586589
13633.23328440694286-0.233284406942864
13734.31602782869201-1.31602782869201
13832.808444177747820.191555822252182
13943.476148885862090.523851114137913
14034.77027604843645-1.77027604843645
14132.66118460761890.3388153923811
14233.59539210912579-0.595392109125789
14343.512853360211710.487146639788293
14423.75314863786652-1.75314863786652
14533.32632011446876-0.326320114468757
14634.908974755032-1.90897475503200
14732.833096758556130.166903241443869
14832.697626998190090.302373001809906
14932.705292671759070.294707328240931
15042.315765273229471.68423472677053
15132.685538648981370.314461351018628
15244.5878669388874-0.587866938887403
15333.67956841367248-0.679568413672482
15443.228385848912250.771614151087753
15546.73131985650659-2.73131985650659
156411.4066936912507-7.40669369125069


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.03710835216006870.07421670432013750.962891647839931
130.01093878645600990.02187757291201980.98906121354399
140.01489154503601870.02978309007203730.985108454963981
150.004753038482270530.009506076964541070.99524696151773
160.002757574467302510.005515148934605030.997242425532697
170.002862510358761250.005725020717522510.997137489641239
180.001167869719433700.002335739438867390.998832130280566
190.0004717998492189260.0009435996984378530.999528200150781
200.0001591637555448810.0003183275110897620.999840836244455
210.000699801098502040.001399602197004080.999300198901498
220.003696568906178740.007393137812357480.996303431093821
230.002914368971088120.005828737942176240.997085631028912
240.001930218329536550.003860436659073110.998069781670463
250.001008625213572670.002017250427145330.998991374786427
260.0008993387939231230.001798677587846250.999100661206077
270.0006767910071489670.001353582014297930.99932320899285
280.0005642029165765330.001128405833153070.999435797083423
290.0003072810069819230.0006145620139638470.999692718993018
300.0002229972609099540.0004459945218199080.99977700273909
310.0001441032704581260.0002882065409162510.999855896729542
320.0001357103126234250.0002714206252468490.999864289687377
330.0001727734742698820.0003455469485397640.99982722652573
340.0001875596363346770.0003751192726693540.999812440363665
350.0002891140770026580.0005782281540053160.999710885922997
360.0003611364152646080.0007222728305292170.999638863584735
370.0004815539687940020.0009631079375880030.999518446031206
380.0009403805243683850.001880761048736770.999059619475632
390.002867252673492430.005734505346984860.997132747326508
400.03024590004953140.06049180009906270.969754099950469
410.3901926745928430.7803853491856860.609807325407157
420.9997272096534770.0005455806930468890.000272790346523444
430.9999809072091583.81855816838302e-051.90927908419151e-05
440.999995548880288.90223943861814e-064.45111971930907e-06
450.9999940595351471.18809297068773e-055.94046485343867e-06
460.9999924085791071.51828417852545e-057.59142089262726e-06
470.9999952912401079.41751978632208e-064.70875989316104e-06
480.999991818681191.63626376204768e-058.18131881023839e-06
490.9999922353505241.55292989523701e-057.76464947618506e-06
500.9999873946132812.52107734378343e-051.26053867189171e-05
510.9999828899142113.42201715777468e-051.71100857888734e-05
520.9999930418065441.39163869118612e-056.9581934559306e-06
530.999990737952741.85240945198547e-059.26204725992735e-06
540.9999885422538392.29154923223367e-051.14577461611683e-05
550.9999885710616972.28578766059488e-051.14289383029744e-05
560.9999848854930363.02290139278071e-051.51145069639036e-05
570.99998213596643.57280672007225e-051.78640336003612e-05
580.9999710670776365.78658447274362e-052.89329223637181e-05
590.9999902180267881.95639464243207e-059.78197321216033e-06
600.9999986214919812.75701603784113e-061.37850801892056e-06
610.9999986064566742.7870866519079e-061.39354332595395e-06
620.9999978661808844.26763823190473e-062.13381911595236e-06
630.9999986096172242.78076555119283e-061.39038277559641e-06
640.9999984774035353.04519293040867e-061.52259646520433e-06
650.9999979943417824.01131643624052e-062.00565821812026e-06
660.9999964198627667.16027446710829e-063.58013723355414e-06
670.9999967287268436.54254631321411e-063.27127315660705e-06
680.999995175998629.64800276110497e-064.82400138055249e-06
690.9999922055254921.55889490157074e-057.79447450785368e-06
700.999997428660225.14267956012637e-062.57133978006319e-06
710.9999957687627488.4624745032881e-064.23123725164405e-06
720.999992905438091.41891238187715e-057.09456190938574e-06
730.9999896021573782.07956852449075e-051.03978426224537e-05
740.9999949107690541.01784618922854e-055.08923094614271e-06
750.9999929877828861.40244342282366e-057.01221711411828e-06
760.9999970909630945.81807381210726e-062.90903690605363e-06
770.9999954023095649.19538087215001e-064.59769043607501e-06
780.9999958888929548.22221409286725e-064.11110704643362e-06
790.9999970683975215.86320495768564e-062.93160247884282e-06
800.9999989798620362.04027592772741e-061.02013796386371e-06
810.9999999093267241.81346551372957e-079.06732756864786e-08
820.9999999993482721.30345562395921e-096.51727811979607e-10
830.9999999995626958.74609305685168e-104.37304652842584e-10
840.9999999997884234.2315346536554e-102.1157673268277e-10
850.9999999995956678.08665858549837e-104.04332929274919e-10
860.9999999997528374.94325519560956e-102.47162759780478e-10
870.9999999999642187.1564641048951e-113.57823205244755e-11
880.9999999999977584.48386513322387e-122.24193256661194e-12
890.999999999995918.17826987507567e-124.08913493753783e-12
900.999999999990891.82210220584228e-119.1105110292114e-12
910.9999999999947611.04775313495304e-115.23876567476519e-12
920.999999999986952.61000400960766e-111.30500200480383e-11
930.9999999999688046.23916158768394e-113.11958079384197e-11
940.999999999921831.56338319405852e-107.81691597029262e-11
950.9999999998129043.74191336449721e-101.87095668224860e-10
960.999999999742535.14940213398722e-102.57470106699361e-10
970.999999999999411.17920133039631e-125.89600665198157e-13
980.9999999999984223.15675839025762e-121.57837919512881e-12
990.9999999999963727.25690701058384e-123.62845350529192e-12
1000.999999999990321.93602740244101e-119.68013701220507e-12
1010.9999999999741245.17526028879048e-112.58763014439524e-11
1020.9999999999304381.39124251165612e-106.95621255828058e-11
1030.9999999998940252.119497276052e-101.059748638026e-10
1040.999999999815663.68680287764508e-101.84340143882254e-10
1050.999999999930931.38140279899204e-106.90701399496018e-11
1060.999999999832073.35859493401371e-101.67929746700686e-10
1070.999999999577818.44380718125326e-104.22190359062663e-10
1080.9999999991359051.72819022934115e-098.64095114670575e-10
1090.9999999993209551.35809057123596e-096.79045285617981e-10
1100.9999999999405971.18806821073849e-105.94034105369244e-11
1110.999999999872952.54099582304186e-101.27049791152093e-10
1120.9999999996935866.12827910313761e-103.06413955156880e-10
1130.9999999993135391.37292227464985e-096.86461137324923e-10
1140.9999999984593753.08125005049882e-091.54062502524941e-09
1150.9999999971318945.73621154742483e-092.86810577371241e-09
1160.9999999941113261.17773470514040e-085.88867352570201e-09
1170.9999999884630522.30738958861672e-081.15369479430836e-08
1180.9999999816810263.66379488040377e-081.83189744020189e-08
1190.9999999675227186.49545640216566e-083.24772820108283e-08
1200.9999999169184561.66163087120146e-078.30815435600731e-08
1210.9999998706910352.58617930843937e-071.29308965421968e-07
1220.999999660714786.78570441005672e-073.39285220502836e-07
1230.9999992082615671.58347686526893e-067.91738432634464e-07
1240.9999988423550472.31528990646820e-061.15764495323410e-06
1250.9999973671203275.26575934505582e-062.63287967252791e-06
1260.99999477185891.04562821998286e-055.22814109991432e-06
1270.999989637042462.07259150803818e-051.03629575401909e-05
1280.9999804189168753.91621662498303e-051.95810831249151e-05
1290.9999620401337587.59197324839148e-053.79598662419574e-05
1300.9999749065884925.01868230167533e-052.50934115083767e-05
1310.9999519301877839.61396244336881e-054.80698122168441e-05
1320.9998758782769260.0002482434461474160.000124121723073708
1330.9997968690251720.0004062619496568450.000203130974828422
1340.9998669846488110.0002660307023779360.000133015351188968
1350.999851759849580.0002964803008390170.000148240150419509
1360.9996162518226120.0007674963547765660.000383748177388283
1370.9992316883416170.001536623316766080.00076831165838304
1380.9986865830015930.0026268339968140.001313416998407
1390.996416778903840.007166442192320130.00358322109616006
1400.9925665722603580.01486685547928350.00743342773964173
1410.9809034969493250.03819300610134990.0190965030506749
1420.9537312598069530.09253748038609480.0462687401930474
1430.922908979925820.1541820401483590.0770910200741797
1440.8768981143931330.2462037712137340.123101885606867


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/1df1o1291332373.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/1df1o1291332373.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/2df1o1291332373.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/2df1o1291332373.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/456i91291332373.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/456i91291332373.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/556i91291332373.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/556i91291332373.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/6yyzc1291332373.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t12913322918nv0mn84ijp1irz/6yyzc1291332373.ps (open in new window)


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


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


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