Home » date » 2010 » Dec » 15 »

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 15 Dec 2010 17:40:40 +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/15/t1292435014psxl7bn8wnvdncv.htm/, Retrieved Wed, 15 Dec 2010 18:43:34 +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/15/t1292435014psxl7bn8wnvdncv.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
5 0 4 0 5 0 6 0 6 0 6 0 7 0 8 0 7 0 8 0 7 0 8 0 8 0 9 0 9 0 8 0 9 0 9 0 10 0 11 0 12 0 13 0 13 0 13 0 14 0 14 0 15 0 15 0 16 0 16 0 17 0 18 0 19 0 20 0 22 0 20 0 22 0 25 0 24 0 25 0 28 0 26 0 27 0 26 0 25 0 27 0 28 0 30 0 31 0 32 0 34 0 34 0 33 0 32 0 34 0 36 0 37 0 40 0 38 0 38 0 36 0 40 0 40 0 42 0 44 0 45 0 47 0 49 0 47 0 49 0 52 0 50 0 50 0 57 0 58 0 58 0 58 0 61 0 61 0 64 0 68 0 40 0 34 0 46 0 36 0 34 0 45 0 55 0 50 0 56 0 72 0 76 0 78 0 77 0 90 0 88 0 97 0 93 0 84 0 67 0 72 0 75 0 71 0 75 0 90 0 78 0 73 0 62 0 65 0 61 0 58 0 33 0 39 0 56 0 79 0 82 0 79 0 73 0 87 0 85 0 83 0 82 0 83 0 92 0 95 0 97 0 87 0 84 0 84 0 89 0 103 0 106 0 109 0 106 0 105 0 115 0 120 0 124 0 121 0 131 0 139 0 133 0 119 0 123 0 120 0 128 0 134 0 126 0 115 0 106 0 99 0 100 0 99 0 99 0 100 0 100 0 108 0 109 0 115 0 114 0 108 0 113 0 118 0 122 0 118 0 121 0 118 0 121 0 etc...
 
Output produced by software:

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


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


Multiple Linear Regression - Estimated Regression Equation
CO2-uitstoot[t] = -4.14151777712791 -19.0254747328007`Kyoto-protocol`[t] + 0.755971303781826t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-4.141517777127911.750778-2.36550.0191110.009556
`Kyoto-protocol`-19.02547473280075.984213-3.17930.001750.000875
t0.7559713037818260.01755443.065700


