Home » date » 2008 » Dec » 20 »

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: Sat, 20 Dec 2008 12:32:56 -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/20/t12298016356vmefdl2z2xf8zz.htm/, Retrieved Sat, 20 Dec 2008 20:34:05 +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/20/t12298016356vmefdl2z2xf8zz.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 time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
X[t] = -1.88729219193178 -53.7578573116923Y[t] + 5.70329025021818M1[t] + 6.87678879336456M2[t] + 11.3349027211265M3[t] + 13.6160935719653M4[t] + 17.843438268958M5[t] + 20.7092445044122M6[t] + 23.7135122783279M7[t] + 19.6485492830129M8[t] + 18.7188060809049M9[t] + 5.26477713853663M10[t] -1.90018585677839M11[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.8872921919317816.298825-0.11580.9079810.453991
Y-53.757857311692314.707588-3.65510.0003620.000181
M15.7032902502181820.2596030.28150.7787320.389366
M26.8767887933645620.2577520.33950.7347650.367382
M311.334902721126520.256310.55960.5766580.288329
M413.616093571965320.2552780.67220.5025410.25127
M517.84343826895820.2546540.8810.3798410.189921
M620.709244504412220.254441.02250.3083170.154158
M723.713512278327920.2546361.17080.2436660.121833
M819.648549283012920.2552410.970.3336840.166842
M918.718806080904920.2829010.92290.3576430.178822
M105.2647771385366320.2576780.25990.7953270.397664
M11-1.9001858567783920.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.5194225920623162.2805774079377
266.98.396345668986258.5036543310138
371.514.557884130524456.9421158694756
475.918.542499515139857.3575004848602
571.924.473268745908947.4267312540911
670.729.042499515139741.6575004848603
773.533.750191822832139.7498081771679
876.131.388653361293644.7113466387063
982.532.162334692962350.3376653070377
1087.120.411730284370566.6882697156295
1183.214.950191822832168.249808177168
1286.118.553802213387167.5461977866129
1385.925.960516997381859.9394830026182
1477.428.837440074304748.5625599256953
1574.434.998978535843339.4010214641567
1669.938.983593920458730.9164060795413
1773.844.914363151227928.8856368487721
1869.249.483593920458719.7164060795413
1969.754.19128622815115.508713771849
207151.829747766612519.1702522333875
2171.252.603429098281218.5965709017188
2275.840.852824689689534.9471753103105
237335.39128622815137.608713771849
2466.438.99489661870627.4051033812940
2558.646.401611402700812.1983885972992
2655.549.27853447962376.2214655203763
2752.655.4400729411622-2.84007294116220
2854.959.4246883257776-4.52468832577762
2954.665.3554575565469-10.7554575565469
3051.269.9246883257776-18.7246883257776
3150.974.6323806334699-23.7323806334699
3249.672.2708421719315-22.6708421719315
3353.473.0445235036001-19.6445235036001
345261.2939190950084-9.29391909500836
3547.555.8323806334699-8.33238063346994
3642.159.4359910240249-17.3359910240249
3744.566.8427058080197-22.3427058080197
3843.269.7196288849426-26.5196288849426
3951.475.8811673464811-24.4811673464811
4059.479.8657827310965-20.4657827310965
4160.385.7965519618658-25.4965519618658
4261.490.3657827310965-28.9657827310966
4368.895.0734750387888-26.2734750387888
4473.692.7119365772504-19.1119365772504
4581.893.485617908919-11.6856179089190
4679.681.7350135003273-2.13501350032728
4785.876.27347503878889.52652496121116
4888.179.87708542934388.22291457065617
4989.187.28380021333861.81619978666143
509590.16072329026154.83927670973848
5196.296.3222617518-0.122261751800030
5284.2100.306877136415-16.1068771364155
5396.9106.237646367185-9.33764636718466
54103.1110.806877136415-7.70687713641547
5599.3115.514569444108-16.2145694441077
56103.5113.153030982569-9.65303098256926
57112.4113.926712314238-1.52671231423793
58111.1102.1761079056468.9238920943538
59113.796.714569444107816.9854305558923
6092100.318179834663-8.31817983466273
6193107.724894618657-14.7248946186575
6298.4110.601817695580-12.2018176955804
6392.6116.763356157119-24.1633561571190
6494.6120.747971541734-26.1479715417344
6599.5126.678740772504-27.1787407725036
6697.6131.247971541734-33.6479715417344
6791.3135.955663849427-44.6556638494266
6893.6133.594125387888-39.9941253878882
6993.180.609949407864412.4900505921356
7078.468.85934499927279.54065500072732
7170.263.39780653773426.80219346226577
7269.367.00141692828922.29858307171078
7371.174.408131712284-3.30813171228398
7473.577.285054789207-3.78505478920692
7585.983.44659325074542.45340674925459
7691.587.43120863536094.06879136463912
7791.893.36197786613-1.56197786613007
7888.397.9312086353609-9.63120863536086
7991.3102.638900943053-11.3389009430531
8094100.277362481515-6.27736248151467
8199.3101.051043813183-1.75104381318334
8296.7143.058296716284-46.358296716284
8388137.596758254746-49.5967582547456
8496.7141.200368645301-44.5003686453006
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.4301603523722
91100.8176.837852660064-76.0378526600645
92104.6174.476314198526-69.876314198526
9395.9175.249995530195-79.3499955301946
94102.7163.499391121603-60.7993911216029
95104158.037852660065-54.0378526600645
96107.9161.641463050619-53.7414630506195
97113.8169.048177834614-55.2481778346142
98113.8171.925100911537-58.1251009115372
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.8174086038449
105150.6195.691089935514-45.0910899355136
106167.3183.940485526922-16.6404855269218
107153.2178.478947065383-25.2789470653834
108142182.082557455938-40.0825574559384
109154.4189.489272239933-35.0892722399332
110158.5192.366195316856-33.8661953168561
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.0414969908361726
117214.3216.132184340833-1.83218434083249
118201.5204.381579932241-2.88157993224076
119190.5198.920041470702-8.4200414707023
120196202.523651861257-6.5236518612573
121215.7209.9303666452525.76963335474793
122209.4212.807289722175-3.407289722175
123214.1218.968828183714-4.86882818371352
124237.8222.95344356832914.8465564316711
125239228.88421279909810.1157872009018
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.76474626657622
133188.9230.371461050571-41.4714610505710
134203233.248384127494-30.2483841274939
135213.3239.409922589032-26.1099225890324
136228.5243.394537973648-14.8945379736478
137228.2249.325307204417-21.1253072044171
138240.9253.894537973648-12.9945379736479
139258.8258.602230281340.197769718659861
140248.5256.240691819802-7.74069181980168
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.0008259987714452380.001651997542890480.999174001228555
190.0001431988750847660.0002863977501695310.999856801124915
202.56538708562389e-055.13077417124777e-050.999974346129144
218.29535243629215e-061.65907048725843e-050.999991704647564
222.31227852275527e-064.62455704551054e-060.999997687721477
235.33166621952148e-071.06633324390430e-060.999999466833378
243.40986280546667e-076.81972561093334e-070.99999965901372
251.28722914374838e-072.57445828749676e-070.999999871277086
263.18839173774167e-086.37678347548334e-080.999999968116083
279.63970461441931e-091.92794092288386e-080.999999990360295
282.07682323226429e-094.15364646452858e-090.999999997923177
294.20486232197879e-108.40972464395758e-100.999999999579514
308.19636093883434e-111.63927218776687e-100.999999999918036
311.74220270624028e-113.48440541248057e-110.999999999982578
324.76654308754459e-129.53308617508917e-120.999999999995233
331.14415891528161e-122.28831783056323e-120.999999999998856
345.46848769906236e-131.09369753981247e-120.999999999999453
352.61314524269991e-135.22629048539982e-130.999999999999739
361.70468069086631e-133.40936138173261e-130.99999999999983
372.96279913379152e-145.92559826758303e-140.99999999999997
384.89020606396659e-159.78041212793317e-150.999999999999995
391.28776009229568e-152.57552018459136e-150.999999999999999
407.96449903934942e-161.59289980786988e-151
414.43435265060183e-168.86870530120367e-161
423.70954943104163e-167.41909886208326e-161
436.71386330764474e-161.34277266152895e-151
441.50394428939190e-153.00788857878379e-150.999999999999998
454.64357828057482e-159.28715656114964e-150.999999999999995
464.93871642754447e-159.87743285508893e-150.999999999999995
471.76303259711693e-143.52606519423385e-140.999999999999982
488.00432352177206e-141.60086470435441e-130.99999999999992
494.08016598820398e-138.16033197640796e-130.999999999999592
503.60597226461751e-127.21194452923502e-120.999999999996394
511.37837667957233e-112.75675335914466e-110.999999999986216
521.01769875905269e-112.03539751810537e-110.999999999989823
531.72892661089114e-113.45785322178228e-110.99999999998271
544.65335246168401e-119.30670492336802e-110.999999999953467
555.54535026580856e-111.10907005316171e-100.999999999944547
567.44737902449342e-111.48947580489868e-100.999999999925526
571.47059543006969e-102.94119086013938e-100.99999999985294
582.83595936978976e-105.67191873957952e-100.999999999716404
598.90409182172009e-101.78081836434402e-090.99999999910959
607.32403326508487e-101.46480665301697e-090.999999999267597
616.34338388322644e-101.26867677664529e-090.999999999365662
627.26417439510348e-101.45283487902070e-090.999999999273583
635.73073688549135e-101.14614737709827e-090.999999999426926
644.74385877819824e-109.48771755639647e-100.999999999525614
654.28520465127407e-108.57040930254813e-100.99999999957148
663.42278555435881e-106.84557110871763e-100.999999999657721
672.12733039460029e-104.25466078920059e-100.999999999787267
681.68340446004804e-103.36680892009607e-100.99999999983166
698.2666879144041e-111.65333758288082e-100.999999999917333
704.32906036199201e-118.65812072398402e-110.99999999995671
712.43987372206421e-114.87974744412842e-110.999999999975601
721.01421845411765e-112.02843690823529e-110.999999999989858
734.07372037025925e-128.14744074051851e-120.999999999995926
741.58387647209064e-123.16775294418128e-120.999999999998416
757.15083701009718e-131.43016740201944e-120.999999999999285
763.593732609069e-137.187465218138e-130.99999999999964
771.52788372416782e-133.05576744833563e-130.999999999999847
785.8823977428626e-141.17647954857252e-130.999999999999941
792.42053365784135e-144.8410673156827e-140.999999999999976
809.60887458312592e-151.92177491662518e-140.99999999999999
813.54960488858900e-157.09920977717799e-150.999999999999996
822.24231521008743e-154.48463042017486e-150.999999999999998
831.74334187333548e-153.48668374667097e-150.999999999999998
849.00623614829214e-161.80124722965843e-151
856.42481171657278e-161.28496234331456e-151
866.49993091779764e-161.29998618355953e-151
873.05968576245317e-166.11937152490635e-161
881.21287531889454e-162.42575063778909e-161
894.7233510947672e-179.4467021895344e-171
901.57878189700894e-173.15756379401788e-171
915.31669934479374e-181.06333986895875e-171
921.68456895712037e-183.36913791424074e-181
936.89683957094425e-191.37936791418885e-181
942.66664560410606e-195.33329120821212e-191
951.30184290168503e-192.60368580337007e-191
964.7460866517168e-209.4921733034336e-201
971.95288331193131e-203.90576662386262e-201
987.11953794569904e-211.42390758913981e-201
993.42627876024700e-216.85255752049401e-211
1001.81105760258473e-213.62211520516946e-211
1011.83880039243151e-213.67760078486302e-211
1021.39215517837973e-212.78431035675945e-211
1031.58682031947650e-213.17364063895301e-211
1043.00649529936343e-216.01299059872686e-211
1052.86755057052884e-215.73510114105768e-211
1063.78809059825684e-207.57618119651367e-201
1071.24700962011247e-192.49401924022494e-191
1087.53609340331656e-201.50721868066331e-191
1098.3642064484121e-201.67284128968242e-191
1109.98653931674975e-201.99730786334995e-191
1116.98834307725067e-191.39766861545013e-181
1122.94230710126133e-185.88461420252267e-181
1133.4338639172186e-186.8677278344372e-181
1141.54819070621921e-173.09638141243842e-171
1158.1853718744572e-171.63707437489144e-161
1169.30787542480266e-161.86157508496053e-151
1176.03671415718515e-151.20734283143703e-140.999999999999994
1183.50858894697759e-147.01717789395517e-140.999999999999965
1191.80157533380548e-133.60315066761097e-130.99999999999982
1202.7515792150663e-135.5031584301326e-130.999999999999725
1211.62746961632796e-123.25493923265592e-120.999999999998373
1223.40474096398613e-126.80948192797226e-120.999999999996595
1235.21465728557039e-121.04293145711408e-110.999999999994785
1242.51083309008252e-115.02166618016505e-110.999999999974892
1255.75376540360562e-111.15075308072112e-100.999999999942462
1267.8246045040138e-111.56492090080276e-100.999999999921754
1271.40554076408410e-102.81108152816821e-100.999999999859446
1282.65563715814464e-105.31127431628929e-100.999999999734436
1291.51947421335605e-103.03894842671209e-100.999999999848053
1301.95441667429651e-103.90883334859301e-100.999999999804558
1311.34227898505410e-092.68455797010820e-090.99999999865772
1326.09998207256042e-101.21999641451208e-090.999999999390002
1331.88295201730055e-103.76590403460110e-100.999999999811705
1345.7932432778674e-111.15864865557348e-100.999999999942068
1352.07381299218737e-114.14762598437474e-110.999999999979262
1369.3163822887565e-121.8632764577513e-110.999999999990684
1372.64079078879104e-115.28158157758207e-110.999999999973592
1389.97048737921123e-101.99409747584225e-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/20/t12298016356vmefdl2z2xf8zz/10qpzv1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/10qpzv1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/1h0eu1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/1h0eu1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/2qngf1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/2qngf1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/3hcti1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/3hcti1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/4d9kd1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/4d9kd1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/5ukms1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/5ukms1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/64yvw1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/64yvw1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/7zgkn1229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/7zgkn1229801569.ps (open in new window)


http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/8wkz01229801569.png (open in new window)
http://127.0.0.1/wessadotnet/public_html/freestatisticsdotorg/blog/date/2008/Dec/20/t12298016356vmefdl2z2xf8zz/8wkz01229801569.ps (open in new window)


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