Home » date » 2008 » Dec » 24 »

*Unverified author*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 24 Dec 2008 05:53:19 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk.htm/, Retrieved Wed, 24 Dec 2008 13:54:57 +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/2008/Dec/24/t1230123297al3wov3aqbdmgtk.htm/},
    year = {2008},
}
@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 = {2008},
    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 «
1778.8 0 1264.9 0 1749.1 0 1795.6 0 1759 0 1645.1 0 1589.9 0 1712.6 0 1782.5 0 1606.6 0 1882.1 0 1846.9 0 1873.2 0 1368.3 0 1843.5 0 2074.5 0 1848.5 0 1909.3 0 1932.9 0 2119.1 0 2202 0 2260.8 0 2097.1 0 2026.2 0 2475.2 0 1732.3 0 2385.2 0 2362.2 0 2119 0 2260.3 0 2006.5 0 2073.2 0 2207.8 0 2018.9 0 2082.8 0 2314.3 0 2252.7 0 1633.1 0 2161.1 0 1987.9 0 1870.3 0 1984.6 0 1735.9 0 1910 0 2410.1 0 1994.6 0 2152.3 0 2554 0 2754.5 0 1812.3 0 2549.9 0 2558.4 0 2279.2 0 2591.8 0 2442.4 0 2607.7 0 3106.7 0 2447.5 0 3129.5 0 2606.6 0 2964.4 0 2211.6 0 3246.1 0 3141.8 0 3125.9 0 2890.5 0 2554.3 0 2771.1 0 2950 0 2512.1 0 2800 0 2877.2 0 3048.7 0 2082.7 0 2454.8 0 2807.8 0 2627.6 0 2515.9 0 2690.3 0 2770.8 0 2907.7 0 2906.3 0 3104.6 0 2862.1 0 3189.1 0 2071.8 0 2907.7 0 3194.5 0 2722.9 0 2854.8 0 2803 0 2744.9 0 2574.2 0 2740.9 0 2635.9 0 2612.7 0 3094.2 0 2029 0 2931.1 0 2952.2 0 2601.9 0 2874 0 2570.9 0 2849.8 0 3171.5 0 2843.6 0 2831.5 0 3284.4 0 3230.1 0 2412.2 0 3052.7 0 3048.9 0 2819.9 0 2962.7 0 2796.6 0 2857.2 0 3213.1 0 3116.2 0 3340.1 0 3602 0 3626.4 0 2741.6 1 3756.2 1 3140 1 3421.6 1 3243.7 1 3085.2 1 3152.8 1 3543.6 1 2959.3 1 3594.1 1 3207.9 1 3366.7 1 2658.4 1 3340.4 1 3368.4 1 3422.1 1 3268 1 3234.4 1 3365.1 1 3923.6 1 3147.3 1 3447.7 1 3719.8 1 4090.4 1 3386.7 1 3436.8 1 3744.9 1 3325.8 1 3322.1 1 3338.6 1 3464.2 1 3404.1 1 3942 1 3859.9 1 3895.4 1 4472.2 1 3025.5 1 4285.9 1
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
x[t] = + 1860.37374978546 + 31.8182439467815y[t] + 198.457381864272M1[t] -657.709842997264M2[t] + 20.9885209945413M3[t] + 1.38451663698662M4[t] -182.438547942637M5[t] -165.300074060722M6[t] -295.930830948037M7[t] -183.523126296891M8[t] + 35.0999629696392M9[t] -200.061563148446M10[t] -22.7384738819152M11[t] + 12.0230645796233t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1860.3737497854674.91872124.831900
y31.818243946781563.3520870.50220.6162570.308129
M1198.45738186427288.1337822.25180.0258390.01292
M2-657.70984299726488.273178-7.450800
M320.988520994541388.2422580.23790.8123320.406166
M41.3845166369866289.8444620.01540.9877260.493863
M5-182.43854794263789.81554-2.03130.0440560.022028
M6-165.30007406072289.790467-1.8410.0676720.033836
M7-295.93083094803789.769246-3.29660.0012310.000615
M8-183.52312629689189.75188-2.04480.0426850.021342
M935.099962969639289.738370.39110.696270.348135
M10-200.06156314844689.728719-2.22960.0273090.013655
M11-22.738473881915289.722928-0.25340.8002950.400147
t12.02306457962330.58856120.427900


