Home » date » 2010 » Nov » 23 »

WS 7 - Minitutorial - Depression

*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 17:27:29 +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/t1290533269bh6gjxoxafdux3p.htm/, Retrieved Tue, 23 Nov 2010 18:28:00 +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/t1290533269bh6gjxoxafdux3p.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 «
12 6 15 4 7 2 2 2 2 11 6 15 3 5 4 1 2 2 14 13 14 5 7 7 4 3 4 12 8 10 3 3 3 1 2 3 21 7 10 6 7 7 5 4 4 12 9 12 5 7 2 1 2 3 22 5 18 6 7 7 1 2 3 11 8 12 6 1 2 1 3 4 10 9 14 5 4 1 1 2 3 13 11 18 5 5 2 1 2 4 10 8 9 3 6 6 2 3 3 8 11 11 5 4 1 1 2 2 15 12 11 7 7 1 3 3 3 10 8 17 5 6 1 1 1 3 14 7 8 5 2 2 1 3 3 14 9 16 3 2 2 1 1 2 11 12 21 5 6 2 1 3 3 10 20 24 6 7 1 1 2 2 13 7 21 5 5 7 2 3 4 7 8 14 2 2 1 4 4 5 12 8 7 5 7 2 1 3 3 14 16 18 4 4 4 2 3 3 11 10 18 6 5 2 1 1 1 9 6 13 3 5 1 2 2 4 11 8 11 5 5 1 3 1 3 15 9 13 4 3 5 1 3 4 13 9 13 5 5 2 1 3 3 9 11 18 2 1 1 1 2 3 15 12 14 2 1 3 1 2 1 10 8 12 5 3 1 1 3 4 11 7 9 2 2 2 2 2 4 13 8 12 2 3 5 1 2 2 8 9 8 2 2 2 1 2 2 20 4 5 5 5 6 1 1 1 12 8 10 5 2 4 1 2 3 10 8 11 1 3 1 1 3 4 10 8 11 5 4 3 1 1 1 9 6 12 2 6 6 1 2 3 14 8 12 6 2 7 2 3 3 8 4 15 1 7 4 1 2 2 14 7 12 4 6 1 2 1 4 11 14 16 3 5 5 1 1 3 13 10 14 2 3 3 1 3 3 11 9 17 5 3 2 2 3 2 11 8 10 3 4 2 1 3 3 10 11 17 4 5 2 1 3 2 14 8 12 3 2 2 1 2 1 18 8 13 6 7 1 1 3 3 14 10 13 4 6 2 1 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'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Depression[t] = + 7.49200704176759 + 0.0408955674052273CriticParents[t] -0.0669085142751476ExpecParents[t] + 0.586756102445572FutureWorrying[t] + 0.202166740732203SleepDepri[t] + 0.35634657786847ChangesLastYear[t] -0.121340486208485FreqSmoking[t] + 0.264713129723179FreqHighAlc[t] + 0.292590037590936FreqBeerOrWine[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)7.492007041767591.4452385.18391e-060
CriticParents0.04089556740522730.1157540.35330.7244120.362206
ExpecParents-0.06690851427514760.086583-0.77280.4410.2205
FutureWorrying0.5867561024455720.1682573.48730.0006580.000329
SleepDepri0.2021667407322030.1412081.43170.1545250.077263
ChangesLastYear0.356346577868470.1349222.64110.009230.004615
FreqSmoking-0.1213404862084850.273487-0.44370.657980.32899
FreqHighAlc0.2647131297231790.3146050.84140.4015930.200796
FreqBeerOrWine0.2925900375909360.2785321.05050.2953640.147682


