Home » date » 2010 » Nov » 23 »

workshop 7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 14:21:20 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk.htm/, Retrieved Tue, 23 Nov 2010 15:20:43 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
3 3 3 3 3 3 5 5 5 1 5 5 4 4 4 3 3 4 4 4 4 3 4 4 5 4 4 1 4 4 5 3 5 1 5 5 2 1 3 5 3 2 5 4 4 2 4 4 4 4 4 2 4 4 4 4 4 2 5 4 5 4 5 4 5 4 3 3 3 3 3 3 5 4 4 2 4 4 3 3 3 3 3 3 5 4 5 1 5 4 3 3 3 3 3 3 4 5 4 2 4 4 5 4 5 1 5 5 4 3 3 3 4 3 3 3 3 3 3 3 4 4 3 2 4 3 4 3 4 2 4 3 3 3 3 3 3 3 3 3 3 3 4 3 4 5 5 1 4 4 5 5 5 1 4 4 4 4 4 1 4 4 4 4 4 1 4 4 4 5 4 1 4 4 4 4 4 3 4 4 4 4 5 1 4 4 3 3 3 3 3 3 4 4 4 1 4 4 5 4 5 2 5 5 4 4 4 1 4 4 4 4 4 2 4 4 3 4 4 2 4 4 4 4 4 2 3 4 4 3 4 1 5 4 4 4 4 3 4 4 5 2 4 1 5 3 4 4 4 1 4 4 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 1 3 4 4 3 4 2 4 3 4 4 4 4 4 4 5 4 4 2 4 4 4 4 4 1 4 3 5 4 4 1 4 4 4 4 4 2 4 4 4 4 4 2 4 4 4 3 3 3 4 4 4 4 5 5 4 5 4 3 4 2 3 3 5 4 4 1 4 4 4 4 4 1 4 4 4 3 5 1 4 4 4 4 4 1 4 4 4 4 4 2 4 4 3 3 2 2 3 3 4 4 4 2 4 4 5 4 1 4 4 1 3 2 3 3 3 3 3 3 3 3 3 5 4 5 1 4 4 4 4 3 2 4 4 4 4 4 1 4 4 3 4 3 3 3 4 4 3 4 2 4 4 4 4 4 2 4 4 3 3 3 3 3 3 5 3 4 1 4 4 4 3 3 1 4 3 5 5 4 1 5 5 4 4 5 2 5 5 4 4 4 2 4 4 4 2 4 1 4 4 4 4 4 1 4 4 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 time9 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
Part_of_team[t] = + 5.81048931666183 -0.156605514625096Respect_of_coach[t] -0.295803656235203Respect_of_team[t] -0.423699767643735Be_on_different_team[t] + 0.29183798031099Be_liked[t] -0.156382636161066Proudness[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)5.810489316661830.6482558.963300
Respect_of_coach-0.1566055146250960.101821-1.5380.1260760.063038
Respect_of_team-0.2958036562352030.070444-4.19914.5e-052.3e-05
Be_on_different_team-0.4236997676437350.06709-6.315400
Be_liked0.291837980310990.1330022.19420.0297060.014853
Proudness-0.1563826361610660.125873-1.24240.2159720.107986


