Home » date » 2009 » Nov » 20 »

workshop 7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Fri, 20 Nov 2009 07:31:26 -0700
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm.htm/, Retrieved Fri, 20 Nov 2009 15:33:23 +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/2009/Nov/20/t1258727590js7ojf76qskiydm.htm/},
    year = {2009},
}
@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 = {2009},
    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 «
8.0 2.77 8.0 7.8 7.6 7.6 8.0 2.93 8.0 8.0 7.8 7.6 7.9 2.91 8.0 8.0 8.0 7.8 7.9 2.69 7.9 8.0 8.0 8.0 8.0 2.38 7.9 7.9 8.0 8.0 8.5 2.58 8.0 7.9 7.9 8.0 9.2 3.19 8.5 8.0 7.9 7.9 9.4 2.82 9.2 8.5 8.0 7.9 9.5 2.72 9.4 9.2 8.5 8.0 9.5 2.53 9.5 9.4 9.2 8.5 9.6 2.70 9.5 9.5 9.4 9.2 9.7 2.42 9.6 9.5 9.5 9.4 9.7 2.50 9.7 9.6 9.5 9.5 9.6 2.31 9.7 9.7 9.6 9.5 9.5 2.41 9.6 9.7 9.7 9.6 9.4 2.56 9.5 9.6 9.7 9.7 9.3 2.76 9.4 9.5 9.6 9.7 9.6 2.71 9.3 9.4 9.5 9.6 10.2 2.44 9.6 9.3 9.4 9.5 10.2 2.46 10.2 9.6 9.3 9.4 10.1 2.12 10.2 10.2 9.6 9.3 9.9 1.99 10.1 10.2 10.2 9.6 9.8 1.86 9.9 10.1 10.2 10.2 9.8 1.88 9.8 9.9 10.1 10.2 9.7 1.82 9.8 9.8 9.9 10.1 9.5 1.74 9.7 9.8 9.8 9.9 9.3 1.71 9.5 9.7 9.8 9.8 9.1 1.38 9.3 9.5 9.7 9.8 9.0 1.27 9.1 9.3 9.5 9.7 9.5 1.19 9.0 9.1 9.3 9.5 10.0 1.28 9.5 9.0 9.1 9.3 10.2 1.19 10.0 9.5 9.0 9.1 10.1 1.22 10.2 10.0 9.5 9.0 10.0 1.47 10.1 10.2 10.0 9.5 9.9 1.46 10.0 10.1 10.2 10.0 10.0 1.96 9.9 10.0 10.1 10.2 9.9 1.88 10.0 9.9 10.0 10.1 9.7 2.03 9.9 10.0 9.9 10.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 time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Y[t] = + 0.218696812913364 + 0.0214033923580752X[t] + 1.38294217269954Y1[t] -0.440570189496239Y2[t] -0.255229751929124Y3[t] + 0.289096046118345Y4[t] -0.161991160311381M1[t] -0.138075749392786M2[t] -0.118629659389799M3[t] -0.158456291128355M4[t] -0.106289572157702M5[t] + 0.448837334806040M6[t] + 0.0935944507375918M7[t] -0.115701160265447M8[t] + 0.0501367232538751M9[t] -0.0165214692594234M10[t] + 0.0682679561748867M11[t] -0.000532440156977438t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.2186968129133640.1896271.15330.2506730.125337
X0.02140339235807520.0216470.98870.3244250.162213
Y11.382942172699540.07954717.385200
Y2-0.4405701894962390.139215-3.16470.001890.000945
Y3-0.2552297519291240.139883-1.82460.0701060.035053
Y40.2890960461183450.0807913.57830.000470.000235
M1-0.1619911603113810.068284-2.37230.018980.00949
M2-0.1380757493927860.069296-1.99260.0481740.024087
M3-0.1186296593897990.068567-1.73010.0857230.042861
M4-0.1584562911283550.06797-2.33130.0211070.010553
M5-0.1062895721577020.068547-1.55060.1231610.06158
M60.4488373348060400.0678496.615200
M70.09359445073759180.0757131.23620.218380.10919
M8-0.1157011602654470.084064-1.37630.1708230.085411
M90.05013672325387510.0848890.59060.5556930.277847
M10-0.01652146925942340.076516-0.21590.8293490.414675
M110.06826795617488670.0694990.98230.327580.16379
t-0.0005324401569774380.000333-1.59750.1123120.056156