Multiple Linear Regression - Regression Statistics
Multiple R0.453459545887258
R-squared0.205625559756278
Adjusted R-squared0.158897651506647
F-TEST (value)4.40048714908833
F-TEST (DF numerator)8
F-TEST (DF denominator)136
p-value9.38949108088005e-05
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.89966249185119
Sum Squared Residuals1143.49378906421


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11212.0805628449277-0.0805628449276666
21111.9235069029631-0.923506902963089
31415.4094415553154-1.40944155531539
41211.87175058740730.128249412592660
52116.16183095394494.8381690460551
61213.4046617162138-1.40466171621376
72215.20811735272996.7918826472701
81113.294824974175-2.29482497417500
91012.3079978875984-2.30799788759839
101312.97325832149990.0267416785001346
111013.7575717009992-3.75757170099921
12812.2979245276434-4.29792452764335
131514.43345471703350.566545282966519
141012.2059971291089-2.20599712910895
151412.84438406456611.15561593543394
161410.39537858324693.6046214167531
171112.9877181789441-1.98771817894410
181012.9894302733557-2.98943027335566
191314.5340560419106-1.53405604191056
20710.8530854073948-3.85308540739482
211213.9630218499075-1.96302184990746
221412.95228907700891.04771092299107
231112.3766356140442-1.37663561404422
24911.4521237868814-2.45212378688137
251112.1626005016107-1.16260050161066
261513.56867303748381.43132696251624
271313.1981328501974-0.198132850197392
2899.75538643577493-0.755386435774928
291510.19142914083584.80857085916418
301012.7560557753254-2.75605577532537
311110.92374366461350.0762563353865289
321311.57128057455751.42871942544252
33810.6086037247257-2.60860372472569
342013.83970310421816.16029689578191
351213.1994426294348-1.19944262943476
361010.4759398798182-0.475939879818229
371012.3306278138505-2.33062781385050
38912.7449262774030-3.74492627740305
391414.8647940804501-0.86479408045014
40811.0725370447259-3.07253704472590
411412.08413758201631.91586241798366
421112.567986413666-1.56798641366600
431311.36386469239481.63613530760518
441112.1122347878330-1.11223478783297
451111.9822838799943-0.98228387999426
461012.1329437878707-2.13294378787075
471410.59424016507453.40575983492549
481813.79198028883374.20801971116633
491412.58972592616611.41027407383393
501113.1558663500304-2.15586635003041
511211.23911941933090.760880580669071
521313.1832502296621-0.183250229662084
53913.9792753460670-4.97927534606705
541012.3104228182865-2.31042281828649
551513.63701645868041.36298354131957
562014.10019760740035.89980239259967
571211.70343823724010.296561762759900
581212.1199054413807-0.119905441380711
591411.25147826801122.74852173198882
601314.9218163051899-1.92181630518988
611114.2759504044091-3.27595040440913
621713.31480353572483.68519646427524
631212.1222701077126-0.122270107712629
641312.84391856063810.156081439361885
651413.84062439731940.159375602680603
661310.69388708643312.30611291356686
671513.98348427093521.0165157290648
681311.89260647893961.10739352106036
691013.6050017195018-3.60500171950182
701111.2954337208940-0.295433720893954
711312.83330597686690.166694023133087
721714.13346856366162.86653143633839
731312.94565182022850.0543481797715108
74911.8461956050346-2.84619560503464
751112.3572945704317-1.35729457043169
761010.0936373227236-0.0936373227235615
77910.1996736606694-1.19967366066936
781211.45497568205020.545024317949755
791212.4198409594227-0.419840959422669
801312.27975510375350.720244896246507
811312.36250351985520.637496480144759
822214.64898659616707.35101340383298
831311.99568885034391.00431114965606
841513.66583987577581.33416012422415
851314.1858042120834-1.18580421208342
861511.64013091154373.35986908845631
871011.6114389131177-1.61143891311767
881110.78909948094010.210900519059895
891614.13530820716471.86469179283533
901111.8993022808498-0.899302280849812
911112.2999647274325-1.29996472743248
921012.5555985598113-2.55559855981128
931014.5203082518953-4.52030825189527
941614.04187529201421.9581247079858
951213.3111487926171-1.31114879261707
961113.6768538243424-2.67685382434239
971614.31496482041091.68503517958910
981914.8616387112744.13836128872598
991114.8795757571412-3.87957575714115
1001512.5210639080452.47893609195499
1012416.32147807550017.67852192449986
1021411.51190244891102.48809755108905
1031513.44673015421441.5532698457856
1041114.7404744662841-3.74047446628405
1051513.22981645071611.77018354928388
1061212.7913012044466-0.791301204446649
1071010.6950402700760-0.695040270075978
1081413.64304959312790.356950406872131
109912.7424535712216-3.74245357122163
1101510.46920682303644.53079317696355
111159.684206566414965.31579343358504
1121412.84536861629631.15463138370367
1131114.0815179803778-3.0815179803778
114814.2146627734475-6.21466277344749
1151114.1080885041867-3.10808850418670
116811.6187647066161-3.61876470661612
1171011.2876993236633-1.28769932366329
1181113.4296441481942-2.42964414819416
1191313.9924275035589-0.992427503558935
1201113.6864081234133-2.6864081234133
1212012.68599736633767.31400263366237
1221012.0897220832703-2.08972208327026
1231210.74505027909421.25494972090576
1241412.40576242218991.59423757781014
1252313.74399338523779.25600661476226
1261412.64186988393661.35813011606345
1271615.09885495538360.901145044616358
1281113.2935633971562-2.29356339715624
1291213.9791757181162-1.97917571811624
1301013.5188769807189-3.51887698071890
1311413.72364151368820.276358486311758
132129.646003431024132.35399656897587
1331213.4775159069585-1.47751590695849
1341110.02391957358660.97608042641338
1351212.2535525196977-0.253552519697721
1361315.6147192027332-2.61471920273317
1371716.25187291751040.748127082489616
1381112.1626005016107-1.16260050161066
1391213.5154478216585-1.51544782165847
1401914.95829277966724.04170722033279
1411513.66583987577581.33416012422415
1421413.30770334178260.692296658217409
1431113.4296441481942-2.42964414819416
144910.4591886130326-1.45918861303263
1451811.65399044878486.34600955121516


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.1926259162491300.3852518324982590.80737408375087
130.2991785534902830.5983571069805660.700821446509717
140.4558260158513850.911652031702770.544173984148615
150.4008522288423880.8017044576847770.599147771157612
160.5534259210343960.8931481579312090.446574078965604
170.4692885565420590.9385771130841170.530711443457941
180.3834390085294840.7668780170589680.616560991470516
190.48998776172620.97997552345240.5100122382738
200.4193359699864650.838671939972930.580664030013535
210.3523178483994790.7046356967989580.647682151600521
220.3982272284687390.7964544569374780.601772771531261
230.4443793023685790.8887586047371590.555620697631421
240.3723115061432550.744623012286510.627688493856745
250.3156463276307380.6312926552614750.684353672369262
260.2743959391834840.5487918783669670.725604060816516
270.2245671129031660.4491342258063320.775432887096834
280.1893649141441130.3787298282882260.810635085855887
290.2479709625405080.4959419250810160.752029037459492
300.2079402576804490.4158805153608990.79205974231955
310.1709762506716090.3419525013432180.829023749328391
320.1341917441517340.2683834883034680.865808255848266
330.1293315846030510.2586631692061030.870668415396949
340.1466330336950040.2932660673900090.853366966304996
350.1490755878789850.2981511757579690.850924412121015
360.1541337838135120.3082675676270250.845866216186488
370.1944183746565010.3888367493130020.805581625343499
380.2467681494256590.4935362988513190.753231850574341
390.2703915726816620.5407831453633250.729608427318338
400.2639926092850950.5279852185701910.736007390714905
410.2756575599020650.5513151198041310.724342440097935
420.2447134600569360.4894269201138730.755286539943063
430.2439744738468690.4879489476937390.75602552615313
440.2080684380716160.4161368761432320.791931561928384
450.1731295247408680.3462590494817370.826870475259132
460.1516488136185840.3032976272371670.848351186381416
470.1583846375761890.3167692751523770.841615362423811
480.2590579830664650.518115966132930.740942016933535
490.2429757833422140.4859515666844280.757024216657786
500.2148409012068930.4296818024137870.785159098793107
510.1816944151220130.3633888302440260.818305584877987
520.1482986211536260.2965972423072510.851701378846374
530.2121029651868040.4242059303736080.787897034813196
540.2046433136957150.409286627391430.795356686304285
550.1872056526830210.3744113053660430.812794347316979
560.2798109225848990.5596218451697990.7201890774151
570.2414022484016400.4828044968032800.75859775159836
580.2092396217707750.4184792435415490.790760378229225
590.1951271177351410.3902542354702810.80487288226486
600.2085960301245090.4171920602490170.791403969875491
610.2595876484504180.5191752969008370.740412351549582
620.2974081852942350.594816370588470.702591814705765
630.2553414305770980.5106828611541950.744658569422902
640.2168113134630580.4336226269261160.783188686536942
650.182770896272030.365541792544060.81722910372797
660.1704066738499620.3408133476999240.829593326150038
670.1462335250473820.2924670500947640.853766474952618
680.1224404944081830.2448809888163660.877559505591817
690.1314071430552250.2628142861104510.868592856944775
700.1065068826163670.2130137652327340.893493117383633
710.08521511601751080.1704302320350220.914784883982489
720.0915782888547660.1831565777095320.908421711145234
730.07266564656141450.1453312931228290.927334353438586
740.07298037838491860.1459607567698370.927019621615081
750.06020302347687550.1204060469537510.939796976523125
760.04826574808179110.09653149616358220.95173425191821
770.04192889282218530.08385778564437050.958071107177815
780.03234286149404210.06468572298808430.967657138505958
790.02456126063671600.04912252127343210.975438739363284
800.01872880996654330.03745761993308670.981271190033457
810.01458481194177640.02916962388355280.985415188058224
820.07723045767693320.1544609153538660.922769542323067
830.06179378552698830.1235875710539770.938206214473012
840.04958236561099090.09916473122198170.95041763438901
850.03951006032199330.07902012064398660.960489939678007
860.040453400239240.080906800478480.95954659976076
870.03380602643020430.06761205286040860.966193973569796
880.02529067089354000.05058134178708010.97470932910646
890.02184436262541980.04368872525083970.97815563737458
900.01711021760032640.03422043520065280.982889782399674
910.01400762393752920.02801524787505840.98599237606247
920.01354034075109750.02708068150219490.986459659248903
930.01943072272637640.03886144545275270.980569277273624
940.01564936285195520.03129872570391050.984350637148045
950.01225480177966040.02450960355932080.98774519822034
960.01278845728419350.02557691456838710.987211542715806
970.01131223229285640.02262446458571280.988687767707144
980.01789570004944740.03579140009889490.982104299950552
990.0202178402154090.0404356804308180.97978215978459
1000.01662351933674340.03324703867348670.983376480663257
1010.08264663511104620.1652932702220920.917353364888954
1020.07564854080849380.1512970816169880.924351459191506
1030.0620392089681170.1240784179362340.937960791031883
1040.06222811305003130.1244562261000630.937771886949969
1050.05084741924110140.1016948384822030.949152580758899
1060.0391488678128840.0782977356257680.960851132187116
1070.03333962819637460.06667925639274910.966660371803626
1080.02401551745519720.04803103491039450.975984482544803
1090.02232476416072050.04464952832144090.97767523583928
1100.03234146942549690.06468293885099380.967658530574503
1110.04323079648167760.08646159296335520.956769203518322
1120.03233701298296840.06467402596593670.967662987017032
1130.03164264599968550.0632852919993710.968357354000315
1140.05828248337040150.1165649667408030.941717516629599
1150.06003746294310440.1200749258862090.939962537056896
1160.09508091532778850.1901618306555770.904919084672211
1170.07326605719487470.1465321143897490.926733942805125
1180.06089459665887410.1217891933177480.939105403341126
1190.04420525888042920.08841051776085830.95579474111957
1200.05323289541165440.1064657908233090.946767104588346
1210.2177809617056280.4355619234112570.782219038294372
1220.2444192014128350.4888384028256710.755580798587165
1230.1898465513775900.3796931027551790.81015344862241
1240.1660343039381120.3320686078762250.833965696061888
1250.5811319003780310.8377361992439380.418868099621969
1260.8659211237662550.268157752467490.134078876233745
1270.85803508642070.2839298271586010.141964913579301
1280.7951455517234920.4097088965530170.204854448276508
1290.7327688946566020.5344622106867950.267231105343398
1300.710976262618150.5780474747636990.289023737381849
1310.7064989221703550.5870021556592910.293501077829645
1320.6132844378967280.7734311242065450.386715562103272
1330.7793676018636150.4412647962727690.220632398136385


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level170.139344262295082NOK
10% type I error level320.262295081967213NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/102t281290533239.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/102t281290533239.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/1302j1290533238.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/1302j1290533238.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/2302j1290533238.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/2302j1290533238.ps (open in new window)


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/9za0a1290533238.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533269bh6gjxoxafdux3p/9za0a1290533238.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