Home » date » 2010 » Dec » 01 »

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: Wed, 01 Dec 2010 18:58:39 +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/Dec/01/t1291229801xm3s8j2nblo12kj.htm/, Retrieved Wed, 01 Dec 2010 19:56:52 +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/Dec/01/t1291229801xm3s8j2nblo12kj.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 «
0 1 0 2 0 5 0 2 0 3 0 3 0 4 0 4 0 2 0 2 0 4 0 2 0 4 0 3 0 4 0 4 1 3 3 4 4 4 4 2 2 4 4 2 2 5 5 4 0 4 0 2 0 4 0 2 0 2 0 2 0 2 0 4 1 5 5 3 3 2 2 2 2 2 2 3 3 2 2 4 1 6 6 4 4 5 5 1 1 3 3 2 2 4 4 5 0 7 0 3 0 5 0 1 0 2 0 1 0 4 0 4 1 8 8 3 3 4 4 3 3 3 3 3 3 4 4 3 0 9 0 3 0 3 0 2 0 3 0 2 0 4 0 4 0 10 0 2 0 4 0 1 0 3 0 2 0 2 0 4 1 11 11 4 4 4 4 4 4 3 3 3 3 3 3 4 0 12 0 4 0 2 0 2 0 4 0 2 0 4 0 4 1 13 13 3 3 3 3 3 3 2 2 2 2 3 3 4 1 14 14 3 3 3 3 2 2 2 2 2 2 4 4 2 0 15 0 4 0 4 0 1 0 1 0 3 0 4 0 3 1 16 16 4 4 5 5 1 1 1 1 1 1 4 4 4 0 17 0 3 0 4 0 2 0 3 0 3 0 4 0 3 0 18 0 3 0 2 0 2 0 2 0 2 0 2 0 2 1 19 19 3 3 4 4 2 2 2 2 3 3 4 4 4 0 20 0 4 0 4 0 2 0 3 0 4 0 4 0 3 1 21 21 2 2 4 4 1 1 4 4 2 2 4 4 3 1 22 22 5 5 4 4 2 2 4 4 3 3 3 3 4 0 23 0 4 0 4 0 4 0 3 0 5 0 2 0 3 1 24 24 2 2 4 4 2 2 2 2 2 2 4 4 3 0 25 0 3 0 5 0 2 0 3 0 2 0 2 0 4 0 26 0 4 0 4 0 2 0 4 0 3 0 3 0 4 1 27 27 4 4 4 4 2 2 3 3 2 2 4 4 4 0 28 0 3 0 4 0 2 0 2 0 2 0 3 0 4 1 29 29 4 4 4 4 3 3 1 1 2 2 4 4 4 1 30 30 4 4 4 4 2 2 3 3 2 2 4 4 4 0 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time14 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
neat[t] = + 3.11496151267242 -0.356877549090112pop[t] -0.00119421517556334t -0.00179540754477216pop_t[t] -0.00219470236971560standards[t] -0.0349340132681785standards_t[t] + 0.304511079436017organization[t] -0.00263513485222916organization_t[t] -0.0975529079437357punished[t] -0.091053686996288punished_t[t] -0.0044969276903347secondrate[t] + 0.00189629269507838secondrate_t[t] -0.145120416918951mistakes[t] + 0.186359455031473mistakes_t[t] + 0.026158675364112competent[t] + 0.0520976377859456competent_t[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.114961512672420.7075994.40222.1e-051e-05
pop-0.3568775490901120.94367-0.37820.7058570.352929
t-0.001194215175563340.002018-0.59160.5550260.277513
pop_t-0.001795407544772160.00278-0.64580.5194330.259716
standards-0.002194702369715600.091643-0.02390.9809270.490464
standards_t-0.03493401326817850.136461-0.2560.7983180.399159
organization0.3045110794360170.1021622.98070.0033810.001691
organization_t-0.002635134852229160.15028-0.01750.9860340.493017
punished-0.09755290794373570.100025-0.97530.3310660.165533
punished_t-0.0910536869962880.16336-0.55740.5781390.28907
secondrate-0.00449692769033470.085287-0.05270.9580230.479012
secondrate_t0.001896292695078380.1311870.01450.9884870.494244
mistakes-0.1451204169189510.101501-1.42970.1549720.077486
mistakes_t0.1863594550314730.1479171.25990.2097610.10488
competent0.0261586753641120.1034390.25290.8007160.400358
competent_t0.05209763778594560.1639810.31770.7511710.375586


Multiple Linear Regression - Regression Statistics
Multiple R0.457606458303133
R-squared0.209403670680737
Adjusted R-squared0.126473985787108
F-TEST (value)2.52507495897678
F-TEST (DF numerator)15
F-TEST (DF denominator)143
p-value0.00239273837122178
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.743455096513655
Sum Squared Residuals79.0397437160943


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
144.09261014167856-0.0926101416785626
243.782407919376700.217592080623296
343.894247923319130.105752076680872
443.881816410596980.118183589403024
543.133316873001640.86668312699836
654.300105916527130.69989408347287
744.4755408177275-0.475540817727498
833.69340529037304-0.693405290373043
943.616959975951320.383040024048684
1043.9677070997970.0322929002030034
1143.380444798484060.619555201515939
1243.302174620928560.69782537907144
1343.259686515920250.740313484079746
1423.52355980129-1.52355980129000
1533.87353740836969-0.873537408369691
1644.23417192120177-0.234171921201766
1733.76679691706388-0.766796917063876
1823.25388053689734-1.25388053689734
1943.851726670384630.148273329615367
2033.61589915224852-0.61589915224852
2134.02504242741884-1.02504242741884
2243.685042787807270.314957212192732
2333.21977292318718-0.219772923187184
2433.83266823430833-0.832668234308326
2544.15455734128611-0.154557341286112
2643.723198675059640.276801324940356
2743.746841299876270.253158700123725
2843.877119219377850.122880780622148
2943.557456729486090.442543270513907
3043.737872431715270.262127568284731
3153.856517144979491.14348285502051
3243.434557437624340.56544256237566
3343.51757472473470.4824252752653
3443.739696106068350.260303893931655
3533.76676399122137-0.76676399122137
3644.21540007275692-0.215400072756917
3734.04923877542472-1.04923877542472
3843.51880442053520.481195579464797
3943.572247188254650.427752811745349
4033.70537556951666-0.705375569516657
4154.216228149890050.783771850109946
4244.02498766914298-0.0249876691429781
4333.58222406068394-0.582224060683942
4434.32261339053753-1.32261339053753
4533.76728552218602-0.767285522186025
4644.25997970898001-0.259979708980013
4743.535834919470420.464165080529580
4844.01997829212459-0.0199782921245865
4943.876004673685420.123995326314581
5043.658858431636900.341141568363095
5143.931243423334150.0687565766658501
5243.872422028158730.127577971841271
5353.74596917541861.25403082458140
5433.24546762284602-0.245467622846023
5532.853473148591410.146526851408595
5653.999146901208231.00085309879177
5753.861846501639671.13815349836033
5843.962809645049080.0371903549509157
5944.13754558987472-0.137545589874721
6033.36530886441046-0.365308864410462
6143.982689100127180.0173108998728230
6243.826700777129930.173299222870073
6354.265739053346720.734260946653285
6443.788850444250070.211149555749933
6543.930486165825740.0695138341742556
6654.253162552439360.746837447560644
6743.510473115395890.489526884604109
6833.64933057875426-0.649330578754261
6944.11285063266188-0.112850632661879
7043.692544954177640.307455045822363
7143.644968470700460.355031529299541
7243.877772938672250.122227061327754
7344.04980475327385-0.0498047532738448
7444.01795493504383-0.0179549350438348
7543.861375680776180.138624319223821
7633.84815026868464-0.84815026868464
7743.823095474437420.176904525562582
7833.70503925578767-0.705039255787672
7954.146884000224250.85311599977575
8043.549752892581230.450247107418773
8153.847455583024271.15254441697573
8253.481961845097301.51803815490270
8343.765539828082610.234460171917386
8443.665260002017340.334739997982658
8543.716811857050050.283188142949953
8643.678203206171190.321796793828810
8743.928069882006840.0719301179931565
8854.09317651661340.906823483386601
8943.628633323085080.371366676914921
9033.97435697077599-0.974356970775988
9143.558106080770060.441893919229941
9234.35456548250055-1.35456548250055
9343.510514281966160.489485718033843
9443.472996578603180.527003421396817
9543.880606304862220.119393695137784
9643.583624490623560.416375509376438
9743.768589423338950.231410576661046
9833.56801565220917-0.568015652209175
9933.33643743459474-0.336437434594737
10033.93625614365624-0.936256143656242
10133.25874631048137-0.258746310481367
10233.63146019016171-0.631460190161706
10323.57103843171203-1.57103843171203
10433.59349841668149-0.593498416681486
10554.059020127241040.940979872758955
10623.30877261302954-1.30877261302954
10723.46914451973253-1.46914451973253
10833.00131048061677-0.00131048061677247
10933.27184660375622-0.271846603756217
11033.91213122857843-0.912131228578425
11143.573343413634430.426656586365567
11243.57520144487280.424798555127197
11333.44508656576661-0.44508656576661
11423.71130096925346-1.71130096925346
11533.60347273295005-0.603472732950051
11643.912651773156890.0873482268431058
11722.87402336587850-0.874023365878504
11842.752255824160761.24774417583924
11943.662006398028090.337993601971913
12023.19751472346182-1.19751472346182
12134.03039228058693-1.03039228058693
12233.12242423434371-0.122424234343708
12333.00388305984289-0.00388305984289308
12444.12149769505773-0.121497695057728
12543.760561972606990.239438027393013
12643.444386494986240.555613505013757
12733.99037668410938-0.990376684109383
12843.403761807610230.596238192389774
12943.849559466899360.150440533100644
13043.517277913432140.482722086567864
13122.94283736244231-0.942837362442315
13243.752920841119260.247079158880735
13353.467236530151131.53276346984887
13443.986514105570770.0134858944292257
13543.725374222598180.274625777401822
13643.420972423359700.579027576640295
13733.56834497148299-0.568344971482994
13813.45883285102681-2.45883285102681
13943.219286637784050.780713362215954
14032.820277403400410.179722596599586
14132.956407293096030.0435927069039693
14233.59139107119343-0.59139107119343
14312.39835293598855-1.39835293598855
14443.621281064695570.378718935304433
14553.354799101761251.64520089823875
14643.466843314911510.533156685088489
14733.19899502264492-0.198995022644922
14843.115797384057550.884202615942452
14932.894018431208610.105981568791393
15043.551289269685380.44871073031462
15143.559651532516110.44034846748389
15243.373138459834340.626861540165663
15353.830029407456491.16997059254351
15422.87635824201131-0.876358242011314
15533.2172869906969-0.217286990696898
15633.72425967690574-0.724259676905745
15743.473575375020610.526424624979389
15843.546232475971210.453767524028792
15932.897968996793500.102031003206497


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
190.68881028559930.62237942880140.3111897144007
200.5366500098007690.9266999803984610.463349990199231
210.5717793710089370.8564412579821250.428220628991063
220.5000418053667770.9999163892664470.499958194633223
230.3838257775366250.7676515550732510.616174222463375
240.2967124633342250.593424926668450.703287536665775
250.2370559193104220.4741118386208440.762944080689578
260.1656189087785130.3312378175570260.834381091221487
270.1793440989818170.3586881979636350.820655901018183
280.2597756205529650.519551241105930.740224379447035
290.2285924029699100.4571848059398190.77140759703009
300.1822647901833060.3645295803666120.817735209816694
310.2360919670240090.4721839340480180.763908032975991
320.1979390142153300.3958780284306590.80206098578467
330.1498161609178610.2996323218357220.850183839082139
340.1813962509100280.3627925018200560.818603749089972
350.1743411433113330.3486822866226650.825658856688667
360.1570114630758690.3140229261517380.842988536924131
370.1336847539779490.2673695079558980.866315246022051
380.1057396371001260.2114792742002520.894260362899874
390.08515120031142120.1703024006228420.914848799688579
400.0677995763261320.1355991526522640.932200423673868
410.07723789285455930.1544757857091190.92276210714544
420.06077483562885370.1215496712577070.939225164371146
430.05147750171040570.1029550034208110.948522498289594
440.1244416151392960.2488832302785910.875558384860704
450.1163529890104450.232705978020890.883647010989555
460.1201162852745190.2402325705490380.879883714725481
470.1048033173926610.2096066347853230.895196682607339
480.1573479926270890.3146959852541770.842652007372911
490.1240976200762510.2481952401525030.875902379923749
500.09906555257919660.1981311051583930.900934447420803
510.1166699880437680.2333399760875360.883330011956232
520.09063374932510180.1812674986502040.909366250674898
530.1977127338907510.3954254677815020.802287266109249
540.1628174484736430.3256348969472850.837182551526357
550.1351927173594710.2703854347189410.86480728264053
560.1570529794522330.3141059589044670.842947020547766
570.1569803856717200.3139607713434390.84301961432828
580.1299326500608210.2598653001216420.870067349939179
590.1059518945336870.2119037890673740.894048105466313
600.1115169436231000.2230338872462010.8884830563769
610.08855628752289080.1771125750457820.911443712477109
620.06954430211576880.1390886042315380.930455697884231
630.05992842992762090.1198568598552420.94007157007238
640.04657837142615720.09315674285231450.953421628573843
650.03584602292304280.07169204584608560.964153977076957
660.03171651754453490.06343303508906990.968283482455465
670.02627123630959480.05254247261918950.973728763690405
680.03484671628109750.0696934325621950.965153283718903
690.02679836097559680.05359672195119360.973201639024403
700.02009004502810400.04018009005620810.979909954971896
710.01608915285640160.03217830571280310.983910847143598
720.01157607148816700.02315214297633400.988423928511833
730.008281484239864220.01656296847972840.991718515760136
740.005794567090943730.01158913418188750.994205432909056
750.004079422667444510.008158845334889030.995920577332555
760.006809311122276980.01361862224455400.993190688877723
770.004741879523382590.009483759046765170.995258120476617
780.006325569768070460.01265113953614090.99367443023193
790.006898991501841720.01379798300368340.993101008498158
800.005167478311622090.01033495662324420.994832521688378
810.01037845014378440.02075690028756870.989621549856216
820.02471272180304810.04942544360609620.975287278196952
830.01840145592541250.0368029118508250.981598544074588
840.01547476238988570.03094952477977140.984525237610114
850.01133132751028500.02266265502057000.988668672489715
860.008166186844233410.01633237368846680.991833813155767
870.008768756793906530.01753751358781310.991231243206093
880.008981157109396880.01796231421879380.991018842890603
890.007985369147327660.01597073829465530.992014630852672
900.01171452996963630.02342905993927270.988285470030364
910.01012886516482780.02025773032965570.989871134835172
920.02110055887347310.04220111774694630.978899441126527
930.01662310722414640.03324621444829290.983376892775853
940.01670794741405260.03341589482810520.983292052585947
950.01597753760588220.03195507521176430.984022462394118
960.01632352403565980.03264704807131950.98367647596434
970.01241734423198260.02483468846396510.987582655768017
980.01343174471484870.02686348942969750.986568255285151
990.01254883938305630.02509767876611260.987451160616944
1000.01512186205520650.0302437241104130.984878137944794
1010.01306232218188620.02612464436377240.986937677818114
1020.01180838354620260.02361676709240520.988191616453797
1030.02176787714179460.04353575428358920.978232122858205
1040.01857744409600660.03715488819201310.981422555903993
1050.02857285360752770.05714570721505550.971427146392472
1060.05125738197367520.1025147639473500.948742618026325
1070.0881847922506540.1763695845013080.911815207749346
1080.07370901696157060.1474180339231410.92629098303843
1090.05664843393449240.1132968678689850.943351566065508
1100.08939816772462350.1787963354492470.910601832275376
1110.07666734508367650.1533346901673530.923332654916323
1120.1075011903502890.2150023807005770.892498809649712
1130.1082187620917830.2164375241835650.891781237908217
1140.1384539062461830.2769078124923670.861546093753817
1150.1274637606869620.2549275213739250.872536239313038
1160.1026513532766110.2053027065532220.897348646723389
1170.1011819791606210.2023639583212420.89881802083938
1180.1506945689290690.3013891378581380.849305431070931
1190.1253327388682660.2506654777365320.874667261131734
1200.3373026020389870.6746052040779750.662697397961013
1210.3845633017579370.7691266035158750.615436698242063
1220.3243152869755120.6486305739510240.675684713024488
1230.2700453557638480.5400907115276960.729954644236152
1240.2506538575738780.5013077151477570.749346142426122
1250.2072814541328550.4145629082657090.792718545867145
1260.1949036739199350.389807347839870.805096326080065
1270.2563171132574810.5126342265149610.74368288674252
1280.2709603574998800.5419207149997610.72903964250012
1290.2606624386482200.5213248772964410.73933756135178
1300.2420917425168070.4841834850336150.757908257483193
1310.2335708524185190.4671417048370370.766429147581481
1320.1949691885472230.3899383770944460.805030811452777
1330.2621067045262660.5242134090525310.737893295473735
1340.1990133064348980.3980266128697970.800986693565102
1350.2304752583783460.4609505167566920.769524741621654
1360.4341143156868660.8682286313737320.565885684313134
1370.3267414289808260.6534828579616520.673258571019174
1380.2783941609659890.5567883219319790.72160583903401
1390.3080921563310230.6161843126620470.691907843668977
1400.3139519915293060.6279039830586120.686048008470694


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level20.0163934426229508NOK
5% type I error level350.286885245901639NOK
10% type I error level420.344262295081967NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/10silh1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/10silh1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/1lhon1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/1lhon1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/2lhon1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/2lhon1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/3v9581291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/3v9581291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/4v9581291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/4v9581291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/5v9581291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/5v9581291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/6o0mb1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/6o0mb1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/7zr3e1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/7zr3e1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/8zr3e1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/8zr3e1291229903.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/9zr3e1291229903.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229801xm3s8j2nblo12kj/9zr3e1291229903.ps (open in new window)


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