Home » date » 2008 » Dec » 23 »

Multiple Regression

*Unverified author*
R Software Module: rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Dec 2008 08:46:04 -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/23/t1230047231k9xtfnh2qbazpvr.htm/, Retrieved Tue, 23 Dec 2008 16:47:11 +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/23/t1230047231k9xtfnh2qbazpvr.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 «
67,8 0 66,9 0 71,5 0 75,9 0 71,9 0 70,7 0 73,5 0 76,1 0 82,5 0 87,1 0 83,2 0 86,1 0 85,9 0 77,4 0 74,4 0 69,9 0 73,8 0 69,2 0 69,7 0 71 0 71,2 0 75,8 0 73 0 66,4 0 58,6 0 55,5 0 52,6 0 54,9 0 54,6 0 51,2 0 50,9 0 49,6 0 53,4 0 52 0 47,5 0 42,1 0 44,5 0 43,2 0 51,4 0 59,4 0 60,3 0 61,4 0 68,8 0 73,6 0 81,8 0 79,6 0 85,8 0 88,1 0 89,1 0 95 0 96,2 0 84,2 0 96,9 0 103,1 0 99,3 0 103,5 0 112,4 0 111,1 0 113,7 0 92 0 93 0 98,4 0 92,6 0 94,6 0 99,5 0 97,6 0 91,3 0 93,6 0 93,1 1 78,4 1 70,2 1 69,3 1 71,1 1 73,5 1 85,9 1 91,5 1 91,8 1 88,3 1 91,3 1 94 1 99,3 1 96,7 0 88 0 96,7 0 106,8 0 114,3 0 105,7 0 90,1 0 91,6 0 97,7 0 100,8 0 104,6 0 95,9 0 102,7 0 104 0 107,9 0 113,8 0 113,8 0 123,1 0 125,1 0 137,6 0 134 0 140,3 0 152,1 0 150,6 0 167,3 0 153,2 0 142 0 154,4 0 158,5 0 180,9 0 181,3 0 172,4 0 192 0 199,3 0 215,4 0 214,3 0 201,5 0 190,5 0 196 0 215,7 0 209,4 0 214,1 0 237,8 0 239 0 237,8 0 251,5 0 248,8 0 215,4 0 201,2 0 203,1 0 214,2 0 188,9 0 203 0 213,3 0 228,5 0 228,2 0 240,9 0 258,8 0 248,5 0 269,2 0 289,6 0 323,4 0 317,2 0 322,8 0 340,9 0 368,2 0 388,5 0 441,2 0 474,3 0 483,9 0 417,9 0 365,9 0 263 0 199,4 0
 
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 time9 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001


Multiple Linear Regression - Estimated Regression Equation
X[t] = -1.88729219193192 -53.7578573116924Y[t] + 5.70329025021818M1[t] + 6.87678879336468M2[t] + 11.3349027211266M3[t] + 13.6160935719654M4[t] + 17.8434382689580M5[t] + 20.7092445044122M6[t] + 23.7135122783280M7[t] + 19.6485492830129M8[t] + 18.718806080905M9[t] + 5.2647771385367M10[t] -1.90018585677835M11[t] + 1.70342453377658t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-1.8872921919319216.298825-0.11580.9079810.453991
Y-53.757857311692414.707588-3.65510.0003620.000181
M15.7032902502181820.2596030.28150.7787320.389366
M26.8767887933646820.2577520.33950.7347650.367382
M311.334902721126620.256310.55960.5766580.288329
M413.616093571965420.2552780.67220.5025410.25127
M517.843438268958020.2546540.8810.3798410.189921
M620.709244504412220.254441.02250.3083170.154158
M723.713512278328020.2546361.17080.2436660.121833
M819.648549283012920.2552410.970.3336840.166842
M918.71880608090520.2829010.92290.3576430.178822
M105.264777138536720.2576780.25990.7953270.397664
M11-1.9001858567783520.25951-0.09380.9254070.462704
t1.703424533776580.09105818.70700