Multiple Linear Regression - Regression Statistics
Multiple R0.939939513213987
R-squared0.883486288500946
Adjusted R-squared0.873040231607927
F-TEST (value)84.5760555919816
F-TEST (DF numerator)13
F-TEST (DF denominator)145
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation228.7445591583
Sum Squared Residuals7586990.63495614


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11778.82070.85419622936-292.054196229358
21264.91226.7100359474438.1899640525580
31749.11917.43146451887-168.331464518871
41795.61909.85052474094-114.250524740939
517591738.0505247409420.9494752590602
61645.11767.21206320248-122.112063202478
71589.91648.60437089479-58.7043708947854
81712.61773.03514012555-60.435140125555
91782.52003.68129397171-221.181293971709
101606.61780.54283243325-173.942832433247
111882.11969.8889862794-87.7889862794011
121846.92004.65052474094-157.750524740939
131873.22215.13097118483-341.930971184835
141368.31370.98681090292-2.68681090292151
151843.52061.70823947435-218.208239474351
162074.52054.1272996964220.3727003035804
171848.51882.32729969642-33.8272996964194
181909.31911.48883815796-2.18883815795797
191932.91792.88114585027140.018854149734
202119.11917.31191508103201.788084918965
2122022147.9580689271954.0419310728112
222260.81924.81960738873335.980392611273
232097.12114.16576123488-17.0657612348812
242026.22148.92729969642-122.727299696420
252475.22359.40774614031115.792253859685
261732.31515.26358585840217.036414141597
272385.22205.98501442983179.214985570169
282362.22198.4040746519163.795925348100
2921192026.604074651992.3959253481005
302260.32055.76561311344204.534386886562
312006.51937.1579208057569.3420791942541
322073.22061.5886900365111.6113099634849
332207.82292.23484388267-84.4348438826686
342018.92069.09638234421-50.1963823442072
352082.82258.44253619036-175.642536190361
362314.32293.204074651921.0959253481005
372252.72503.68452109580-250.984521095795
381633.11659.54036081388-26.4403608138824
392161.12350.26178938531-189.161789385311
401987.92342.68084960738-354.78084960738
411870.32170.88084960738-300.580849607380
421984.62200.04238806892-215.442388068918
431735.92081.43469576123-345.534695761226
4419102205.86546499199-295.865464991995
452410.12436.51161883815-26.4116188381489
461994.62213.37315729969-218.773157299687
472152.32402.71931114584-250.419311145841
4825542437.48084960738116.519150392620
492754.52647.96129605127106.538703948725
501812.31803.817135769368.48286423063748
512549.92494.5385643407955.3614356592092
522558.42486.9576245628671.4423754371405
532279.22315.15762456286-35.9576245628599
542591.82344.3191630244247.480836975602
552442.42225.71147071671216.688529283294
562607.72350.14223994747257.557760052525
573106.72580.78839379363525.911606206371
582447.52357.6499322551789.8500677448326
593129.52546.99608610132582.503913898679
602606.62581.7576245628624.8423754371402
612964.42792.23807100676172.161928993245
622211.61948.09391072484263.506089275157
633246.12638.81533929627607.284660703729
643141.82631.23439951834510.56560048166
653125.92459.43439951834666.46560048166
662890.52488.59593797988401.904062020122
672554.32369.98824567219184.311754327814
682771.12494.41901490296276.680985097045
6929502725.06516874911224.934831250891
702512.12501.9267072106510.1732927893524
7128002691.2728610568108.727138943199
722877.22726.03439951834151.16560048166
733048.72936.51484596224112.185154037765
742082.72092.37068568032-9.67068568032276
752454.82783.09211425175-328.292114251751
762807.82775.5111744738232.2888255261804
772627.62603.7111744738223.8888255261802
782515.92632.87271293536-116.972712935358
792690.32514.26502062767176.034979372334
802770.82638.69578985844132.104210141565
812907.72869.3419437045938.3580562954109
822906.32646.20348216613260.096517833873
833104.62835.54963601228269.050363987718
842862.12870.31117447382-8.21117447382002
853189.13080.79162091772108.308379082285
862071.82236.64746063580-164.847460635802
872907.72927.36888920723-19.6688892072313
883194.52919.7879494293274.7120505707
892722.92747.9879494293-25.0879494292996
902854.82777.1494878908477.6505121091618
9128032658.54179558315144.458204416854
922744.92782.97256481392-38.072564813915
932574.23013.61871866007-439.418718660069
942740.92790.48025712161-49.5802571216073
952635.92979.82641096776-343.926410967761
962612.73014.5879494293-401.8879494293
973094.23225.06839587320-130.868395873195
9820292380.92423559128-351.924235591283
992931.13071.64566416271-140.545664162711
1002952.23064.06472438478-111.86472438478
1012601.92892.26472438478-290.364724384780
10228742921.42626284632-47.4262628463183
1032570.92802.81857053863-231.918570538626
1042849.82927.24933976940-77.4493397693951
1053171.53157.8954936155513.6045063844511
1062843.62934.75703207709-91.1570320770877
1072831.53124.10318592324-292.603185923241
1083284.43158.86472438478125.535275615221
1093230.13369.34517082868-139.245170828675
1102412.22525.20101054676-113.001010546763
1113052.73215.92243911819-163.222439118191
1123048.93208.34149934026-159.44149934026
1132819.93036.54149934026-216.64149934026
1142962.73065.7030378018-103.003037801798
1152796.62947.09534549411-150.495345494106
1162857.23071.52611472488-214.326114724875
1173213.13302.17226857103-89.0722685710288
1183116.23079.0338070325737.1661929674326
1193340.13268.3799608787271.7200391212786
12036023303.14149934026298.85850065974
1213626.43513.62194578416112.778054215845
1222741.62701.2960294490240.303970550976
1233756.23392.01745802045364.182541979548
12431403384.43651824252-244.436518242521
1253421.63212.63651824252208.963481757479
1263243.73241.798056704061.90194329594045
1273085.23123.19036439637-37.9903643963674
1283152.83247.62113362714-94.821133627136
1293543.63478.2672874732965.3327125267097
1302959.33255.12882593483-295.828825934829
1313594.13444.47497978098149.625020219018
1323207.93479.23651824252-271.336518242521
1333366.73689.71696468642-323.016964686417
1342658.42845.57280440450-187.172804404504
1353340.43536.29423297593-195.894232975932
1363368.43528.713293198-160.313293198001
1373422.13356.91329319865.1867068019989
13832683386.07483165954-118.074831659539
1393234.43267.46713935185-33.0671393518472
1403365.13391.89790858262-26.7979085826166
1413923.63622.54406242877301.055937571230
1423147.33399.40560089031-252.105600890309
1433447.73588.75175473646-141.051754736463
1443719.83623.51329319896.286706801999
1454090.43833.9937396419256.406260358104
1463386.72989.84957935998396.850420640016
1473436.83680.57100793141-243.771007931412
1483744.93672.9900681534871.909931846519
1493325.83501.19006815348-175.390068153481
1503322.13530.35160661502-208.251606615020
1513338.63411.74391430733-73.1439143073275
1523464.23536.17468353810-71.9746835380966
1533404.13766.82083738425-362.720837384251
15439423543.68237584579398.317624154211
1553859.93733.02852969194126.871470308058
1563895.43767.79006815348127.609931846519
1574472.23978.27051459738493.929485402623
1583025.53134.12635431546-108.626354315464
1594285.93824.84778288689461.052217113107


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
170.03087434237642850.06174868475285710.969125657623572
180.01617463862387280.03234927724774570.983825361376127
190.01502567079092690.03005134158185370.984974329209073
200.01707139900960170.03414279801920340.982928600990398
210.01503169635185650.0300633927037130.984968303648143
220.05830026905128410.1166005381025680.941699730948716
230.03186486919736710.06372973839473410.968135130802633
240.0179361536712440.0358723073424880.982063846328756
250.01952202602573920.03904405205147840.98047797397426
260.01032637625454080.02065275250908160.98967362374546
270.006983115132345170.01396623026469030.993016884867655
280.00353001230650830.00706002461301660.996469987693492
290.00229904414341880.00459808828683760.997700955856581
300.001146625460816890.002293250921633770.998853374539183
310.001031062392094320.002062124784188640.998968937607906
320.001463535375186710.002927070750373420.998536464624813
330.001218411871897200.002436823743794400.998781588128103
340.002017785148242670.004035570296485350.997982214851757
350.002660563297965910.005321126595931820.997339436702034
360.001463725094500280.002927450189000550.9985362749055
370.002010821481651980.004021642963303950.997989178518348
380.002345384879532960.004690769759065930.997654615120467
390.002708991806465730.005417983612931450.997291008193534
400.01369524995834420.02739049991668830.986304750041656
410.02774433091910720.05548866183821450.972255669080893
420.03235556632905910.06471113265811810.96764443367094
430.06448105490515680.1289621098103140.935518945094843
440.09066827084311660.1813365416862330.909331729156883
450.07373404527567380.1474680905513480.926265954724326
460.0795052522258530.1590105044517060.920494747774147
470.08212252873240790.1642450574648160.917877471267592
480.0801175496581130.1602350993162260.919882450341887
490.0980625433403850.196125086680770.901937456659615
500.07773521500465270.1554704300093050.922264784995347
510.06905296799705620.1381059359941120.930947032002944
520.05859624945393010.1171924989078600.94140375054607
530.0481677296807440.0963354593614880.951832270319256
540.04971899050229230.09943798100458460.950281009497708
550.0475899951736630.0951799903473260.952410004826337
560.04703217901196120.09406435802392240.952967820988039
570.1165681398894330.2331362797788670.883431860110567
580.09389948259407790.1877989651881560.906100517405922
590.2431946854838970.4863893709677940.756805314516103
600.2098824057888410.4197648115776820.790117594211159
610.1883504410704550.3767008821409110.811649558929545
620.1633981907002470.3267963814004940.836601809299753
630.3082719969823150.616543993964630.691728003017685
640.3958751654893830.7917503309787670.604124834510617
650.6291842483134460.7416315033731080.370815751686554
660.6569318247901630.6861363504196730.343068175209837
670.6208773707356760.7582452585286480.379122629264324
680.6076421710746720.7847156578506550.392357828925328
690.5894187810427690.8211624379144630.410581218957231
700.5590878245742870.8818243508514260.440912175425713
710.5213355849217650.9573288301564690.478664415078234
720.4821346764638180.9642693529276360.517865323536182
730.4352602582337240.8705205164674470.564739741766276
740.4393069291899210.8786138583798420.560693070810079
750.5879814543030440.8240370913939120.412018545696956
760.5617632344883450.876473531023310.438236765511655
770.5397188385895840.9205623228208330.460281161410416
780.5494889696951350.901022060609730.450511030304865
790.5295726206253180.9408547587493630.470427379374682
800.5118258521735090.9763482956529820.488174147826491
810.4908338063771280.9816676127542570.509166193622872
820.5058980732588610.9882038534822780.494101926741139
830.544435070407530.911129859184940.45556492959247
840.511099009259490.977801981481020.48890099074051
850.476318574977060.952637149954120.52368142502294
860.4919162404009880.9838324808019760.508083759599012
870.4564108413532430.9128216827064850.543589158646757
880.5347363454502690.9305273090994620.465263654549731
890.5239051243301120.9521897513397760.476094875669888
900.5297235596534360.9405528806931270.470276440346564
910.5685476320451510.8629047359096980.431452367954849
920.5710010135511170.8579979728977670.428998986448884
930.6938826404412670.6122347191174660.306117359558733
940.6727199956596650.6545600086806710.327280004340335
950.7137659831693580.5724680336612850.286234016830642
960.7806048695638310.4387902608723380.219395130436169
970.7506029001065570.4987941997868870.249397099893443
980.7847188160797220.4305623678405560.215281183920278
990.7552133749628530.4895732500742950.244786625037147
1000.730880722554990.5382385548900210.269119277445010
1010.7351464985730330.5297070028539340.264853501426967
1020.7056434008156760.5887131983686470.294356599184324
1030.6860716012946020.6278567974107970.313928398705398
1040.6504150319480670.6991699361038650.349584968051933
1050.6090458909034310.7819082181931380.390954109096569
1060.561464687294790.877070625410420.43853531270521
1070.5676432741550750.864713451689850.432356725844925
1080.5339054677303040.9321890645393920.466094532269696
1090.5006440901273910.998711819745220.49935590987261
1100.4518384321401060.9036768642802130.548161567859893
1110.4253507692107980.8507015384215960.574649230789202
1120.3815508979552030.7631017959104060.618449102044797
1130.3701856212822640.7403712425645270.629814378717736
1140.3211594424465280.6423188848930560.678840557553472
1150.2831928728218850.566385745643770.716807127178115
1160.2630340197427990.5260680394855990.7369659802572
1170.2302275097383740.4604550194767470.769772490261626
1180.1876764891222600.3753529782445190.81232351087774
1190.1545113246915190.3090226493830370.845488675308481
1200.1541364723133990.3082729446267970.845863527686601
1210.1237649598497880.2475299196995770.876235040150212
1220.0971062754470270.1942125508940540.902893724552973
1230.1421238950445770.2842477900891540.857876104955423
1240.1279995459706840.2559990919413690.872000454029316
1250.1407189379961700.2814378759923400.85928106200383
1260.1373096553905820.2746193107811640.862690344609418
1270.1137603464121040.2275206928242070.886239653587896
1280.089812702456310.179625404912620.91018729754369
1290.08337684284776770.1667536856955350.916623157152232
1300.06943664289611550.1388732857922310.930563357103884
1310.07677829722832430.1535565944566490.923221702771676
1320.0600163550588830.1200327101177660.939983644941117
1330.09828138568546540.1965627713709310.901718614314535
1340.07749967977979160.1549993595595830.922500320220208
1350.06085093301654470.1217018660330890.939149066983455
1360.04329084843710880.08658169687421760.956709151562891
1370.03350496480855570.06700992961711140.966495035191444
1380.02072143813074020.04144287626148050.97927856186926
1390.01146102328676590.02292204657353180.988538976713234
1400.005903723305453380.01180744661090680.994096276694547
1410.04470569399285830.08941138798571660.955294306007142
1420.05224047048763930.1044809409752790.94775952951236


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level120.0952380952380952NOK
5% type I error level240.190476190476190NOK
10% type I error level350.277777777777778NOK
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/10spdt1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/10spdt1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/1ok661230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/1ok661230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/2dn0h1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/2dn0h1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/3y46n1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/3y46n1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/4zprv1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/4zprv1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/513rz1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/513rz1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/619v31230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/619v31230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/7vjvs1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/7vjvs1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/8p0wv1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/8p0wv1230123185.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/995ez1230123185.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/24/t1230123297al3wov3aqbdmgtk/995ez1230123185.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = 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