Home » date » 2010 » Dec » 02 »

Workshop 7 – Multiple Linear Regression

*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 10:02:20 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w.htm/, Retrieved Thu, 02 Dec 2010 11:16:27 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w.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:
Member of sports club data ( Provision, Illness & Tobacco)
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 1 1 1 4 1 4 1 7 1 5 1 7 1 2 2 5 1 1 2 5 1 1 1 4 1 2 2 4 2 1 1 6 1 1 2 5 1 1 1 1 1 3 2 5 1 1 1 4 2 1 2 6 1 1 2 7 1 2 2 7 1 4 1 2 1 1 1 6 1 1 1 3 1 2 2 6 1 3 2 6 1 1 1 5 1 1 2 6 1 1 2 4 2 1 2 3 2 2 2 4 1 1 2 5 2 1 2 6 2 1 1 6 2 1 1 4 1 1 2 6 1 1 1 6 1 1 2 5 1 1 2 6 1 1 2 4 1 1 1 6 1 1 2 7 1 1 1 5 1 1 1 6 1 1 2 6 2 1 1 5 2 4 2 7 1 1 2 6 1 1 1 3 1 4 1 4 1 2 2 5 1 2 2 4 2 1 1 3 1 1 2 5 1 2 2 5 1 1 1 4 1 1 1 5 1 1 2 1 1 1 2 2 2 1 2 3 1 1 1 4 1 2 1 3 1 1 1 7 1 1 1 2 1 1 1 4 1 2 1 2 1 1 2 5 1 2 2 6 1 4 2 6 1 1 2 6 1 1 1 6 1 1 2 6 1 2 2 6 1 3 1 6 1 1 1 4 1 1 1 4 1 1 2 5 1 1 1 6 1 1 1 6 1 1 1 7 1 1 1 6 1 1 2 6 2 1 1 6 1 2 2 3 1 1 2 5 1 1 2 6 1 1 2 4 1 1 1 5 1 1 2 6 1 1 2 6 1 1 1 3 1 1 2 6 1 2 2 5 1 1 1 6 1 1 1 4 1 1 2 7 1 1 2 5 1 1 2 6 1 2 1 6 1 1 2 6 1 5 1 7 2 1 2 6 1 1 1 6 1 1 1 6 1 2 2 6 1 1 2 2 1 3 1 4 1 1 2 4 1 1 2 6 1 1 1 5 1 3 1 6 1 1 1 6 1 1 1 2 2 1 2 7 1 1 1 1 1 1 1 4 1 1 1 1 1 2 1 6 1 2 2 6 1 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 time14 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Member[t] = + 1.13063229552587 + 0.0785437330394767Provision[t] + 0.0679185931028256Illness[t] -0.0381110070875364Tobacco[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.130632295525870.2086435.41900
Provision0.07854373303947670.0274542.86090.0048150.002408
Illness0.06791859310282560.117380.57860.5636970.281848
Tobacco-0.03811100708753640.041979-0.90790.3653820.182691


Multiple Linear Regression - Regression Statistics
Multiple R0.233300950142260
R-squared0.0544293333372814
Adjusted R-squared0.0358887320301693
F-TEST (value)2.93568328425262
F-TEST (DF numerator)3
F-TEST (DF denominator)153
p-value0.0352584502761568
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.489621071820791
Sum Squared Residuals36.6785054775539


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
121.553158546738510.446841453261493
211.36028179243645-0.360281792436451
311.55780198446735-0.557801984467352
411.67213500572996-0.672135005729958
521.553158546738540.446841453261459
621.553158546738540.446841453261459
711.43650380661153-0.436503806611528
821.542533406801890.457466593198111
911.63170227977802-0.631702279778018
1021.553158546738540.446841453261459
1111.16276160040556-0.162761600405560
1221.553158546738540.446841453261459
1311.54253340680189-0.542533406801889
1421.631702279778020.368297720221982
1521.672135005729960.327864994270041
1621.595912991554890.404087008445114
1711.31752734762011-0.31752734762011
1811.63170227977802-0.631702279778018
1911.35796007357205-0.357960073572051
2021.555480265602950.444519734397055
2121.631702279778020.368297720221982
2211.55315854673854-0.553158546738541
2321.631702279778020.368297720221982
2421.542533406801890.457466593198111
2521.425878666674880.574121333325124
2621.474614813699060.525385186300936
2721.621077139841370.378922860158634
2821.699620872880840.300379127119157
2911.69962087288084-0.699620872880843
3011.47461481369906-0.474614813699064
3121.631702279778020.368297720221982
3211.63170227977802-0.631702279778018
3321.553158546738540.446841453261459
3421.631702279778020.368297720221982
3521.474614813699060.525385186300936
3611.63170227977802-0.631702279778018
3721.710246012817490.289753987182505
3811.55315854673854-0.553158546738541
3911.63170227977802-0.631702279778018
4021.699620872880840.300379127119157
4111.50674411857876-0.506744118578757
4221.710246012817490.289753987182505
4321.631702279778020.368297720221982
4411.28173805939698-0.281738059396978
4511.43650380661153-0.436503806611528
4621.515047539651000.484952460348995
4721.542533406801890.457466593198111
4811.39607108065959-0.396071080659587
4921.515047539651000.484952460348995
5021.553158546738540.446841453261459
5111.47461481369906-0.474614813699064
5211.55315854673854-0.553158546738541
5321.238983614580630.761016385419367
5421.385445940722940.614554059277065
5521.396071080659590.603928919340413
5611.43650380661153-0.436503806611528
5711.39607108065959-0.396071080659587
5811.71024601281749-0.710246012817495
5911.31752734762011-0.31752734762011
6011.43650380661153-0.436503806611528
6111.31752734762011-0.31752734762011
6221.515047539651000.484952460348995
6321.517369258515410.482630741484591
6421.631702279778020.368297720221982
6521.631702279778020.368297720221982
6611.63170227977802-0.631702279778018
6721.593591272690480.406408727309518
6821.555480265602950.444519734397055
6911.63170227977802-0.631702279778018
7011.47461481369906-0.474614813699064
7111.47461481369906-0.474614813699064
7221.553158546738540.446841453261459
7311.63170227977802-0.631702279778018
7411.63170227977802-0.631702279778018
7511.71024601281749-0.710246012817495
7611.63170227977802-0.631702279778018
7721.699620872880840.300379127119157
7811.59359127269048-0.593591272690482
7921.396071080659590.603928919340413
8021.553158546738540.446841453261459
8121.631702279778020.368297720221982
8221.474614813699060.525385186300936
8311.55315854673854-0.553158546738541
8421.631702279778020.368297720221982
8521.631702279778020.368297720221982
8611.39607108065959-0.396071080659587
8721.593591272690480.406408727309518
8821.553158546738540.446841453261459
8911.63170227977802-0.631702279778018
9011.47461481369906-0.474614813699064
9121.710246012817490.289753987182505
9221.553158546738540.446841453261459
9321.593591272690480.406408727309518
9411.63170227977802-0.631702279778018
9521.479258251427870.520741748572128
9611.77816460592032-0.77816460592032
9721.631702279778020.368297720221982
9811.63170227977802-0.631702279778018
9911.59359127269048-0.593591272690482
10021.631702279778020.368297720221982
10121.241305333445040.758694666554963
10211.47461481369906-0.474614813699064
10321.474614813699060.525385186300936
10421.631702279778020.368297720221982
10511.47693653256347-0.476936532563468
10611.63170227977802-0.631702279778018
10711.63170227977802-0.631702279778018
10811.38544594072294-0.385445940722935
10921.710246012817490.289753987182505
11011.23898361458063-0.238983614580633
11111.47461481369906-0.474614813699064
11211.20087260749310-0.200872607493097
11311.59359127269048-0.593591272690482
11421.517369258515410.482630741484591
11511.51736925851541-0.517369258515409
11621.710246012817490.289753987182505
11711.63170227977802-0.631702279778018
11821.474614813699060.525385186300936
11921.474614813699060.525385186300936
12011.51736925851541-0.517369258515409
12111.62107713984137-0.621077139841366
12221.710246012817490.289753987182505
12321.474614813699060.525385186300936
12411.47461481369906-0.474614813699064
12521.555480265602950.444519734397055
12621.710246012817490.289753987182505
12721.553158546738540.446841453261459
12821.631702279778020.368297720221982
12911.58528785161823-0.585287851618234
13021.517369258515410.482630741484591
13121.553158546738540.446841453261459
13221.672135005729960.327864994270041
13321.474614813699060.525385186300936
13411.59359127269048-0.593591272690482
13511.63170227977802-0.631702279778018
13621.634023998642420.365976001357578
13721.593591272690480.406408727309518
13821.593591272690480.406408727309518
13921.553158546738540.446841453261459
14011.55315854673854-0.553158546738541
14121.515047539651000.484952460348995
14221.631702279778020.368297720221982
14321.661509865793310.338490134206693
14411.74005359883278-0.740053598832784
14511.47461481369906-0.474614813699064
14621.631702279778020.368297720221982
14721.593591272690480.406408727309518
14821.710246012817490.289753987182505
14911.59359127269048-0.593591272690482
15021.710246012817490.289753987182505
15121.542533406801890.457466593198111
15221.631702279778020.368297720221982
15311.47461481369906-0.474614813699064
15411.47461481369906-0.474614813699064
15521.710246012817490.289753987182505
15611.47461481369906-0.474614813699064
15721.778164605920320.22183539407968


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.626456837673830.747086324652340.37354316232617
80.463729233522970.927458467045940.53627076647703
90.5667067169985400.8665865660029190.433293283001460
100.5044386695451570.9911226609096860.495561330454843
110.4285355802031820.8570711604063640.571464419796818
120.370813849616090.741627699232180.62918615038391
130.4881490215909640.9762980431819290.511850978409036
140.4210061192912850.842012238582570.578993880708715
150.4042513053891710.8085026107783420.595748694610829
160.5226625911363750.954674817727250.477337408863625
170.4939266730778880.9878533461557770.506073326922112
180.599971289355930.800057421288140.40002871064407
190.5452229563371520.9095540873256960.454777043662848
200.554794090182340.890411819635320.44520590981766
210.5008621993246980.9982756013506040.499137800675302
220.5378829592068560.9242340815862890.462117040793144
230.490048263618840.980096527237680.50995173638116
240.4699350438553740.9398700877107480.530064956144626
250.475804591464120.951609182928240.52419540853588
260.4784570012411270.9569140024822540.521542998758873
270.422748592689980.845497185379960.57725140731002
280.3673465439484230.7346930878968470.632653456051577
290.5153661528183360.9692676943633290.484633847181664
300.5200659899540530.9598680200918940.479934010045947
310.4829272844535090.9658545689070180.517072715546491
320.5359066287795380.9281867424409230.464093371220462
330.5188385436728370.9623229126543260.481161456327163
340.4844060161278140.9688120322556270.515593983872186
350.4811542283625570.9623084567251140.518845771637443
360.5335681274378890.9328637451242220.466431872562111
370.4912343102374150.9824686204748290.508765689762585
380.5143399766673210.9713200466653580.485660023332679
390.5532463642408730.8935072715182530.446753635759127
400.5111699195946110.9776601608107780.488830080405389
410.5026848712135680.9946302575728650.497315128786432
420.4647085878226640.9294171756453280.535291412177336
430.4368690263776620.8737380527553230.563130973622338
440.3952129976011530.7904259952023050.604787002398847
450.3794936745976520.7589873491953030.620506325402348
460.3846404332378770.7692808664757550.615359566762123
470.3693937523583380.7387875047166770.630606247641662
480.3543900752480790.7087801504961590.645609924751921
490.3586137319759890.7172274639519770.641386268024011
500.3461592961140050.6923185922280110.653840703885995
510.3470377676142410.6940755352284820.652962232385759
520.3646649017502020.7293298035004040.635335098249798
530.4332034901806660.8664069803613320.566796509819334
540.4527737834872010.9055475669744020.547226216512799
550.4703520941103960.940704188220790.529647905889604
560.4596723407120460.9193446814240930.540327659287954
570.4498255635716650.899651127143330.550174436428335
580.5044953053076860.9910093893846280.495504694692314
590.4808590398955790.9617180797911580.519140960104421
600.4672307891866360.9344615783732720.532769210813364
610.4409367497103540.8818734994207070.559063250289646
620.4463905541163820.8927811082327630.553609445883618
630.4607136687062420.9214273374124850.539286331293757
640.4392133746415280.8784267492830550.560786625358472
650.4174602949572860.8349205899145720.582539705042714
660.4502757177772360.9005514355544720.549724282222764
670.4363935028345170.8727870056690340.563606497165483
680.4296415829792850.859283165958570.570358417020715
690.4615421891977040.9230843783954080.538457810802296
700.4571982218041590.9143964436083180.542801778195841
710.4525901361850870.9051802723701750.547409863814913
720.4448581661596390.8897163323192790.55514183384036
730.4749213306809830.9498426613619660.525078669319017
740.5043926190723820.9912147618552370.495607380927618
750.5544292197429220.8911415605141570.445570780257078
760.5838834992787190.8322330014425630.416116500721281
770.566555991353040.866888017293920.43344400864696
780.5891878905602620.8216242188794770.410812109439738
790.6159679262459010.7680641475081980.384032073754099
800.6099816801366430.7800366397267140.390018319863357
810.5910501908752370.8178996182495250.408949809124763
820.6003909284705380.7992181430589230.399609071529462
830.6123699956152710.7752600087694580.387630004384729
840.5928689560258060.8142620879483880.407131043974194
850.5728584784963620.8542830430072770.427141521503638
860.5546907824421830.8906184351156340.445309217557817
870.5393496271229040.9213007457541920.460650372877096
880.5318714581754230.9362570836491540.468128541824577
890.5648005974031820.8703988051936370.435199402596818
900.5611910505331710.8776178989336590.438808949466829
910.5292371307256440.9415257385487120.470762869274356
920.5207839759185090.9584320481629820.479216024081491
930.5039953694074310.9920092611851380.496004630592569
940.5385914350313430.9228171299373140.461408564968657
950.540569801321450.91886039735710.45943019867855
960.5949044974565960.8101910050868080.405095502543404
970.5716007147608410.8567985704783170.428399285239159
980.6091050636753450.7817898726493090.390894936324655
990.636800679285760.726398641428480.36319932071424
1000.6124697577848580.7750604844302850.387530242215142
1010.7051322904977480.5897354190045030.294867709502252
1020.7012209874675450.597558025064910.298779012532455
1030.7114521506006530.5770956987986940.288547849399347
1040.6876755618053320.6246488763893350.312324438194668
1050.6802531709843430.6394936580313140.319746829015657
1060.7255031413930310.5489937172139390.274496858606969
1070.7737398715872550.4525202568254910.226260128412745
1080.747498198476660.505003603046680.25250180152334
1090.7125909800446140.5748180399107710.287409019955386
1100.671404214927350.6571915701452990.328595785072650
1110.670837605873640.6583247882527200.329162394126360
1120.625041689680330.7499166206393390.374958310319669
1130.6667165048257280.6665669903485430.333283495174272
1140.6727912682670250.6544174634659510.327208731732975
1150.673680032390490.652639935219020.32631996760951
1160.6307512985399540.7384974029200910.369248701460046
1170.7052500754580130.5894998490839740.294749924541987
1180.7104273856787970.5791452286424050.289572614321203
1190.7226798189883980.5546403620232040.277320181011602
1200.741821920714150.5163561585716990.258178079285849
1210.7434408109094220.5131183781811550.256559189090578
1220.6998408453754770.6003183092490450.300159154624523
1230.7182949792448080.5634100415103830.281705020755192
1240.7095937742713030.5808124514573940.290406225728697
1250.6876228730235240.6247542539529510.312377126976476
1260.6366475990209270.7267048019581450.363352400979073
1270.6183102054395370.7633795891209260.381689794560463
1280.5751895922277410.8496208155445170.424810407772259
1290.6093580682214780.7812838635570430.390641931778522
1300.5774982207337690.8450035585324620.422501779266231
1310.5659491886141860.8681016227716280.434050811385814
1320.510286868238720.979426263522560.48971313176128
1330.5613614534923640.8772770930152720.438638546507636
1340.6232887130759430.7534225738481150.376711286924057
1350.7065176384034330.5869647231931340.293482361596567
1360.6464213783917280.7071572432165440.353578621608272
1370.6076505126556150.784698974688770.392349487344385
1380.5813404118402710.8373191763194590.418659588159729
1390.5794220485183080.8411559029633830.420577951481692
1400.5923500711283140.8152998577433730.407649928871686
1410.7148761691750050.570247661649990.285123830824995
1420.6594857112994030.6810285774011940.340514288700597
1430.6920413016618760.6159173966762480.307958698338124
1440.8706050195481250.258789960903750.129394980451875
1450.8165258313160930.3669483373678150.183474168683907
1460.7713401232419790.4573197535160430.228659876758021
1470.916341010491270.167317979017460.08365898950873
1480.8465221525390570.3069556949218870.153477847460943
1490.7346740293320630.5306519413358730.265325970667937
1500.5788582617772070.8422834764455870.421141738222793


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


http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/13gg51291284123.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/13gg51291284123.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/23gg51291284123.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/23gg51291284123.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/66yxb1291284123.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t129128496843dqvpta3ouos1w/66yxb1291284123.ps (open in new window)


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


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


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