Home » date » 2010 » Dec » 03 »

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: Fri, 03 Dec 2010 13:55:37 +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/t1291384459bby3xkhp0vge1gq.htm/, Retrieved Fri, 03 Dec 2010 14:54:30 +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/t1291384459bby3xkhp0vge1gq.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 «
4 4 1 4 5 4 2 1 4 4 4 3 2 5 5 4 2 1 3 4 4 2 2 4 3 5 2 1 3 5 4 1 3 4 4 3 1 1 3 4 4 1 1 2 4 4 2 1 4 4 4 2 2 2 4 4 2 4 2 4 4 2 2 2 4 2 2 1 1 3 3 1 1 4 4 4 3 3 4 5 3 2 2 2 4 2 2 2 2 2 4 2 3 3 4 3 2 3 3 4 3 3 1 3 4 4 4 2 4 4 3 2 2 3 4 3 2 2 2 4 4 2 2 2 5 4 1 3 4 4 4 2 2 4 4 4 2 2 3 4 4 2 2 4 4 4 2 2 2 4 5 4 2 4 5 4 2 3 4 4 4 4 2 5 2 4 3 2 5 5 3 1 2 4 4 4 4 2 4 5 3 3 2 4 4 4 2 1 2 4 4 4 2 4 4 3 2 1 4 4 5 3 2 4 5 4 3 2 3 4 3 2 2 2 4 3 1 2 3 5 3 2 2 4 4 4 1 3 3 4 4 2 2 2 4 4 4 2 4 4 4 2 2 4 4 4 2 4 3 4 4 2 1 4 4 4 2 2 3 4 5 2 2 4 5 3 1 1 2 3 3 2 5 4 4 5 3 2 4 5 5 2 2 4 5 4 2 2 4 4 4 1 1 3 5 3 1 2 1 2 4 2 2 3 4 4 2 2 3 4 5 1 2 4 4 4 2 2 2 4 4 1 1 3 4 5 4 1 5 5 4 4 2 4 4 3 1 2 4 4 4 1 1 3 4 4 3 2 4 4 4 4 2 2 3 4 2 1 3 4 4 4 3 4 5 4 4 3 3 5 4 3 3 4 4 3 4 2 4 4 4 2 2 3 5 3 2 2 3 4 5 2 1 2 5 4 2 4 4 3 5 2 3 3 4 5 2 2 2 4 4 2 2 2 4 4 1 2 3 4 4 3 1 2 5 4 3 2 2 4 4 2 3 4 4 5 4 1 4 5 4 4 2 4 3 3 2 2 2 4 4 2 2 2 4 3 1 1 4 5 4 1 1 2 4 4 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 time12 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
neat[t] = + 1.27617742427754 + 0.237668039388989fail[t] -0.191182456604179performance[t] + 0.0507848541828642goals[t] + 0.466836776775649`organized `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.276177424277540.4659912.73860.0068970.003449
fail0.2376680393889890.0753363.15480.0019320.000966
performance-0.1911824566041790.0754-2.53560.0122230.006111
goals0.05078485418286420.0761440.6670.5057970.252898
`organized `0.4668367767756490.0894335.221e-060