Multiple Linear Regression - Regression Statistics
Multiple R0.518329919577727
R-squared0.268665905529453
Adjusted R-squared0.245074483127177
F-TEST (value)11.3882876983092
F-TEST (DF numerator)5
F-TEST (DF denominator)155
p-value2.26940699565858e-09
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.05384274249476
Sum Squared Residuals172.140601515875


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
133.5885285335995-0.588528533599502
253.802020415466221.19797958453378
342.979736726578131.02026327342187
443.271574706889120.728425293110878
554.118974242176590.881025757823407
654.115231444716410.884768555283591
723.21072266372329-1.21072266372329
853.695274474532861.30472552546714
943.695274474532860.304725525467142
1043.987112454843850.0128875451561523
1152.843909263321172.15609073667883
1233.5885285335995-0.588528533599499
1353.695274474532861.30472552546714
1433.5885285335995-0.588528533599499
1554.115008566252380.884991433747621
1633.5885285335995-0.588528533599499
1743.538668959907760.461331040092238
1853.958625930091311.04137406990869
1943.880366513910490.119633486089512
2033.5885285335995-0.588528533599499
2144.14746076692913-0.147460766929127
2244.00826262531902-0.00826262531901992
2333.5885285335995-0.588528533599499
2433.88036651391049-0.880366513910488
2543.666565071316290.333434928683707
2653.666565071316291.33343492868371
2744.11897424217659-0.118974242176593
2844.11897424217659-0.118974242176593
2943.96236872755150.0376312724485033
3043.271574706889120.728425293110877
3143.823170585941390.176829414058611
3233.5885285335995-0.588528533599499
3344.11897424217659-0.118974242176593
3453.534926162447581.46507383755242
3544.11897424217659-0.118974242176593
3643.695274474532860.304725525467142
3733.69527447453286-0.695274474532858
3843.403436494221870.596563505778132
3944.56741773711268-0.567417737112678
4043.271574706889120.728425293110877
4154.880405887898840.11959411210116
4244.11897424217659-0.118974242176593
4333.5885285335995-0.588528533599499
4433.5885285335995-0.588528533599499
4543.82713626186560.172863738134397
4644.00826262531902-0.00826262531901992
4742.847874939245391.15212506075461
4853.695274474532861.30472552546714
4944.27535687833766-0.275356878337659
5054.118974242176590.881025757823407
5143.695274474532860.304725525467142
5243.695274474532860.304725525467142
5343.723983877749420.276016122250578
5441.971988879205392.02801112079461
5543.716424645008030.28357535499197
5654.118974242176590.881025757823407
5744.11897424217659-0.118974242176593
5843.979776100566490.020223899433515
5944.11897424217659-0.118974242176593
6043.695274474532860.304725525467142
6134.30803195747844-1.30803195747844
6243.695274474532860.304725525467142
6354.20443381643420.795566183565803
6433.74513404822459-0.745134048224594
6533.27576326127737-0.275763261277366
6643.57868039332590.421319606674098
6743.596087766340890.403912233659109
6843.891668544112060.108331455887936
6943.723983877749420.276016122250578
7033.43948225171579-0.439482251715795
7143.595864887876860.404135112123139
7233.27576326127737-0.275763261277366
7333.735285907951-0.735285907950998
7433.44367080610404-0.443670806104038
7553.603424120618251.39657587938175
7643.151014949757950.848985050242046
7743.439482251715790.560517748284205
7823.735285907951-1.735285907951
7943.891668544112060.108331455887936
8033.27576326127737-0.275763261277366
8143.15520350414620.844796495853803
8243.14764427140480.852355728595195
8344.18372940288708-0.183729402887084
8443.283099615554730.716900384445271
8543.154980625682170.845019374317832
8643.7352859079510.264714092049002
8743.595864887876860.404135112123139
8833.43214589743843-0.432145897438432
8943.439482251715790.560517748284205
9033.17216512023313-0.172165120233127
9133.27576326127737-0.275763261277366
9253.283099615554731.71690038444527
9343.578903271789930.421096728210068
9454.027123888261990.972876111738012
9543.7352859079510.264714092049002
9633.43948225171579-0.439482251715795
9733.735285907951-0.735285907950998
9844.02712388826199-0.0271238882619879
9944.02712388826199-0.0271238882619879
10043.439482251715790.560517748284205
10153.578903271789931.42109672821007
10253.154980625682171.84501937431783
10333.14367859548059-0.143678595480592
10453.467968776468331.53203122353167
10543.283099615554730.716900384445271
10643.143678595480590.856321404519408
10743.304026907565870.695973092434129
10833.74491116976056-0.744911169760565
10943.24705385806080.752946141939198
11052.598188059241742.40181194075826
11143.45314682727060.546853172729401
11252.035216512166872.96478348783313
11315.61165709890741-4.61165709890741
11443.29654131264550.703458687354497
11552.462732715091812.53726728490819
11633.72398387774942-0.723983877749422
11742.424175171601651.57582482839835
11832.855434171986780.144565828013219
11912.6837101918789-1.6837101918789
12033.0084461297947-0.0084461297946977
12112.85543417198678-1.85543417198678
12212.3994314443093-1.3994314443093
12312.98310740493128-1.98310740493128
12432.847874939245390.152125060754612
12522.40302500112648-0.403025001126482
12612.39546576838509-1.39546576838509
12722.26779253544059-0.267792535440587
12842.691269424620291.30873057537971
12922.84787493924539-0.847874939245388
13012.84787493924539-1.84787493924539
13122.84787493924539-0.847874939245388
13212.68789874626714-1.68789874626714
13322.84787493924539-0.847874939245388
13422.26382685951637-0.263826859516374
13512.840315706504-1.840315706504
13633.0084461297947-0.0084461297946977
13733.2927248773643-0.292724877364295
13842.716608149483711.28339185051629
13923.41077284849923-1.41077284849923
14013.1361193627392-2.1361193627392
14133.01203968661188-0.0120396866118764
14211.81538336458029-0.815383364580288
14311.97176600074135-0.971766000741355
14412.26779253544059-1.26779253544059
14511.97176600074135-0.971766000741355
14632.851617736705570.148382263294428
14723.43573945425561-1.43573945425561
14822.84787493924539-0.847874939245388
14911.97198887920538-0.971988879205385
15012.26360398105234-1.26360398105234
15122.84787493924539-0.847874939245388
15212.84787493924539-1.84787493924539
15323.13971291955638-1.13971291955638
15422.55963051575158-0.559630515751577
15522.9795138481141-0.979513848114104
15633.30028411010569-0.300284110105687
15712.26779253544059-1.26779253544059
15842.267569656976561.73243034302344
15912.10722134489128-1.10722134489128
16012.26360398105234-1.26360398105234
16132.8403157065040.159684293496004


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.1384579238140030.2769158476280050.861542076185998
100.05558552912719950.1111710582543990.9444144708728
110.04360999887795680.08721999775591350.956390001122043
120.01733122586874550.0346624517374910.982668774131255
130.01668792926212130.03337585852424260.983312070737879
140.006870775507778150.01374155101555630.993129224492222
150.005290472127351040.01058094425470210.994709527872649
160.00217951508509950.0043590301701990.9978204849149
170.00162652493819380.00325304987638760.998373475061806
180.000810427037482660.001620854074965320.999189572962517
190.001197331299385440.002394662598770880.998802668700615
200.000533806752097370.001067613504194740.999466193247903
210.0002360068337145120.0004720136674290250.999763993166286
229.31553046880573e-050.0001863106093761150.999906844695312
233.85479030081104e-057.70958060162209e-050.999961452096992
242.12113549525971e-054.24227099051942e-050.999978788645047
254.36179374800895e-058.72358749601789e-050.99995638206252
262.6910927356922e-055.3821854713844e-050.999973089072643
271.39815597638153e-052.79631195276306e-050.999986018440236
286.82806764000936e-061.36561352800187e-050.99999317193236
294.08228554803687e-068.16457109607373e-060.999995917714452
301.75858740647556e-063.51717481295112e-060.999998241412594
311.1343502168857e-062.2687004337714e-060.999998865649783
324.61912580586599e-079.23825161173198e-070.99999953808742
331.96925241299266e-073.93850482598531e-070.99999980307476
341.15385255028441e-072.30770510056882e-070.999999884614745
354.82954019449333e-089.65908038898666e-080.999999951704598
361.99899248288793e-083.99798496577587e-080.999999980010075
371.63112135531683e-073.26224271063365e-070.999999836887864
388.4017714042613e-081.68035428085226e-070.999999915982286
394.21997390220572e-088.43994780441144e-080.99999995780026
401.89821803452293e-083.79643606904587e-080.99999998101782
414.41787807935692e-088.83575615871384e-080.999999955821219
421.99271884182202e-083.98543768364403e-080.999999980072812
438.51894974184499e-091.703789948369e-080.99999999148105
443.61655398639625e-097.2331079727925e-090.999999996383446
451.72759404651243e-093.45518809302485e-090.999999998272406
466.87704361906833e-101.37540872381367e-090.999999999312296
473.32187863027781e-106.64375726055562e-100.999999999667812
481.33415834446109e-092.66831668892218e-090.999999998665842
495.57279767305451e-101.1145595346109e-090.99999999944272
501.44333345974335e-092.88666691948671e-090.999999998556667
517.63491432965051e-101.5269828659301e-090.99999999923651
524.14699961446615e-108.2939992289323e-100.9999999995853
532.17367552480427e-104.34735104960853e-100.999999999782632
542.2400494587421e-104.4800989174842e-100.999999999775995
551.73390295780629e-103.46780591561258e-100.99999999982661
566.24642812454306e-101.24928562490861e-090.999999999375357
575.50323815312538e-101.10064763062508e-090.999999999449676
588.48059547194976e-101.69611909438995e-090.99999999915194
591.35089087086061e-092.70178174172122e-090.99999999864911
602.1710167733875e-094.342033546775e-090.999999997828983
611.02930252322964e-092.05860504645928e-090.999999998970697
622.55061532830212e-095.10123065660424e-090.999999997449385
636.5281946595955e-081.3056389319191e-070.999999934718053
643.88024264524142e-087.76048529048284e-080.999999961197574
651.9024507708362e-083.80490154167241e-080.999999980975492
669.70213665618036e-091.94042733123607e-080.999999990297863
676.2398833545439e-091.24797667090878e-080.999999993760117
683.027541124361e-096.05508224872199e-090.99999999697246
692.31082807347657e-094.62165614695313e-090.999999997689172
703.96287424965667e-097.92574849931335e-090.999999996037126
711.94774165729567e-093.89548331459134e-090.999999998052258
729.2054009445336e-101.84108018890672e-090.99999999907946
731.20130528334178e-092.40261056668356e-090.999999998798695
741.47295813983883e-092.94591627967766e-090.999999998527042
751.84928341831919e-093.69856683663837e-090.999999998150717
762.09273400526747e-094.18546801053494e-090.999999997907266
771.18059599168589e-092.36119198337179e-090.999999998819404
789.28214130574e-081.856428261148e-070.999999907178587
795.66270360427121e-081.13254072085424e-070.999999943372964
802.91271386099873e-085.82542772199747e-080.999999970872861
812.37888589912363e-084.75777179824725e-080.99999997621114
822.94851951783875e-085.8970390356775e-080.999999970514805
831.54031615373647e-083.08063230747294e-080.999999984596838
841.02777740102044e-082.05555480204088e-080.999999989722226
855.29189653987717e-091.05837930797543e-080.999999994708103
862.93050753597014e-095.86101507194028e-090.999999997069492
871.50070454883133e-093.00140909766267e-090.999999998499295
887.4252532309393e-101.48505064618786e-090.999999999257475
894.10033113117508e-108.20066226235017e-100.999999999589967
908.55995595384935e-101.71199119076987e-090.999999999144004
914.16711119300215e-108.33422238600431e-100.999999999583289
924.76231898765135e-099.5246379753027e-090.999999995237681
932.58931280444449e-095.17862560888898e-090.999999997410687
943.72998119022445e-097.4599623804489e-090.999999996270019
951.91286464894737e-093.82572929789474e-090.999999998087135
962.3498881270694e-094.6997762541388e-090.999999997650112
973.7072747367728e-097.4145494735456e-090.999999996292725
982.16550498787329e-094.33100997574657e-090.999999997834495
991.23560982944979e-092.47121965889958e-090.99999999876439
1007.2496319490336e-101.44992638980672e-090.999999999275037
1014.49960713104946e-098.99921426209892e-090.999999995500393
1021.3921777116148e-082.7843554232296e-080.999999986078223
1031.66147195774867e-083.32294391549735e-080.99999998338528
1044.48885844182819e-088.97771688365639e-080.999999955111416
1056.23192615057864e-081.24638523011573e-070.999999937680738
1061.08608725838518e-072.17217451677036e-070.999999891391274
1071.20970253093394e-072.41940506186788e-070.999999879029747
1086.91901292863704e-081.38380258572741e-070.99999993080987
1091.6634533048903e-053.32690660978059e-050.99998336546695
1106.93013258465729e-050.0001386026516931460.999930698674153
1118.27767596671496e-050.0001655535193342990.999917223240333
1120.001410675317424950.00282135063484990.998589324682575
1130.005662658324432530.01132531664886510.994337341675567
1140.01313780856781730.02627561713563460.986862191432183
1150.01701157651482810.03402315302965610.982988423485172
1160.01634806032651470.03269612065302950.983651939673485
1170.02717673237103770.05435346474207540.972823267628962
1180.03878321183847930.07756642367695860.96121678816152
1190.1655496919532630.3310993839065270.834450308046736
1200.1367791414170750.273558282834150.863220858582925
1210.4167095271769550.833419054353910.583290472823045
1220.5673656440232550.8652687119534910.432634355976745
1230.7360196927143170.5279606145713660.263980307285683
1240.7506454310155630.4987091379688730.249354568984437
1250.7576691650727810.4846616698544380.242330834927219
1260.7886989382609050.422602123478190.211301061739095
1270.7608832561441540.4782334877116910.239116743855846
1280.940915122377110.1181697552457810.0590848776228905
1290.9294660554133560.1410678891732880.0705339445866438
1300.9526242412849210.09475151743015770.0473757587150788
1310.9402539960711970.1194920078576060.0597460039288029
1320.9385973829501770.1228052340996460.0614026170498229
1330.92148189207630.1570362158473980.078518107923699
1340.9371767324081750.1256465351836510.0628232675918254
1350.9369510144067760.1260979711864490.0630489855932245
1360.912355680145740.1752886397085210.0876443198542605
1370.8831032842903920.2337934314192150.116896715709608
1380.8828425882425290.2343148235149420.117157411757471
1390.8502991370712880.2994017258574250.149700862928712
1400.9173185628896040.1653628742207910.0826814371103956
1410.9009133235384140.1981733529231720.0990866764615862
1420.8716059721116520.2567880557766960.128394027888348
1430.843397901378880.3132041972422390.15660209862112
1440.8144469186355630.3711061627288730.185553081364437
1450.7888012811851160.4223974376297690.211198718814884
1460.7406727678097290.5186544643805420.259327232190271
1470.6792346105628250.6415307788743510.320765389437176
1480.5764006337371270.8471987325257460.423599366262873
1490.4671624932032270.9343249864064540.532837506796773
1500.4248337370558760.8496674741117520.575166262944124
1510.2964779013036850.592955802607370.703522098696315
1520.3012923517957340.6025847035914670.698707648204266


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level970.673611111111111NOK
5% type I error level1050.729166666666667NOK
10% type I error level1090.756944444444444NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/103l021290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/103l021290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/1w23q1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/1w23q1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/2pt3t1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/2pt3t1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/3pt3t1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/3pt3t1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/4pt3t1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/4pt3t1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/5h22w1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/5h22w1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/6h22w1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/6h22w1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/7aujz1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/7aujz1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/8aujz1290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/8aujz1290522067.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/93l021290522067.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290522038ws66008p4asg5wk/93l021290522067.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 = Do not include Seasonal Dummies ; par3 = No 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