Multiple Linear Regression - Regression Statistics
Multiple R0.988075861397124
R-squared0.97629390787567
Adjusted R-squared0.97353360947763
F-TEST (value)353.691437334976
F-TEST (DF numerator)17
F-TEST (DF denominator)146
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.171762517264902
Sum Squared Residuals4.30734490122769


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
187.999934348640626.56513593800204e-05
287.887581873894460.112418126105540
37.97.91284071473113-0.0128407147311306
47.97.787297888470550.112702111529449
587.876354134602850.123645865397153
68.58.5990464723441-0.0990464723440924
79.28.87483168024540.325168319754592
89.49.379335824861550.0206641751384513
99.59.41198495952790.0880150404720975
109.59.356795058389080.143204941610919
119.69.551954883314680.0480451166853189
129.79.647751988423270.0522480115767324
139.79.610087462275720.0899125377242815
149.69.559823794346770.0401762056532345
159.59.445970195577550.0540298044224499
169.49.343494038827230.0565059611727672
179.39.3306947729851-0.0306947729851053
189.69.78659524243471-0.186595242434714
1910.29.880594043613170.319405956386828
2010.210.3654016776522-0.165401677652248
2110.110.1536093237245-0.0536093237245325
229.99.878932995455780.0210670045442195
239.89.90133375180729-0.101333751807287
249.89.80830421914479-0.00830421914478972
259.79.71068977985856-0.010689779858562
269.59.56177002793082-0.0617700279308206
279.39.31860055580397-0.0186005558039693
289.19.10822694298252-0.00822694298252507
2998.991168797770140.00883120222986119
309.59.48709755497970.0129024450202934
31109.862003382528060.137996617471940
3210.210.08913878362670.110861216373288
3310.110.1548651879752-0.0548651879751908
34109.883550295319840.116449704680158
359.99.96685812102661-0.0668581210266119
36109.897864406970040.102135593029963
379.99.91259314191369-0.0125931419136879
389.79.75344875589052-0.053448755890519
399.59.485612444265070.0143875557349250
409.29.3082150806035-0.108215080603500
4199.05307675204474-0.0530767520447411
429.39.4590489894056-0.159048989405593
439.89.625020071244350.174979928755652
449.89.93987935575346-0.139879355753456
459.69.76099923182073-0.160999231820733
469.49.374193763245680.0258062367543196
479.39.4181629516424-0.118162951642399
489.29.34551958000688-0.145519580006878
499.29.074922402902180.125077597097823
5099.09893639455646-0.0989363945564631
518.88.83359430197203-0.033594301972027
528.78.582700314378580.117299685621415
538.78.638624906984670.0613750930153314
549.19.23371364275692-0.133713642756924
559.79.397962817886240.302037182113762
569.89.80783960969326-0.00783960969325669
579.69.73815617030158-0.138156170301581
589.49.31538905851460.0846109414853975
599.49.353327383692690.0466726163073101
609.59.436972103836340.0630278961636623
619.49.41281854735467-0.0128185473546724
629.39.202024022533310.0979759774666949
639.29.111665161121530.0883348388784693
6499.03899265803574-0.0389926580357383
658.98.848929975903530.0510700240964726
669.29.33797173420014-0.137971734200141
679.89.450644425016930.349355574983075
689.99.91424767569308-0.0142476756930777
699.69.84888282813138-0.248882828131385
709.29.25035053751939-0.0503505375193881
719.19.061750396967450.0382496030325490
729.19.1440676106036-0.0440676106036082
7399.04160621779176-0.0416062177917615
748.98.841930376118520.0580696238814814
758.78.73641301949088-0.0364130194908797
768.58.48198238771980.0180176122801927
778.38.3396153012381-0.0396153012380927
788.58.72594541186596-0.225945411865961
798.78.73366418325495-0.0336641832549470
808.48.711530219758-0.311530219758007
818.18.26732818696114-0.167328186961138
827.87.92912199841007-0.129121998410071
837.77.87383091439563-0.173830914395631
847.57.7855369605322-0.285536960532207
857.27.38374659899409-0.183746598994089
866.87.0257901688335-0.225790168833505
876.76.641125605903780.0588743940962178
886.46.66001851597483-0.260018515974828
896.36.36881825035568-0.068818250355677
906.86.82803024918125-0.0280302491812544
917.37.257368656534350.0426313434656451
927.17.46779438666528-0.367794386665276
9376.971354497143550.0286455028564546
946.86.87369927320372-0.0736992732037239
956.66.90796274699734-0.307962746997343
966.36.61218473621022-0.312184736210219
976.16.14609903722314-0.04609903722314
986.16.014866828678580.0851331713214155
996.36.155626607429560.144373392570437
1006.36.36366429394959-0.0636642939495871
10166.26487061324515-0.264870613245149
1026.26.34754352799597-0.147543527995965
1036.46.45877497223015-0.0587749722301495
1046.86.505214852422720.294785147577279
1057.56.999734668056530.500265331943468
1067.57.72643999299651-0.226439992996508
1077.67.45909532369640.140904676303603
1087.67.480977179229250.119022820770747
1097.47.47098487615743-0.0709848761574307
1107.37.193112572880550.106887427119448
1117.17.17234873053974-0.0723487305397426
1126.96.94023056510787-0.0402305651078727
1136.86.7614626866890.0385373133110015
1147.57.296574676842280.203425323157725
1157.67.94571456577115-0.345714565771149
1167.87.533485365202960.266514634797038
11787.724393894964110.275606105035888
1188.18.01845527147640.0815447285236073
1198.28.136535006287120.0634649937128786
1208.38.165320524336140.134679475663862
1218.28.140674154168650.0593258458313496
12287.985520585976770.0144794140232293
1237.97.769296499791160.130703500208844
1247.67.72377233569211-0.123772335692112
1257.67.439131294987220.160868705012778
1268.38.090818143605550.209181856394451
1278.48.75718267894413-0.357182678944133
1288.48.290734932494780.109265067505221
1298.48.228613784238340.171386215761664
1308.48.344260358518250.0557396414817489
1318.68.454858541324450.145141458675550
1328.98.659436070678780.240563929321219
1338.88.81661796464287-0.0166179646428731
1348.38.51570726989329-0.215707269893291
1357.57.88536581594696-0.385365815946965
1367.27.085958230395410.114041769604595
1377.47.166380093023610.23361990697639
1388.88.1925803385570.607419661443008
1399.39.52689159804203-0.226891598042029
1409.39.249038823473360.0509611765266366
1418.78.91232154426769-0.212321544267688
1428.28.2858501449478-0.0858501449478024
1438.38.081533230772020.218466769227983
1448.58.52423596369212-0.0242359636921239
1458.68.55503607873860.0449639212613928
1468.58.469229926797880.0307700732021162
1478.28.27702094301932-0.0770209430193227
1488.17.892781624204790.207218375795213
1497.98.00043054365104-0.100430543651034
1508.68.37593183177110.224068168228902
1518.79.01448212592127-0.314482125921266
1528.78.657755674775730.0422443252242692
1538.58.52775572288732-0.0277557228873226
1548.48.362961252002880.0370387479971244
1558.58.432796748075920.0672032519240788
1568.78.591828656336360.108171343663640
1578.78.6241893893380.0758106106619902
1588.68.490257401668560.109742598331439
1598.58.35451940440730.145480595592694
1608.38.282665123657470.0173348763425314
16188.12044187651919-0.120441876519189
1628.28.33910218405973-0.139102184059734
1638.18.41486479876782-0.314864798767821
1648.17.988602817926860.111397182073139


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
210.01633576860740600.03267153721481210.983664231392594
220.003348292180772740.006696584361545490.996651707819227
230.0006279853542179490.001255970708435900.999372014645782
240.002166749682453840.004333499364907680.997833250317546
250.0008579206306181360.001715841261236270.999142079369382
260.0002984303393325070.0005968606786650130.999701569660667
278.8473222566525e-050.000176946445133050.999911526777433
287.33684069859946e-050.0001467368139719890.999926631593014
291.92346611245317e-053.84693222490634e-050.999980765338875
304.11374083538347e-058.22748167076694e-050.999958862591646
317.00045475054603e-050.0001400090950109210.999929995452495
322.94832686394765e-055.8966537278953e-050.99997051673136
331.27262529376994e-052.54525058753989e-050.999987273747062
344.97329109433351e-069.94658218866703e-060.999995026708906
351.60252834949155e-063.20505669898311e-060.99999839747165
363.54621980007247e-067.09243960014494e-060.9999964537802
371.99721306392272e-063.99442612784544e-060.999998002786936
386.91888596496511e-071.38377719299302e-060.999999308111404
392.26592062592814e-074.53184125185629e-070.999999773407937
401.43158813397703e-072.86317626795407e-070.999999856841187
416.5376260532538e-081.30752521065076e-070.99999993462374
422.51617845274439e-085.03235690548878e-080.999999974838215
431.52183432237809e-083.04366864475618e-080.999999984781657
444.94393360118467e-099.88786720236934e-090.999999995056066
451.63997542157751e-093.27995084315503e-090.999999998360025
466.24852466291475e-101.24970493258295e-090.999999999375148
474.09357080156452e-108.18714160312904e-100.999999999590643
481.70913854819413e-103.41827709638826e-100.999999999829086
495.84910290747484e-101.16982058149497e-090.99999999941509
502.39178133890418e-104.78356267780836e-100.999999999760822
518.5855446840273e-111.71710893680546e-100.999999999914145
524.420510174586e-118.841020349172e-110.999999999955795
535.42119935740874e-111.08423987148175e-100.999999999945788
541.85663213541309e-113.71326427082619e-110.999999999981434
552.23924783037401e-114.47849566074802e-110.999999999977607
567.6881190342904e-121.53762380685808e-110.999999999992312
571.7243596343106e-113.4487192686212e-110.999999999982756
581.22749157836800e-112.45498315673600e-110.999999999987725
597.66765689909576e-121.53353137981915e-110.999999999992332
604.54497325590115e-129.08994651180231e-120.999999999995455
611.86311092168957e-123.72622184337915e-120.999999999998137
627.98045748313551e-131.59609149662710e-120.999999999999202
636.88591880002961e-131.37718376000592e-120.999999999999311
642.53374393601352e-135.06748787202704e-130.999999999999747
651.25864909964112e-132.51729819928224e-130.999999999999874
668.69348486020997e-141.73869697204199e-130.999999999999913
675.86863166892948e-131.17372633378590e-120.999999999999413
682.26804408845946e-134.53608817691891e-130.999999999999773
691.73224548716259e-123.46449097432517e-120.999999999998268
704.88195073662597e-119.76390147325194e-110.99999999995118
712.38619373968637e-114.77238747937274e-110.999999999976138
721.12506749867814e-112.25013499735628e-110.99999999998875
734.98351452800972e-129.96702905601944e-120.999999999995016
744.82383798642279e-129.64767597284558e-120.999999999995176
752.35688423201181e-124.71376846402361e-120.999999999997643
761.64621893326811e-123.29243786653623e-120.999999999998354
772.24912145522489e-124.49824291044979e-120.99999999999775
782.90436416481181e-125.80872832962361e-120.999999999997096
798.67104538361769e-101.73420907672354e-090.999999999132895
801.98815290012723e-093.97630580025446e-090.999999998011847
811.56792090286952e-093.13584180573904e-090.99999999843208
828.27460677297655e-101.65492135459531e-090.99999999917254
834.08507591418838e-108.17015182837677e-100.999999999591492
841.04466830262749e-092.08933660525498e-090.999999998955332
856.28386355368256e-101.25677271073651e-090.999999999371614
864.51835107943857e-109.03670215887715e-100.999999999548165
872.69893375264926e-095.39786750529853e-090.999999997301066
883.43094130953231e-096.86188261906462e-090.999999996569059
891.90995312236469e-093.81990624472938e-090.999999998090047
904.69310062633659e-099.38620125267318e-090.9999999953069
911.25977690588088e-082.51955381176177e-080.99999998740223
922.64527356865801e-075.29054713731602e-070.999999735472643
933.55623996672693e-077.11247993345387e-070.999999644376003
941.90691352123106e-073.81382704246212e-070.999999809308648
951.9511354252912e-063.9022708505824e-060.999998048864575
964.77896846057607e-059.55793692115214e-050.999952210315394
973.86734850744292e-057.73469701488584e-050.999961326514926
989.10359430658777e-050.0001820718861317550.999908964056934
990.0003229856092401110.0006459712184802220.99967701439076
1000.0003046847031273050.0006093694062546100.999695315296873
1010.001241047941891700.002482095883783390.998758952058108
1020.003542249779055920.007084499558111840.996457750220944
1030.004872074005739160.009744148011478330.99512792599426
1040.03721217250703680.07442434501407360.962787827492963
1050.1864700137271030.3729400274542060.813529986272897
1060.3959830830145870.7919661660291750.604016916985413
1070.423512180325270.847024360650540.57648781967473
1080.3760432724408500.7520865448816990.62395672755915
1090.3650539774572890.7301079549145780.634946022542711
1100.3372505469200590.6745010938401180.662749453079941
1110.3599408338428360.7198816676856730.640059166157164
1120.4152103734374720.8304207468749440.584789626562528
1130.3799964190916060.7599928381832110.620003580908394
1140.4594269323931810.9188538647863630.540573067606819
1150.6678991395903940.6642017208192130.332100860409606
1160.6834973104144540.6330053791710910.316502689585546
1170.6518418747009230.6963162505981550.348158125299077
1180.6591988341677270.6816023316645460.340801165832273
1190.7129720351246550.574055929750690.287027964875345
1200.67415373680760.6516925263848010.325846263192401
1210.6239107130119320.7521785739761360.376089286988068
1220.5729403341419050.8541193317161890.427059665858094
1230.5403738502301880.9192522995396250.459626149769812
1240.6910561575996040.6178876848007920.308943842400396
1250.666167467503390.667665064993220.33383253249661
1260.6617742382655370.6764515234689250.338225761734463
1270.6714930737903990.6570138524192030.328506926209601
1280.614274477758740.771451044482520.38572552224126
1290.5701018696188590.8597962607622820.429898130381141
1300.5433824157100490.9132351685799020.456617584289951
1310.5053335324868430.9893329350263140.494666467513157
1320.5501418115837260.8997163768325490.449858188416274
1330.4840876300397030.9681752600794060.515912369960297
1340.440353062351080.880706124702160.55964693764892
1350.6990383844586340.6019232310827330.300961615541366
1360.7121074636077920.5757850727844150.287892536392208
1370.6447276740884710.7105446518230580.355272325911529
1380.8042239155572460.3915521688855070.195776084442753
1390.7362084801565240.5275830396869520.263791519843476
1400.7180947129658410.5638105740683170.281905287034159
1410.6199941972322530.7600116055354950.380005802767747
1420.4983992009249070.9967984018498140.501600799075093
1430.4116998592619080.8233997185238160.588300140738092


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level820.666666666666667NOK
5% type I error level830.67479674796748NOK
10% type I error level840.682926829268293NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/10ltd41258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/10ltd41258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/1n58j1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/1n58j1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/242qr1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/242qr1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/3e8x11258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/3e8x11258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/4lwkn1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/4lwkn1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/5z2bs1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/5z2bs1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/66mrq1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/66mrq1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/7lk5b1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/7lk5b1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/809pv1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/809pv1258727480.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/9st4n1258727480.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Nov/20/t1258727590js7ojf76qskiydm/9st4n1258727480.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