Multiple Linear Regression - Regression Statistics
Multiple R0.520144238515198
R-squared0.270550028860555
Adjusted R-squared0.251603276363426
F-TEST (value)14.2794934858393
F-TEST (DF numerator)4
F-TEST (DF denominator)154
p-value6.16247053386587e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.88938019219216
Sum Squared Residuals121.813557444620


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
144.57299042583907-0.572990425839068
243.630817570285390.369182429714611
344.19492478402872-0.194924784028715
443.580032716102530.419967283897474
542.972798336905561.02720166309444
654.046869492878180.953130507121824
743.010784617688040.989215382311956
833.34236467671354-0.342364676713538
943.291579822530670.708420177469326
1043.630817570285390.369182429714608
1143.338065405315480.661934594684516
1242.955700492107131.04429950789287
1343.338065405315480.661934594684516
1423.01162623096115-1.01162623096115
1533.3931495308964-0.393149530896403
1643.952957473241670.0470425267583285
1733.33806540531548-0.338065405315484
1822.40439185176419-0.404391851764187
1943.197667802894170.802332197105831
2033.19766780289417-0.197667802894169
2133.81770075549152-0.817700755491517
2243.914971192459190.0850288075408088
2333.38885025949835-0.388850259498348
2433.33806540531548-0.338065405315484
2543.804902182091130.195097817908867
2643.010784617688040.989215382311956
2743.439635113681210.560364886318787
2843.388850259498350.611149740501652
2943.439635113681210.560364886318787
3043.338065405315480.661934594684516
3154.381807969234840.61819203076516
3243.248452657077030.751547342922967
3343.032082493090760.967917506909242
3444.19492478402872-0.194924784028715
3533.20196707429222-0.201967074292223
3644.38180796923484-0.38180796923484
3733.6773031530702-0.677303153070202
3843.529247861919660.470752138080337
3943.914971192459190.0850288075408088
4033.63081757028539-0.630817570285392
4154.144139929845850.85586007015415
4243.626518298887340.373481701112662
4333.33806540531548-0.338065405315484
4433.61801899688501-0.618018996885008
4533.43963511368121-0.439635113681213
4642.959999763505181.04000023649482
4743.338065405315480.661934594684516
4843.914971192459190.0850288075408088
4943.439635113681210.560364886318787
5043.006485346289990.99351465371001
5143.630817570285390.369182429714608
5243.388850259498350.611149740501652
5353.906471890456861.09352810954314
5432.824743045755030.175256954244975
5532.866087743868670.133912256131325
5654.144139929845850.85586007015415
5753.906471890456861.09352810954314
5843.439635113681210.560364886318787
5943.809201453489190.190798546510813
6032.115938958192330.884061041807667
6143.388850259498350.611149740501652
6243.388850259498350.611149740501652
6353.201967074292221.79803292570778
6443.338065405315480.661934594684516
6543.342364676713540.657635323286462
6654.623775280021880.376224719978117
6743.914971192459190.0850288075408088
6833.20196707429222-0.201967074292223
6943.342364676713540.657635323286462
7043.67730315307020.322696846929798
7143.346564707317810.653435292682186
7243.580032716102530.419967283897472
7344.19062551263066-0.190625512630661
7444.1398406584478-0.139840658447796
7543.486120696466020.513879303533977
7633.91497119245919-0.914971192459191
7743.8556870362740.144312963726003
7833.38885025949835-0.388850259498348
7953.996084638695311.00391536130469
8042.590433423697211.40956657630279
8153.197667802894171.80233219710583
8253.338065405315481.66193459468452
8343.338065405315480.661934594684516
8443.151182220109360.84881777989064
8544.2337526780843-0.233752678084301
8643.575733444704470.424266555295527
8743.248452657077030.751547342922967
8854.572990425839020.427009574160981
8943.448134415683540.551865584316458
9033.33806540531548-0.338065405315484
9143.338065405315480.661934594684516
9233.85998630767205-0.859986307672051
9343.291579822530670.708420177469326
9442.684345443333711.31565455666629
9543.8556870362740.144312963726003
9643.574891831431370.425108168568633
9744.09335507566299-0.0933550756629864
9833.53260627925083-0.532606279250833
9933.58003271610253-0.580032716102528
10033.14688294871130-0.146882948711305
10133.91497119245919-0.914971192459191
10233.38885025949835-0.388850259498348
10322.31047983212768-0.310479832127682
10433.19766780289417-0.197667802894169
10553.906471890456861.09352810954314
10623.02012553296348-1.02012553296348
10723.11319593932688-1.11319593932688
10832.642059891153180.357940108846824
10933.19766780289417-0.197667802894169
11023.43963511368121-1.43963511368121
11123.15118222010936-1.15118222010936
11242.972798336905561.02720166309444
11332.123596646921560.876403353078443
11412.34846611291016-1.34846611291016
11512.67920455866255-1.67920455866255
11612.31477910352574-1.31477910352574
11723.19336853149611-1.19336853149611
11823.00648534628999-1.00648534628999
11932.314779103525740.685220896474264
12012.63356058915085-1.63356058915085
12132.352765384308220.647234615691784
12212.9220134827227-1.9220134827227
12323.24845265707703-1.24845265707703
12413.20196707429222-2.20196707429222
12523.43963511368121-1.43963511368121
12623.21046637629455-1.21046637629455
12732.870387015266730.129612984733271
12823.10805505465572-1.10805505465572
12923.10805505465572-1.10805505465572
13042.174381501104421.82561849889558
13123.24845265707703-1.24845265707703
13233.90647189045686-0.906471890456861
13322.87038701526673-0.87038701526673
13413.01078461768804-2.01078461768804
13523.43963511368121-1.43963511368121
13633.06576950247518-0.065769502475184
13711.84794232675009-0.847942326750087
13823.14688294871131-1.14688294871131
13922.78161588030139-0.781615880301385
14032.680046171935660.319953828064344
14132.730831026118520.269168973881480
14231.656759870145911.34324012985409
14343.426737299487050.57326270051295
14443.668803851067870.331196148932128
14523.86418633827633-1.86418633827633
14632.590433423697210.409566576302794
14733.48612069646602-0.486120696466023
14822.78161588030139-0.781615880301385
14913.4784630077368-2.4784630077368
15023.33806540531548-1.33806540531548
15122.81960216108387-0.819602161083865
15243.52410697724850.475893022751497
15342.696203162667211.30379683733279
15422.87122862853984-0.871228628539835
15532.726531754720470.273468245279534
15623.24845265707703-1.24845265707703
15743.439635113681210.560364886318787
15822.59043342369721-0.590433423697206
15943.914971192459190.0850288075408088


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.3945755677953160.7891511355906320.605424432204684
90.2395377199181830.4790754398363650.760462280081817
100.1454953541340540.2909907082681090.854504645865946
110.08433734387013680.1686746877402740.915662656129863
120.04564860572478680.09129721144957350.954351394275213
130.02217963545936060.04435927091872130.97782036454064
140.07721356031679220.1544271206335840.922786439683208
150.09100824546487110.1820164909297420.908991754535129
160.07362432583886170.1472486516777230.926375674161138
170.06505483980352370.1301096796070470.934945160196476
180.04452901527541720.08905803055083440.955470984724583
190.02833499590521030.05666999181042050.97166500409479
200.02954258786398230.05908517572796450.970457412136018
210.02152335782696780.04304671565393560.978476642173032
220.01589316591860650.03178633183721300.984106834081394
230.01389962438854050.02779924877708090.98610037561146
240.01017040357894840.02034080715789680.989829596421052
250.005971455001978970.01194291000395790.994028544998021
260.003666458938766910.007332917877533820.996333541061233
270.002215755983671150.00443151196734230.997784244016329
280.001488367052961070.002976734105922150.998511632947039
290.0008676171465433670.001735234293086730.999132382853457
300.0006861804975397710.001372360995079540.99931381950246
310.0006540570966199720.001308114193239940.99934594290338
320.0003751596618762430.0007503193237524860.999624840338124
330.0005932741640888930.001186548328177790.99940672583591
340.0004907229854773480.0009814459709546960.999509277014523
350.0005054388475839180.001010877695167840.999494561152416
360.0003445273225212160.0006890546450424330.999655472677479
370.0004431114443206630.0008862228886413250.99955688855568
380.0003742360194198170.0007484720388396340.99962576398058
390.0002115538399956930.0004231076799913860.999788446160004
400.0001936486047937720.0003872972095875450.999806351395206
410.0001974336914148700.0003948673828297390.999802566308585
420.0001203740607605410.0002407481215210810.99987962593924
438.78279734878803e-050.0001756559469757610.999912172026512
440.0001160590968199800.0002321181936399590.99988394090318
450.0001093774632809540.0002187549265619090.999890622536719
468.6541263606332e-050.0001730825272126640.999913458736394
476.6506798025166e-050.0001330135960503320.999933493201975
483.71144383431998e-057.42288766863996e-050.999962885561657
492.32317195437311e-054.64634390874622e-050.999976768280456
501.53716439815283e-053.07432879630566e-050.999984628356019
519.9920480194896e-061.99840960389792e-050.99999000795198
526.66297475627693e-061.33259495125539e-050.999993337025244
539.11324777437129e-061.82264955487426e-050.999990886752226
545.07782718166808e-061.01556543633362e-050.999994922172818
557.54678800433379e-061.50935760086676e-050.999992453211996
567.48803992864586e-061.49760798572917e-050.999992511960071
579.39506845062826e-061.87901369012565e-050.99999060493155
585.92005185221844e-061.18401037044369e-050.999994079948148
593.35366167872601e-066.70732335745202e-060.999996646338321
603.13613778421466e-066.27227556842931e-060.999996863862216
612.11147218697081e-064.22294437394161e-060.999997888527813
621.41848518353778e-062.83697036707557e-060.999998581514816
638.0320330368929e-061.60640660737858e-050.999991967966963
646.24925277931202e-061.24985055586240e-050.99999375074722
654.92312557777087e-069.84625115554175e-060.999995076874422
663.49220297400520e-066.98440594801039e-060.999996507797026
671.94513179529554e-063.89026359059109e-060.999998054868205
681.86640457540459e-063.73280915080918e-060.999998133595425
691.53850558414448e-063.07701116828895e-060.999998461494416
709.06753993850674e-071.81350798770135e-060.999999093246006
718.0028170235294e-071.60056340470588e-060.999999199718298
725.48989913205184e-071.09797982641037e-060.999999451010087
733.64519053103312e-077.29038106206624e-070.999999635480947
742.13263201289525e-074.26526402579049e-070.999999786736799
751.28941554950695e-072.57883109901390e-070.999999871058445
761.99836599440161e-073.99673198880322e-070.9999998001634
771.17428939642933e-072.34857879285865e-070.99999988257106
789.94621335313256e-081.98924267062651e-070.999999900537866
792.22850509113330e-074.45701018226659e-070.99999977714949
803.32962942065282e-076.65925884130564e-070.999999667037058
812.38318763583848e-064.76637527167696e-060.999997616812364
821.74399580483271e-053.48799160966542e-050.999982560041952
831.69351320944401e-053.38702641888802e-050.999983064867906
842.13241412360098e-054.26482824720195e-050.999978675858764
851.40654288902314e-052.81308577804628e-050.99998593457111
861.1486792406358e-052.2973584812716e-050.999988513207594
871.06458979016536e-052.12917958033073e-050.999989354102098
881.08774030185536e-052.17548060371072e-050.999989122596981
898.77071227284339e-061.75414245456868e-050.999991229287727
907.63629623074312e-061.52725924614862e-050.99999236370377
919.65878912110816e-061.93175782422163e-050.999990341210879
921.35481600014219e-052.70963200028437e-050.999986451839999
933.00541278291332e-056.01082556582664e-050.999969945872171
940.0001247759294425310.0002495518588850610.999875224070558
950.0001382002676035020.0002764005352070040.999861799732396
960.0001232769437741980.0002465538875483960.999876723056226
970.0001103847531243110.0002207695062486210.999889615246876
980.0001311536994902700.0002623073989805400.99986884630051
990.0001326336133846040.0002652672267692080.999867366386615
1000.0001367172912235420.0002734345824470850.999863282708776
1010.0001516423807107630.0003032847614215260.99984835761929
1020.0001479491538456650.0002958983076913300.999852050846154
1030.0001530436809305340.0003060873618610670.99984695631907
1040.0001416688669127580.0002833377338255150.999858331133087
1050.001039335935489580.002078671870979150.99896066406451
1060.0009464049425503540.001892809885100710.99905359505745
1070.001157546400793070.002315092801586140.998842453599207
1080.0009937918133897150.001987583626779430.99900620818661
1090.0009786384753257430.001957276950651490.999021361524674
1100.002064184186724310.004128368373448630.997935815813276
1110.003195627976450470.006391255952900950.99680437202355
1120.007880704999763020.01576140999952600.992119295000237
1130.007044283799890390.01408856759978080.99295571620011
1140.02393270825912370.04786541651824740.976067291740876
1150.09674618481707250.1934923696341450.903253815182927
1160.1402184563512570.2804369127025140.859781543648743
1170.1623403804793050.3246807609586110.837659619520695
1180.1708921408037510.3417842816075020.829107859196249
1190.1739995386054680.3479990772109360.826000461394532
1200.2025084140220320.4050168280440630.797491585977968
1210.1938155384393150.387631076878630.806184461560685
1220.262995315789250.52599063157850.73700468421075
1230.268166598284520.536333196569040.73183340171548
1240.3739799199537620.7479598399075230.626020080046239
1250.3694744076587260.7389488153174510.630525592341274
1260.3564193700144230.7128387400288460.643580629985577
1270.3161361273906090.6322722547812180.683863872609391
1280.3374130505224230.6748261010448450.662586949477577
1290.3749471248826260.7498942497652520.625052875117374
1300.5332728302732510.9334543394534990.466727169726749
1310.5311929396616990.9376141206766020.468807060338301
1320.4831655947245140.9663311894490280.516834405275486
1330.4730222279233170.9460444558466340.526977772076683
1340.6451075991003620.7097848017992760.354892400899638
1350.6365974592109470.7268050815781050.363402540789053
1360.5837340520462780.8325318959074440.416265947953722
1370.5852807733321450.829438453335710.414719226667855
1380.5474409829899990.9051180340200020.452559017010001
1390.5214111731124570.9571776537750850.478588826887543
1400.5135842608449530.9728314783100950.486415739155047
1410.4746027526228880.9492055052457760.525397247377112
1420.560033612380850.87993277523830.43996638761915
1430.5079415988951950.984116802209610.492058401104805
1440.5700061189753890.8599877620492220.429993881024611
1450.7391303222163380.5217393555673240.260869677783662
1460.70329217069840.5934156586031990.296707829301600
1470.6408800731751520.7182398536496960.359119926824848
1480.5318184064088820.9363631871822360.468181593591118
1490.603304650923590.793390698152820.39669534907641
1500.5460846107704350.907830778459130.453915389229565
1510.3899652740615810.7799305481231620.610034725938419


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level860.597222222222222NOK
5% type I error level950.659722222222222NOK
10% type I error level990.6875NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/101l5e1291384524.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/101l5e1291384524.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/45bpn1291384524.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/45bpn1291384524.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/55bpn1291384524.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291384459bby3xkhp0vge1gq/55bpn1291384524.ps (open in new window)


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


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


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


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