Multiple Linear Regression - Regression Statistics
Multiple R0.851451682561177
R-squared0.72496996773626
Adjusted R-squared0.699612588875064
F-TEST (value)28.5900988309826
F-TEST (DF numerator)13
F-TEST (DF denominator)141
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation50.5950278318227
Sum Squared Residuals360939.814623711


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
167.85.5194225920629462.280577407937
266.98.3963456689859858.503654331014
371.514.557884130524456.9421158694756
475.918.542499515139857.3575004848602
571.924.473268745908947.4267312540911
670.729.042499515139741.6575004848603
773.533.750191822832039.749808177168
876.131.388653361293644.7113466387064
982.532.162334692962250.3376653070378
1087.120.411730284370566.6882697156295
1183.214.950191822832168.2498081771679
1286.118.55380221338767.546197786613
1385.925.960516997381759.9394830026183
1477.428.837440074304848.5625599256952
1574.434.998978535843339.4010214641567
1669.938.983593920458730.9164060795413
1773.844.914363151227928.8856368487721
1869.249.483593920458719.7164060795413
1969.754.19128622815115.5087137718490
207151.829747766612519.1702522333875
2171.252.603429098281218.5965709017188
2275.840.852824689689534.9471753103105
237335.39128622815137.608713771849
2466.438.994896618705927.4051033812941
2558.646.401611402700612.1983885972994
2655.549.27853447962386.22146552037624
2752.655.4400729411622-2.84007294116221
2854.959.4246883257776-4.5246883257776
2954.665.3554575565468-10.7554575565468
3051.269.9246883257776-18.7246883257776
3150.974.6323806334699-23.7323806334699
3249.672.2708421719314-22.6708421719315
3353.473.0445235036001-19.6445235036001
345261.2939190950084-9.29391909500836
3547.555.8323806334699-8.33238063346988
3642.159.4359910240248-17.3359910240248
3744.566.8427058080196-22.3427058080196
3843.269.7196288849427-26.5196288849427
3951.475.8811673464811-24.4811673464811
4059.479.8657827310965-20.4657827310965
4160.385.7965519618657-25.4965519618657
4261.490.3657827310965-28.9657827310965
4368.895.0734750387888-26.2734750387888
4473.692.7119365772503-19.1119365772503
4581.893.485617908919-11.685617908919
4679.681.7350135003273-2.13501350032729
4785.876.27347503878889.5265249612112
4888.179.87708542934378.22291457065625
4989.187.28380021333851.81619978666148
509590.16072329026164.83927670973841
5196.296.3222617518-0.122261751800052
5284.2100.306877136415-16.1068771364154
5396.9106.237646367185-9.33764636718466
54103.1110.806877136415-7.70687713641543
5599.3115.514569444108-16.2145694441077
56103.5113.153030982569-9.65303098256927
57112.4113.926712314238-1.52671231423792
58111.1102.1761079056468.9238920943538
59113.796.714569444107716.9854305558923
6092100.318179834663-8.31817983466267
6193107.724894618657-14.7248946186574
6298.4110.601817695580-12.2018176955805
6392.6116.763356157119-24.163356157119
6494.6120.747971541734-26.1479715417343
6599.5126.678740772504-27.1787407725036
6697.6131.247971541734-33.6479715417344
6791.3135.955663849427-44.6556638494267
6893.6133.594125387888-39.9941253878882
6993.180.609949407864412.4900505921356
7078.468.85934499927279.5406550007273
7170.263.39780653773426.80219346226579
7269.367.00141692828922.29858307171083
7371.174.408131712284-3.30813171228393
7473.577.285054789207-3.78505478920701
7585.983.44659325074552.45340674925452
7691.587.43120863536094.06879136463914
7791.893.36197786613-1.56197786613009
7888.397.9312086353609-9.63120863536087
7991.3102.638900943053-11.3389009430532
8094100.277362481515-6.27736248151469
8199.3101.051043813183-1.75104381318335
8296.7143.058296716284-46.358296716284
8388137.596758254746-49.5967582547456
8496.7141.200368645301-44.5003686453005
85106.8148.607083429295-41.8070834292953
86114.3151.484006506218-37.1840065062183
87105.7157.645544967757-51.9455449677568
8890.1161.630160352372-71.5301603523722
8991.6167.560929583141-75.9609295831414
9097.7172.130160352372-74.4301603523721
91100.8176.837852660064-76.0378526600645
92104.6174.476314198526-69.876314198526
9395.9175.249995530195-79.3499955301947
94102.7163.499391121603-60.799391121603
95104158.037852660064-54.0378526600645
96107.9161.641463050619-53.7414630506194
97113.8169.048177834614-55.2481778346142
98113.8171.925100911537-58.1251009115373
99123.1178.086639373076-54.9866393730757
100125.1182.071254757691-56.9712547576911
101137.6188.002023988460-50.4020239884603
102134192.571254757691-58.5712547576911
103140.3197.278947065383-56.9789470653834
104152.1194.917408603845-42.8174086038450
105150.6195.691089935514-45.0910899355136
106167.3183.940485526922-16.6404855269219
107153.2178.478947065383-25.2789470653834
108142182.082557455938-40.0825574559383
109154.4189.489272239933-35.0892722399331
110158.5192.366195316856-33.8661953168562
111180.9198.527733778395-17.6277337783946
112181.3202.51234916301-21.21234916301
113172.4208.443118393779-36.0431183937792
114192213.01234916301-21.01234916301
115199.3217.720041470702-18.4200414707023
116215.4215.3585030091640.0414969908361562
117214.3216.132184340833-1.83218434083249
118201.5204.381579932241-2.88157993224080
119190.5198.920041470702-8.42004147070232
120196202.523651861257-6.52365186125724
121215.7209.9303666452525.76963335474801
122209.4212.807289722175-3.40728972217507
123214.1218.968828183714-4.86882818371355
124237.8222.95344356832914.8465564316711
125239228.88421279909810.1157872009019
126237.8233.4534435683294.34655643167108
127251.5238.16113587602113.3388641239788
128248.8235.79959741448313.0004025855172
129215.4236.573278746151-21.1732787461514
130201.2224.822674337560-23.6226743375597
131203.1219.361135876021-16.2611358760212
132214.2222.964746266576-8.76474626657618
133188.9230.371461050571-41.4714610505709
134203233.248384127494-30.248384127494
135213.3239.409922589032-26.1099225890325
136228.5243.394537973648-14.8945379736479
137228.2249.325307204417-21.1253072044171
138240.9253.894537973648-12.9945379736479
139258.8258.602230281340.197769718659818
140248.5256.240691819802-7.74069181980172
141269.2257.01437315147012.1856268485296
142289.6245.26376874287944.3362312571214
143323.4239.8022302813483.5977697186598
144317.2243.40584067189573.7941593281049
145322.8250.8125554558971.9874445441102
146340.9253.68947853281387.2105214671871
147368.2259.851016994351108.348983005649
148388.5263.835632378967124.664367621033
149441.2269.766401609736171.433598390264
150474.3274.335632378967199.964367621033
151483.9279.043324686659204.856675313341
152417.9276.681786225121141.218213774879
153365.9277.45546755678988.4445324432107
154263265.704863148198-2.70486314819752
155199.4260.243324686659-60.8433246866591


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
170.005156643972156960.01031328794431390.994843356027843
180.0008259987714452360.001651997542890470.999174001228555
190.0001431988750847660.0002863977501695310.999856801124915
202.56538708562391e-055.13077417124783e-050.999974346129144
218.2953524362922e-061.65907048725844e-050.999991704647564
222.31227852275522e-064.62455704551045e-060.999997687721477
235.33166621952134e-071.06633324390427e-060.999999466833378
243.40986280546666e-076.81972561093333e-070.99999965901372
251.28722914374838e-072.57445828749676e-070.999999871277086
263.18839173774165e-086.3767834754833e-080.999999968116083
279.63970461441928e-091.92794092288386e-080.999999990360295
282.07682323226430e-094.15364646452859e-090.999999997923177
294.20486232197882e-108.40972464395764e-100.999999999579514
308.19636093883428e-111.63927218776686e-100.999999999918036
311.74220270624031e-113.48440541248062e-110.999999999982578
324.76654308754484e-129.53308617508968e-120.999999999995233
331.14415891528165e-122.2883178305633e-120.999999999998856
345.4684876990623e-131.09369753981246e-120.999999999999453
352.61314524269993e-135.22629048539986e-130.999999999999739
361.7046806908663e-133.4093613817326e-130.99999999999983
372.96279913379156e-145.92559826758312e-140.99999999999997
384.89020606396652e-159.78041212793303e-150.999999999999995
391.28776009229565e-152.5755201845913e-150.999999999999999
407.96449903934942e-161.59289980786988e-151
414.4343526506019e-168.8687053012038e-161
423.70954943104155e-167.41909886208311e-161
436.71386330764464e-161.34277266152893e-151
441.50394428939188e-153.00788857878376e-150.999999999999998
454.64357828057491e-159.28715656114981e-150.999999999999995
464.9387164275445e-159.877432855089e-150.999999999999995
471.76303259711691e-143.52606519423381e-140.999999999999982
488.004323521772e-141.6008647043544e-130.99999999999992
494.08016598820404e-138.16033197640807e-130.999999999999592
503.60597226461751e-127.21194452923502e-120.999999999996394
511.37837667957234e-112.75675335914468e-110.999999999986216
521.01769875905271e-112.03539751810541e-110.999999999989823
531.72892661089113e-113.45785322178225e-110.99999999998271
544.65335246168396e-119.30670492336792e-110.999999999953466
555.54535026580848e-111.10907005316170e-100.999999999944546
567.44737902449344e-111.48947580489869e-100.999999999925526
571.4705954300697e-102.9411908601394e-100.99999999985294
582.8359593697898e-105.6719187395796e-100.999999999716404
598.90409182172009e-101.78081836434402e-090.99999999910959
607.32403326508493e-101.46480665301699e-090.999999999267597
616.34338388322642e-101.26867677664528e-090.999999999365662
627.26417439510353e-101.45283487902071e-090.999999999273583
635.73073688549131e-101.14614737709826e-090.999999999426926
644.74385877819828e-109.48771755639656e-100.999999999525614
654.28520465127429e-108.57040930254857e-100.99999999957148
663.42278555435881e-106.84557110871763e-100.999999999657721
672.12733039460024e-104.25466078920048e-100.999999999787267
681.68340446004805e-103.36680892009611e-100.99999999983166
698.26668791440398e-111.65333758288080e-100.999999999917333
704.32906036199198e-118.65812072398396e-110.99999999995671
712.4398737220642e-114.8797474441284e-110.999999999975601
721.01421845411767e-112.02843690823534e-110.999999999989858
734.07372037025914e-128.14744074051828e-120.999999999995926
741.58387647209066e-123.16775294418131e-120.999999999998416
757.15083701009707e-131.43016740201941e-120.999999999999285
763.59373260906894e-137.18746521813789e-130.99999999999964
771.52788372416779e-133.05576744833559e-130.999999999999847
785.88239774286252e-141.17647954857250e-130.999999999999941
792.42053365784132e-144.84106731568264e-140.999999999999976
809.60887458312592e-151.92177491662518e-140.99999999999999
813.54960488858912e-157.09920977717824e-150.999999999999996
822.24231521008744e-154.48463042017488e-150.999999999999998
831.74334187333546e-153.48668374667092e-150.999999999999998
849.00623614829214e-161.80124722965843e-151
856.42481171657285e-161.28496234331457e-151
866.49993091779764e-161.29998618355953e-151
873.05968576245322e-166.11937152490643e-161
881.21287531889453e-162.42575063778905e-161
894.72335109476713e-179.44670218953427e-171
901.57878189700892e-173.15756379401783e-171
915.31669934479387e-181.06333986895877e-171
921.68456895712035e-183.36913791424069e-181
936.89683957094415e-191.37936791418883e-181
942.66664560410610e-195.33329120821219e-191
951.301842901685e-192.60368580337e-191
964.74608665171673e-209.49217330343346e-201
971.95288331193134e-203.90576662386267e-201
987.11953794569876e-211.42390758913975e-201
993.42627876024696e-216.85255752049393e-211
1001.81105760258475e-213.62211520516951e-211
1011.83880039243148e-213.67760078486297e-211
1021.39215517837972e-212.78431035675945e-211
1031.58682031947652e-213.17364063895305e-211
1043.00649529936343e-216.01299059872686e-211
1052.86755057052887e-215.73510114105775e-211
1063.78809059825668e-207.57618119651337e-201
1071.24700962011249e-192.49401924022497e-191
1087.53609340331677e-201.50721868066335e-191
1098.364206448412e-201.6728412896824e-191
1109.98653931674924e-201.99730786334985e-191
1116.98834307725067e-191.39766861545013e-181
1122.94230710126133e-185.88461420252267e-181
1133.43386391721861e-186.86772783443721e-181
1141.54819070621919e-173.09638141243837e-171
1158.18537187445698e-171.63707437489140e-161
1169.30787542480266e-161.86157508496053e-151
1176.03671415718527e-151.20734283143705e-140.999999999999994
1183.50858894697776e-147.01717789395553e-140.999999999999965
1191.80157533380547e-133.60315066761095e-130.99999999999982
1202.75157921506637e-135.50315843013274e-130.999999999999725
1211.62746961632801e-123.25493923265601e-120.999999999998373
1223.40474096398609e-126.80948192797219e-120.999999999996595
1235.21465728557026e-121.04293145711405e-110.999999999994785
1242.51083309008255e-115.02166618016511e-110.999999999974892
1255.75376540360566e-111.15075308072113e-100.999999999942462
1267.82460450401386e-111.56492090080277e-100.999999999921754
1271.40554076408408e-102.81108152816815e-100.999999999859446
1282.65563715814464e-105.31127431628929e-100.999999999734436
1291.51947421335615e-103.03894842671229e-100.999999999848053
1301.95441667429651e-103.90883334859302e-100.999999999804558
1311.34227898505410e-092.68455797010820e-090.999999998657721
1326.09998207256052e-101.21999641451210e-090.999999999390002
1331.88295201730061e-103.76590403460122e-100.999999999811705
1345.7932432778676e-111.15864865557352e-100.999999999942068
1352.07381299218739e-114.14762598437478e-110.999999999979262
1369.3163822887568e-121.86327645775136e-110.999999999990684
1372.64079078879102e-115.28158157758204e-110.999999999973592
1389.97048737921138e-101.99409747584228e-090.999999999002951


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1210.991803278688525NOK
5% type I error level1221NOK
10% type I error level1221NOK
 
Charts produced by software:
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/104syt1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/104syt1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/1iz971230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/1iz971230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/2favk1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/2favk1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/3vukc1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/3vukc1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/4emyr1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/4emyr1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/523ka1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/523ka1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/6lx061230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/6lx061230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/783951230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/783951230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/8qxsq1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/8qxsq1230047149.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/9it8o1230047149.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/23/t1230047231k9xtfnh2qbazpvr/9it8o1230047149.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