Multiple Linear Regression - Regression Statistics
Multiple R0.95782498600972
R-squared0.91742870382452
Adjusted R-squared0.916474122365844
F-TEST (value)961.079534371974
F-TEST (DF numerator)2
F-TEST (DF denominator)173
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation11.4306480477221
Sum Squared Residuals22604.1306588244


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
15-3.385546473346078.38554647334607
24-2.629575169564276.62957516956427
35-1.87360386578256.8736038657825
46-1.117632562000627.11763256200062
56-0.3616612582187976.3616612582188
660.3943100455630285.60568995443697
771.150281349344855.84971865065515
881.906252653126686.09374734687332
972.662223956908514.33777604309149
1083.418195260690334.58180473930967
1174.174166564472162.82583343552784
1284.930137868253983.06986213174602
1385.686109172035812.31389082796419
1496.442080475817632.55791952418237
1597.198051779599461.80194822040054
1687.954023083381290.0459769166187149
1798.709994387163110.290005612836889
1899.46596569094494-0.465965690944936
191010.2219369947268-0.221936994726762
201110.97790829850860.0220917014914120
211211.73387960229040.266120397709586
221312.48985090607220.510149093927761
231313.2458222098541-0.245822209854065
241314.0017935136359-1.00179351363589
251414.7577648174177-0.757764817417717
261415.5137361211995-1.51373612119954
271516.2697074249814-1.26970742498137
281517.0256787287632-2.02567872876319
291617.7816500325450-1.78165003254502
301618.5376213363268-2.53762133632685
311719.2935926401087-2.29359264010867
321820.0495639438905-2.04956394389050
331920.8055352476723-1.80553524767232
342021.5615065514541-1.56150655145415
352222.3174778552360-0.317477855235974
362023.0734491590178-3.0734491590178
372223.8294204627996-1.82942046279963
382524.58539176658150.414608233418546
392425.3413630703633-1.34136307036328
402526.0973343741451-1.09733437414511
412826.85330567792691.14669432207307
422627.6092769817088-1.60927698170876
432728.3652482854906-1.36524828549058
442629.1212195892724-3.12121958927241
452529.8771908930542-4.87719089305423
462730.6331621968361-3.63316219683606
472831.3891335006179-3.38913350061788
483032.1451048043997-2.14510480439971
493132.9010761081815-1.90107610818153
503233.6570474119634-1.65704741196336
513434.4130187157452-0.413018715745189
523435.168990019527-1.16899001952701
533335.9249613233088-2.92496132330884
543236.6809326270907-4.68093262709067
553437.4369039308725-3.43690393087249
563638.1928752346543-2.19287523465432
573738.9488465384361-1.94884653843614
584039.7048178422180.295182157782031
593840.4607891459998-2.46078914599979
603841.2167604497816-3.21676044978162
613641.9727317535634-5.97273175356345
624042.7287030573453-2.72870305734527
634043.4846743611271-3.4846743611271
644244.2406456649089-2.24064566490892
654444.9966169686908-0.996616968690749
664545.7525882724726-0.752588272472574
674746.50855957625440.4914404237456
684947.26453088003621.73546911996377
694748.0205021838181-1.02050218381805
704948.77647348759990.223526512400124
715249.53244479138172.46755520861830
725050.2884160951635-0.288416095163528
735051.0443873989454-1.04438739894535
745751.80035870272725.19964129727282
755852.5563300065095.44366999349099
765853.31230131029084.68769868970917
775854.06827261407273.93172738592734
786154.82424391785456.17575608214552
796155.58021522163635.41978477836369
806456.33618652541817.66381347458186
816857.092157829210.9078421708000
824057.8481291329818-17.8481291329818
833458.6041004367636-24.6041004367636
844659.3600717405454-13.3600717405454
853660.1160430443273-24.1160430443273
863460.8720143481091-26.8720143481091
874561.6279856518909-16.6279856518909
885562.3839569556727-7.38395695567274
895063.1399282594546-13.1399282594546
905663.8958995632364-7.8958995632364
917264.65187086701827.34812913298178
927665.407842170810.5921578292000
937866.163813474581911.8361865254181
947766.919784778363710.0802152216363
959067.675756082145522.3242439178545
968868.431727385927319.5682726140727
979769.187698689709227.8123013102908
989369.94366999349123.056330006509
998470.699641297272813.3003587027272
1006771.4556126010547-4.45561260105465
1017272.2115839048365-0.211583904836474
1027572.96755520861832.0324447913817
1037173.7235265124001-2.72352651240013
1047574.4794978161820.520502183818048
1059075.235469119963814.7645308800362
1067875.99144042374562.00855957625440
1077376.7474117275274-3.74741172752743
1086277.5033830313093-15.5033830313093
1096578.259354335091-13.2593543350911
1106179.0153256388729-18.0153256388729
1115879.7712969426547-21.7712969426547
1123380.5272682464365-47.5272682464365
1133981.2832395502184-42.2832395502184
1145682.0392108540002-26.0392108540002
1157982.795182157782-3.79518215778203
1168283.5511534615639-1.55115346156386
1177984.3071247653457-5.30712476534568
1187385.0630960691275-12.0630960691275
1198785.81906737290931.18093262709067
1208586.5750386766912-1.57503867669116
1218387.331009980473-4.33100998047299
1228288.0869812842548-6.08698128425481
1238388.8429525880366-5.84295258803664
1249289.59892389181852.40107610818154
1259590.35489519560034.64510480439971
1269791.11086649938215.88913350061789
1278791.866837803164-4.86683780316394
1288492.6228091069458-8.62280910694576
1298493.3787804107276-9.3787804107276
1308994.1347517145094-5.13475171450942
13110394.89072301829128.10927698170876
13210695.64669432207310.3533056779269
13310996.402665625854912.5973343741451
13410697.15863692963678.84136307036328
13510597.91460823341857.08539176658145
13611598.670579537200416.3294204627996
13712099.426550840982220.5734491590178
138124100.18252214476423.817477855236
139121100.93849344854620.0615065514542
140131101.69446475232829.3055352476723
141139102.45043605610936.5495639438905
142133103.20640735989129.7935926401087
143119103.96237866367315.0376213363268
144123104.71834996745518.2816500325450
145120105.47432127123714.5256787287632
146128106.23029257501921.7697074249814
147134106.98626387880027.0137361211995
148126107.74223518258218.2577648174177
149115108.4982064863646.5017935136359
150106109.254177790146-3.25417779014593
15199110.010149093928-11.0101490939278
152100110.766120397710-10.7661203977096
15399111.522091701491-12.5220917014914
15499112.278063005273-13.2780630052732
155100113.034034309055-13.0340343090551
156100113.790005612837-13.7900056128369
157108114.545976916619-6.54597691661871
158109115.301948220401-6.30194822040054
159115116.057919524182-1.05791952418236
160114116.813890827964-2.81389082796419
161108117.569862131746-9.56986213174602
162113118.325833435528-5.32583343552785
163118119.081804739310-1.08180473930967
164122119.8377760430912.1622239569085
165118120.593747346873-2.59374734687332
166121121.349718650655-0.349718650655150
167118122.105689954437-4.10568995443698
168121122.861661258219-1.8616612582188
169121123.617632562001-2.61763256200063
170112124.373603865782-12.3736038657825
171119125.129575169564-6.12957516956428
172116125.885546473346-9.8855464733461
173110107.6160430443272.38395695567274
174111108.3720143481092.62798565189091
175106109.127985651891-3.12798565189091
176108109.883956955673-1.88395695567274


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
60.0002492578982676950.000498515796535390.999750742101732
71.36382402959156e-052.72764805918313e-050.999986361759704
81.15759564259917e-062.31519128519833e-060.999998842404357
91.20504208821981e-072.41008417643963e-070.999999879495791
105.86643214753693e-091.17328642950739e-080.999999994133568
111.56276469318397e-093.12552938636795e-090.999999998437235
129.00482382075089e-111.80096476415018e-100.999999999909952
135.9956137896972e-121.19912275793944e-110.999999999994004
143.31369945910701e-136.62739891821402e-130.999999999999669
151.6184105187675e-143.236821037535e-140.999999999999984
165.54284075733313e-151.10856815146663e-140.999999999999994
173.25377807893474e-166.50755615786948e-161
182.25344075079091e-174.50688150158181e-171
191.23628991731868e-182.47257983463736e-181
201.66122039183249e-193.32244078366499e-191
217.39886624170266e-201.47977324834053e-191
227.49692528802564e-201.49938505760513e-191
231.39710232090540e-202.79420464181080e-201
241.26690002807663e-212.53380005615327e-211
252.29009380750139e-224.58018761500278e-221
262.06156718317198e-234.12313436634396e-231
273.57660880091938e-247.15321760183876e-241
283.17052395893258e-256.34104791786516e-251
295.25937375975203e-261.05187475195041e-251
304.57084414613945e-279.1416882922789e-271
317.24681868013422e-281.44936373602684e-271
322.40890985987076e-284.81781971974153e-281
331.58337738848071e-283.16675477696142e-281
341.73444532544484e-283.46889065088968e-281
352.468137758833e-274.936275517666e-271
362.76484972305770e-285.52969944611539e-281
371.34716416443245e-282.69432832886491e-281
383.71055089252259e-277.42110178504519e-271
391.90232180351005e-273.8046436070201e-271
401.21625833178627e-272.43251666357253e-271
411.63103660688180e-263.26207321376359e-261
424.18659599825152e-278.37319199650305e-271
431.30339638700306e-272.60679277400613e-271
441.75592878549514e-283.51185757099028e-281
452.57120629904929e-295.14241259809858e-291
463.3593195525268e-306.7186391050536e-301
474.8446609616405e-319.689321923281e-311
481.52782105180880e-313.05564210361760e-311
495.90718321010035e-321.18143664202007e-311
502.75546957805599e-325.51093915611197e-321
514.38461052394556e-328.76922104789113e-321
522.47323076205896e-324.94646152411793e-321
534.28082723567737e-338.56165447135474e-331
545.69212365450691e-341.13842473090138e-331
558.92705361816418e-351.78541072363284e-341
562.81227270965848e-355.62454541931695e-351
571.04786543713228e-352.09573087426456e-351
583.64165621353425e-357.2833124270685e-351
598.3066703811261e-361.66133407622522e-351
601.38940123982163e-362.77880247964326e-361
612.44041127366140e-374.88082254732279e-371
625.71181109508085e-381.14236221901617e-371
639.64099965809368e-391.92819993161874e-381
643.17591145228337e-396.35182290456674e-391
652.79906124669582e-395.59812249339165e-391
662.65156751285962e-395.30313502571925e-391
677.36159442800386e-391.47231888560077e-381
685.56947029863132e-381.11389405972626e-371
692.27206399045775e-384.5441279809155e-381
702.08809594236772e-384.17619188473544e-381
711.27673041498184e-372.55346082996368e-371
725.5524623865718e-381.11049247731436e-371
731.5694799596314e-383.1389599192628e-381
748.94161147946263e-371.78832229589253e-361
752.11953965972773e-354.23907931945546e-351
761.10574249679397e-342.21148499358794e-341
772.11007749654016e-344.22015499308033e-341
781.60424191287760e-333.20848382575520e-331
794.256374009234e-338.512748018468e-331
804.03121226746757e-328.06242453493514e-321
812.88873064580402e-305.77746129160804e-301
826.96629267911383e-271.39325853582277e-261
834.50463680677019e-229.00927361354038e-221
841.28333809476269e-212.56667618952537e-211
857.41214918185849e-191.48242983637170e-181
863.98214099125216e-167.96428198250432e-161
879.59295929122672e-161.91859185824534e-151
884.38849579474083e-168.77699158948166e-161
894.20116443112293e-168.40232886224586e-161
902.03269430916162e-164.06538861832325e-161
916.15553657675238e-161.23110731535048e-151
923.8668793616052e-157.7337587232104e-150.999999999999996
932.46456915590172e-144.92913831180343e-140.999999999999975
946.88013456098095e-141.37602691219619e-130.999999999999931
958.01006171464121e-121.60201234292824e-110.99999999999199
961.33331374137452e-102.66662748274904e-100.999999999866669
971.63701867048421e-083.27403734096842e-080.999999983629813
982.12118705238581e-074.24237410477162e-070.999999787881295
993.40368718289113e-076.80737436578227e-070.999999659631282
1002.06027483762141e-074.12054967524283e-070.999999793972516
1011.17596971737131e-072.35193943474263e-070.999999882403028
1026.99999236412574e-081.39999847282515e-070.999999930000076
1033.94203173207816e-087.88406346415632e-080.999999960579683
1042.21692105925469e-084.43384211850939e-080.99999997783079
1054.88139801104203e-089.76279602208405e-080.99999995118602
1062.94471329761217e-085.88942659522435e-080.999999970552867
1071.69898868902283e-083.39797737804565e-080.999999983010113
1082.57505957586776e-085.15011915173553e-080.999999974249404
1092.76838714717085e-085.5367742943417e-080.999999972316129
1105.51060568864958e-081.10212113772992e-070.999999944893943
1111.94888464613313e-073.89776929226626e-070.999999805111535
1120.0003260760888149310.0006521521776298620.999673923911185
1130.01902835806431360.03805671612862730.980971641935686
1140.05941287089272630.1188257417854530.940587129107274
1150.05286023657871790.1057204731574360.947139763421282
1160.0458209842585650.091641968517130.954179015741435
1170.04319829656343940.08639659312687890.95680170343656
1180.05607381825097030.1121476365019410.94392618174903
1190.04987102543820870.09974205087641750.950128974561791
1200.04641814499912330.09283628999824650.953581855000877
1210.04763948098281250.0952789619656250.952360519017187
1220.05463184623556320.1092636924711260.945368153764437
1230.06560703704241430.1312140740848290.934392962957586
1240.06384978496090180.1276995699218040.936150215039098
1250.06093468619099420.1218693723819880.939065313809006
1260.05767943356494660.1153588671298930.942320566435053
1270.07575624648176680.1515124929635340.924243753518233
1280.1338703011954360.2677406023908730.866129698804564
1290.2646870643436040.5293741286872080.735312935656396
1300.4225432896996460.8450865793992930.577456710300354
1310.4604734168345770.9209468336691530.539526583165423
1320.4884365407060630.9768730814121260.511563459293937
1330.5063257589570760.987348482085850.493674241042925
1340.5438415229229220.9123169541541560.456158477077078
1350.6035482221564010.7929035556871990.396451777843599
1360.6114757124846710.7770485750306570.388524287515329
1370.6170126813965120.7659746372069770.382987318603488
1380.6327297954108570.7345404091782850.367270204589143
1390.6228493010391410.7543013979217170.377150698960859
1400.6930576759062270.6138846481875460.306942324093773
1410.8696147476888550.2607705046222910.130385252311145
1420.9345377780078170.1309244439843670.0654622219921835
1430.9236577009283830.1526845981432340.0763422990716169
1440.928365499323290.1432690013534210.0716345006767105
1450.924292839363190.1514143212736190.0757071606368094
1460.9647533116986270.07049337660274630.0352466883013732
1470.998843095152310.002313809695380520.00115690484769026
1480.999990341398821.93172023594116e-059.65860117970579e-06
1490.9999994571265551.08574689022487e-065.42873445112437e-07
1500.9999994527496551.09450069054273e-065.47250345271363e-07
1510.9999986603185932.67936281445508e-061.33968140722754e-06
1520.9999967710323976.45793520629271e-063.22896760314635e-06
1530.9999940992995631.18014008740522e-055.90070043702609e-06
1540.9999926451918351.47096163305649e-057.35480816528247e-06
1550.9999936854943461.26290113071170e-056.31450565355848e-06
1560.9999986451918342.70961633206066e-061.35480816603033e-06
1570.9999974196801895.16063962209662e-062.58031981104831e-06
1580.9999958681212318.26375753744413e-064.13187876872206e-06
1590.9999864165479872.71669040254847e-051.35834520127424e-05
1600.999958284209248.3431581518324e-054.1715790759162e-05
1610.9999921651475541.56697048928989e-057.83485244644946e-06
1620.9999971373864515.72522709790285e-062.86261354895143e-06
1630.9999931891309291.36217381426842e-056.81086907134212e-06
1640.9999701771239345.96457521311375e-052.98228760655687e-05
1650.999918571827620.0001628563447606048.14281723803022e-05
1660.9996377384766420.0007245230467164330.000362261523358216
1670.9988849216599140.002230156680171710.00111507834008586
1680.9956946723019450.008610655396109240.00430532769805462
1690.9902674932791260.01946501344174730.00973250672087366
1700.9944274729019510.01114505419609770.00557252709804887


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1290.781818181818182NOK
5% type I error level1320.8NOK
10% type I error level1380.836363636363636NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/10slak1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/10slak1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/1l2dq1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/1l2dq1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/2l2dq1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/2l2dq1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/3vtub1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/3vtub1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/4vtub1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/4vtub1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/5vtub1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/5vtub1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/6okbw1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/6okbw1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/7hbbz1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/7hbbz1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/8hbbz1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/8hbbz1292434829.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/9hbbz1292434829.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/15/t1292435014psxl7bn8wnvdncv/9hbbz1292434829.ps (open in new window)


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