Home » date » 2009 » Dec » 15 »

Multiple Regression (with seasonal dummies and linear trend)

*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: Tue, 15 Dec 2009 01:59:22 -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/Dec/15/t1260867622pa94lq4okebdlqw.htm/, Retrieved Tue, 15 Dec 2009 10:00:35 +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/Dec/15/t1260867622pa94lq4okebdlqw.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 «
8715.1 0 8919.9 0 10085.8 0 9511.7 0 8991.3 0 10311.2 0 8895.4 0 7449.8 0 10084.0 0 9859.4 0 9100.1 0 8920.8 0 8502.7 0 8599.6 0 10394.4 0 9290.4 0 8742.2 0 10217.3 0 8639.0 0 8139.6 0 10779.1 0 10427.7 0 10349.1 0 10036.4 0 9492.1 0 10638.8 0 12054.5 0 10324.7 0 11817.3 0 11008.9 0 9996.6 0 9419.5 0 11958.8 0 12594.6 0 11890.6 0 10871.7 0 11835.7 0 11542.2 0 13093.7 0 11180.2 0 12035.7 0 12112.0 0 10875.2 0 9897.3 0 11672.1 1 12385.7 1 11405.6 1 9830.9 1 11025.1 1 10853.8 1 12252.6 1 11839.4 1 11669.1 1 11601.4 1 11178.4 1 9516.4 1 12102.8 1 12989.0 1 11610.2 1 10205.5 1 11356.2 1 11307.1 1 12648.6 1 11947.2 1 11714.1 1 12192.5 1 11268.8 1 9097.4 1 12639.8 1 13040.1 1 11687.3 1 11191.7 1 11391.9 1 11793.1 1 13933.2 1 12778.1 1 11810.3 1 13698.4 1 11956.6 1 10723.8 1 13938.9 1 13979.8 1 13807.4 1 12973.9 1 12509.8 1 12934.1 1 14908.3 1 13 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
Uitvoer[t] = + 7642.02272727274 -1159.29000000000Dummie[t] + 865.746704545459M1[t] + 930.747499999996M2[t] + 2447.96647727272M3[t] + 1249.24909090908M4[t] + 1178.82261363636M5[t] + 1960.31431818182M6[t] + 386.769659090908M7[t] -843.738636363637M8[t] + 1856.41579545454M9[t] + 2115.68022727273M10[t] + 1269.36284090909M11[t] + 65.5810227272728t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)7642.02272727274238.45816332.047600
Dummie-1159.29000000000222.750579-5.20441e-060
M1865.746704545459296.3224382.92160.0041740.002087
M2930.747499999996296.2070953.14220.002120.00106
M32447.96647727272296.1173538.266900
M41249.24909090908296.0532354.21974.8e-052.4e-05
M51178.82261363636296.0147573.98230.0001185.9e-05
M61960.31431818182296.001936.622600
M7386.769659090908296.0147571.30660.1938930.096947
M8-843.738636363637296.053235-2.850.0051620.002581
M91856.41579545454295.8864626.274100
M102115.68022727273295.8222947.151900
M111269.36284090909295.7837864.29153.7e-051.8e-05
t65.58102272727282.75568323.798500


Multiple Linear Regression - Regression Statistics
Multiple R0.959898822723858
R-squared0.921405749866648
Adjusted R-squared0.912747061292634
F-TEST (value)106.414007385828
F-TEST (DF numerator)13
F-TEST (DF denominator)118
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation693.644360927177
Sum Squared Residuals56774814.9346364


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
18715.18573.3504545454141.749545454594
28919.98703.93227272728215.967727272721
310085.810286.7322727273-200.932272727282
49511.79153.59590909092358.104090909085
58991.39148.75045454544-157.450454545440
610311.29995.82318181817315.376818181833
78895.48487.85954545454407.540454545457
87449.87322.93227272727126.867727272732
91008410088.6677272727-4.66772727272951
109859.410413.5131818182-554.113181818184
119100.19632.77681818182-532.676818181816
128920.88428.995491.804999999998
138502.79360.32272727273-857.622727272733
148599.69490.90454545456-891.304545454558
1510394.411073.7045454545-679.304545454547
169290.49940.56818181818-650.168181818183
178742.29935.72272727273-1193.52272727273
1810217.310782.7954545455-565.495454545458
1986399274.83181818182-635.83181818182
208139.68109.9045454545529.6954545454531
2110779.110875.64-96.5400000000012
2210427.711200.4854545455-772.785454545455
2310349.110419.7490909091-70.6490909090922
2410036.49215.96727272727820.432727272725
259492.110147.295-655.195000000006
2610638.810277.8768181818360.923181818182
2712054.511860.6768181818193.823181818181
2810324.710727.5404545455-402.840454545455
2911817.310722.6951094.60500000000
3011008.911569.7677272727-560.86772727273
319996.610061.8040909091-65.2040909090914
329419.58896.87681818182522.623181818180
3311958.811662.6122727273296.187727272726
3412594.611987.4577272727607.142272727273
3511890.611206.7213636364683.878636363635
3610871.710002.9395454545868.760454545453
3711835.710934.2672727273901.432727272722
3811542.211064.8490909091477.350909090912
3913093.712647.6490909091446.050909090910
4011180.211514.5127272727-334.312727272728
4112035.711509.6672727273526.032727272725
421211212356.74-244.740000000002
4310875.210848.776363636426.4236363636358
449897.39683.8490909091213.450909090907
4511672.111290.2945454545381.805454545455
4612385.711615.14770.56
4711405.610834.4036363636571.196363636364
489830.99630.62181818182200.278181818181
4911025.110561.9495454546463.150454545449
5010853.810692.5313636364161.268636363638
5112252.612275.3313636364-22.7313636363633
5211839.411142.195697.205
5311669.111137.3495454545531.750454545453
5411601.411984.4222727273-383.022272727274
5511178.410476.4586363636701.941363636363
569516.49311.53136363636204.868636363635
5712102.812077.266818181825.5331818181810
581298912402.1122727273586.887727272727
5911610.211621.3759090909-11.1759090909087
6010205.510417.5940909091-212.094090909091
6111356.211348.92181818187.27818181817804
6211307.111479.5036363636-172.403636363635
6312648.613062.3036363636-413.703636363635
6411947.211929.167272727318.0327272727283
6511714.111924.3218181818-210.221818181819
6612192.512771.3945454545-578.894545454546
6711268.811263.43090909095.36909090909034
689097.410098.5036363636-1001.10363636364
6912639.812864.2390909091-224.439090909092
7013040.113189.0845454545-148.984545454545
7111687.312408.3481818182-721.048181818183
7211191.711204.5663636364-12.8663636363630
7311391.912135.8940909091-743.994090909095
7411793.112266.4759090909-473.375909090906
7513933.213849.275909090983.9240909090925
7612778.112716.139545454561.9604545454555
7711810.312711.2940909091-900.994090909093
7813698.413558.3668181818140.033181818181
7911956.612050.4031818182-93.8031818181809
8010723.810885.4759090909-161.67590909091
8113938.913651.2113636364287.688636363636
8213979.813976.05681818183.74318181818114
8313807.413195.3204545455612.079545454545
8412973.911991.5386363636982.361363636363
8512509.812922.8663636364-413.066363636369
8612934.113053.4481818182-119.348181818179
8714908.314636.2481818182272.051818181819
8813772.113503.1118181818268.988181818183
8913012.613498.2663636364-485.666363636364
9014049.914345.3390909091-295.439090909092
9111816.512837.3754545455-1020.87545454545
9211593.211672.4481818182-79.2481818181807
9314466.214438.183636363628.0163636363649
9413615.914763.0290909091-1147.12909090909
9514733.913982.2927272727751.607272727273
9613880.712778.51090909091102.18909090909
9713527.513709.8386363636-182.338636363640
981358413840.4204545455-256.420454545451
9916170.215423.2204545455746.979545454548
10013260.614290.0840909091-1029.48409090909
10114741.914285.2386363636456.661363636363
10215486.515132.3113636364354.188636363636
10313154.513624.3477272727-469.847727272726
10412621.212459.4204545455161.779545454547
10515031.615225.1559090909-193.555909090908
10615452.415550.0013636364-97.6013636363633
1071542814769.265658.735
10813105.913565.4831818182-459.583181818182
10914716.814496.8109090909219.989090909087
1101418014627.3927272727-447.392727272724
11116202.216210.1927272727-7.99272727272485
11214392.415077.0563636364-684.656363636363
11315140.615072.210909090968.3890909090913
11415960.115919.283636363640.816363636364
11514351.314411.32-60.0199999999996
11613230.213246.3927272727-16.1927272727258
11715202.116012.1281818182-810.02818181818
1181705616336.9736363636719.026363636364
11916077.715556.2372727273521.462727272728
12013348.214352.4554545455-1004.25545454545
12116402.415283.78318181821118.61681818182
12216559.115414.3651144.73500000000
1231657916997.165-418.164999999999
12417561.215864.02863636361697.17136363637
12516129.615859.1831818182270.416818181817
12618484.316706.25590909091778.04409090909
12716402.615198.29227272731204.30772727273
12814032.314033.365-1.06499999999910
12917109.116799.1004545455309.999545454546
13017157.217123.945909090933.2540909090923
13113879.816343.2095454545-2463.40954545455
13212362.415139.4277272727-2777.02772727273


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
170.03227207649435330.06454415298870650.967727923505647
180.007799574493064380.01559914898612880.992200425506936
190.001933876726798840.003867753453597680.998066123273201
200.01067074902284080.02134149804568170.98932925097716
210.01365145556634060.02730291113268110.98634854443366
220.01020280347958440.02040560695916880.989797196520416
230.03086613368355020.06173226736710040.96913386631645
240.03844651659628090.07689303319256180.96155348340372
250.02880969604237940.05761939208475890.97119030395762
260.08443905700616410.1688781140123280.915560942993836
270.1123995106389430.2247990212778870.887600489361057
280.07823321340893680.1564664268178740.921766786591063
290.3290025420809540.6580050841619090.670997457919046
300.2845113378855640.5690226757711290.715488662114436
310.2252592652281370.4505185304562740.774740734771863
320.1892441062458120.3784882124916240.810755893754188
330.1498266305398650.2996532610797300.850173369460135
340.1973569361107620.3947138722215240.802643063889238
350.1964616318888790.3929232637777580.803538368111121
360.1603743626858370.3207487253716730.839625637314164
370.1969502917612460.3939005835224910.803049708238754
380.157948480649150.31589696129830.84205151935085
390.1263637578431210.2527275156862420.873636242156879
400.1063587129168300.2127174258336600.89364128708317
410.08343405699371860.1668681139874370.916565943006281
420.06535920045167230.1307184009033450.934640799548328
430.04826948091833590.09653896183667180.951730519081664
440.0359329641224880.0718659282449760.964067035877512
450.02549154148228070.05098308296456140.97450845851772
460.02158845356392770.04317690712785550.978411546436072
470.01569999152601760.03139998305203510.984300008473982
480.01950600378297080.03901200756594160.98049399621703
490.01393499427059290.02786998854118580.986065005729407
500.0099386093891880.0198772187783760.990061390610812
510.007003818018059790.01400763603611960.99299618198194
520.006197767441355670.01239553488271130.993802232558644
530.004462823648859250.00892564729771850.99553717635114
540.003636338429989400.007272676859978790.99636366157001
550.002989221097399530.005978442194799060.9970107789026
560.002236331062904890.004472662125809770.997763668937095
570.001667357802803540.003334715605607090.998332642197197
580.001265765741515320.002531531483030640.998734234258485
590.000964349575443180.001928699150886360.999035650424557
600.001474661837309270.002949323674618530.99852533816269
610.0009893251418156220.001978650283631240.999010674858184
620.0007482631324940090.001496526264988020.999251736867506
630.000629679114939380.001259358229878760.99937032088506
640.0003869670410631990.0007739340821263990.999613032958937
650.0003012477011750020.0006024954023500040.999698752298825
660.0002582190971836630.0005164381943673250.999741780902816
670.0001615371947689240.0003230743895378470.99983846280523
680.0004520598444465010.0009041196888930030.999547940155553
690.0003152639146155920.0006305278292311850.999684736085384
700.0002066740884116680.0004133481768233350.999793325911588
710.0002482944631925530.0004965889263851050.999751705536807
720.0001860465675389930.0003720931350779860.99981395343246
730.0002048817842845860.0004097635685691710.999795118215715
740.0001535107815716410.0003070215631432820.999846489218428
759.08903634365807e-050.0001817807268731610.999909109636563
765.18304145051469e-050.0001036608290102940.999948169585495
777.77738091395676e-050.0001555476182791350.99992222619086
785.42983639813143e-050.0001085967279626290.99994570163602
793.06261826756508e-056.12523653513015e-050.999969373817324
801.72970963769533e-053.45941927539067e-050.999982702903623
811.02178725198224e-052.04357450396449e-050.99998978212748
825.39175225463969e-061.07835045092794e-050.999994608247745
834.59750167148491e-069.19500334296983e-060.999995402498329
841.22590324934066e-052.45180649868132e-050.999987740967507
858.40719595525944e-061.68143919105189e-050.999991592804045
864.43160347562469e-068.86320695124938e-060.999995568396524
872.50316600626629e-065.00633201253257e-060.999997496833994
881.39733051715075e-062.79466103430150e-060.999998602669483
899.760360042219e-071.9520720084438e-060.999999023963996
907.1523162905904e-071.43046325811808e-060.999999284768371
911.71793913094001e-063.43587826188002e-060.999998282060869
928.48055543874453e-071.69611108774891e-060.999999151944456
934.05579895019356e-078.11159790038712e-070.999999594420105
941.54898070528949e-063.09796141057897e-060.999998451019295
951.7467188511311e-063.4934377022622e-060.999998253281149
963.14789040984718e-056.29578081969437e-050.999968521095902
972.08687392575693e-054.17374785151386e-050.999979131260742
981.22296385291071e-052.44592770582142e-050.99998777036147
991.513393149448e-053.026786298896e-050.999984866068506
1003.94180632934344e-057.88361265868688e-050.999960581936707
1012.43766583732477e-054.87533167464953e-050.999975623341627
1021.67349083049768e-053.34698166099535e-050.999983265091695
1031.68495599009735e-053.36991198019469e-050.9999831504401
1047.88499809247384e-061.57699961849477e-050.999992115001908
1053.64601524129532e-067.29203048259063e-060.999996353984759
1061.996895215816e-063.993790431632e-060.999998003104784
1074.13222991558085e-068.2644598311617e-060.999995867770084
1081.66971145842672e-053.33942291685345e-050.999983302885416
1099.08018662203781e-061.81603732440756e-050.999990919813378
1101.12796393488283e-052.25592786976566e-050.999988720360651
1114.92254972202066e-069.84509944404131e-060.999995077450278
1125.46202248963554e-050.0001092404497927110.999945379775104
1132.12221780586569e-054.24443561173139e-050.999978777821941
1140.0001239386875998350.0002478773751996710.9998760613124
1150.0005967598162661230.001193519632532250.999403240183734


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level640.646464646464647NOK
5% type I error level750.757575757575758NOK
10% type I error level820.828282828282828NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/10u0711260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/10u0711260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/1c4de1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/1c4de1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/2zsf11260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/2zsf11260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/36uov1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/36uov1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/419ve1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/419ve1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/5m1dv1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/5m1dv1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/6yp2c1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/6yp2c1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/7m17p1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/7m17p1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/83yqd1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/83yqd1260867555.ps (open in new window)


http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/9b6cy1260867555.png (open in new window)
http://www.freestatistics.org/blog/date/2009/Dec/15/t1260867622pa94lq4okebdlqw/9b6cy1260867555.ps (open in new window)


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