Home » date » 2010 » Dec » 12 »

WS10

*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: Sun, 12 Dec 2010 16:35:27 +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/12/t1292171632yug4exq4lqkhl6y.htm/, Retrieved Sun, 12 Dec 2010 17:33: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/12/t1292171632yug4exq4lqkhl6y.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 «
10 11 16 1 24 14 33 12 24 14 11 13 2 25 11 30 8 25 18 15 16 2 17 6 30 8 30 15 9 15 1 18 12 26 8 19 11 17 15 2 16 10 24 7 22 17 16 14 2 20 10 28 4 25 19 9 11 2 16 11 24 11 23 7 12 15 2 18 16 27 7 17 12 14 13 2 17 11 28 7 21 15 4 6 2 30 12 42 10 19 14 13 11 2 23 8 31 10 15 14 12 9 2 18 12 25 8 16 16 13 14 1 12 4 23 4 27 12 15 5 2 21 9 27 9 22 12 10 8 1 15 8 23 8 14 13 9 6 1 20 8 34 7 22 9 11 15 2 27 15 36 9 23 11 15 12 2 21 9 31 13 19 12 10 10 1 31 14 39 8 18 11 9 8 1 19 11 27 8 20 14 15 16 2 16 8 27 9 23 18 12 8 2 20 9 31 6 25 11 12 12 1 21 9 31 9 19 17 14 14 2 17 9 26 6 22 14 16 13 1 22 9 34 9 24 14 5 8 2 26 11 39 5 29 12 10 11 2 25 16 39 16 26 14 9 12 2 25 8 35 7 32 15 14 13 2 17 9 30 9 25 10 5 4 1 33 14 40 6 32 11 12 16 1 32 16 38 6 29 14 14 17 1 13 16 21 5 17 11 16 14 2 32 12 45 12 28 15 11 8 2 22 9 32 9 25 16 6 6 2 17 9 29 5 25 15 11 15 1 33 11 40 6 28 16 9 11 2 31 14 44 11 23 13 16 16 1 20 10 28 8 26 15 13 5 1 15 12 24 8 20 16 10 5 2 29 10 37 8 25 13 6 9 1 23 13 33 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 time7 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Happiness[t] = + 15.8129739767573 -0.067519832546916Popularity[t] + 0.0891906979933913KnowPeople[t] + 0.620779773881064Gender[t] -0.14400699076612CMistakes[t] -0.257376073460273DAction[t] + 0.122065094451775PExpectations[t] -0.117312080212603PCriticism[t] + 0.00324282956475924PStandards[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)15.81297397675731.6698529.469700
Popularity-0.0675198325469160.077834-0.86750.3872150.193607
KnowPeople0.08919069799339130.066211.34710.1802060.090103
Gender0.6207797738810640.4107951.51120.1330830.066542
CMistakes-0.144006990766120.100025-1.43970.1522640.076132
DAction-0.2573760734602730.078485-3.27930.0013240.000662
PExpectations0.1220650944517750.0833531.46440.14540.0727
PCriticism-0.1173120802126030.088174-1.33050.1856070.092804
PStandards0.003242829564759240.05250.06180.9508390.475419


Multiple Linear Regression - Regression Statistics
Multiple R0.39521657780064
R-squared0.156196143368449
Adjusted R-squared0.106192951864358
F-TEST (value)3.12372347984363
F-TEST (DF numerator)8
F-TEST (DF denominator)135
p-value0.00285720771111464
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.22343763349311
Sum Squared Residuals667.396112854517


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11012.7568850175974-2.75688501759745
21413.84450979417290.155490205827120
31816.29715299921951.70284700078049
41513.78010658807931.21989341192066
51114.5464042100412-3.54640421004119
61714.79863048866942.20136951133057
71914.00641851369704.99358148630297
8713.4017140860134-6.40171408601343
91214.6542167957111-2.65421679571111
101513.92610270436421.07389729563578
111414.4462435733843-0.446243573384301
121413.53138909321330.468610906786741
131616.4728827661904-0.472882766190354
141213.4584491377609-1.45844913776091
151214.1673677045390-2.16736770453902
161314.8224419429688-1.82244194296875
17913.3139657421549-4.31396574215486
181114.0920675919771-3.09206759197706
191212.4633936369937-0.463393636993678
201113.3944487088363-2.39444870883629
211415.4202006725438-1.42020067254384
221814.92251282728713.07748717271286
231114.1430956365872-3.14309563658715
241715.13458436149891.86541563850114
251414.2006094448059-0.20060944480588
261415.1231617176841-1.12316171768412
271212.6100999013616-0.610099901361558
281415.4128243410789-1.41282434107893
291515.1914462893690-0.191446289369035
301012.3799234990193-2.37992349901928
311112.3529692133593-1.35296921335931
321413.04654459057050.95345540942953
331113.7021329052291-2.70213290522907
341514.47214753211580.527852467884224
351615.45445329018930.545546709810738
361513.71505908378691.28494091621313
371613.51548732085992.48451267914009
381313.8902266194895-0.890226619489494
391512.80925389091732.19074610908266
401613.73430781433092.26569218566912
411312.85531821078090.144681789219117
42911.6529413034380-2.65294130343796
431414.0644107743148-0.0644107743147942
441515.5161267068968-0.516126706896842
451413.83433396581840.165666034181566
461614.73567960488561.26432039511445
471313.4577413726532-0.45774137265324
481712.78508524389224.21491475610781
491613.65661541155532.34338458844467
501514.70005954414450.299940455855537
511613.66389510329452.33610489670551
521514.35793893310820.642061066891804
531314.3405534133744-1.34055341337439
541114.5464042100412-3.5464042100412
551613.00781729214442.99218270785565
561714.57392168141132.42607831858873
571014.2674664006857-4.26746640068571
581713.8880889671283.11191103287199
591114.4219320801474-3.4219320801474
601413.31678608870020.683213911299754
611514.37495982100480.62504017899521
621112.9540994051834-1.95409940518335
631514.35008904897670.649910951023294
641614.17926188664861.82073811335139
651615.09432166870610.90567833129387
661513.46489462916561.53510537083444
671415.1259533759282-1.12595337592815
681714.71570288304302.28429711695704
691213.731396348594-1.73139634859401
701313.5615852146398-0.561585214639848
711213.0922558621654-1.09225586216544
72914.4315415747077-5.43154157470775
731715.57938711541151.42061288458853
741113.3149125728471-2.31491257284713
751614.63265341291551.36734658708449
761414.7112527896454-0.711252789645417
77912.7958266559079-3.7958266559079
781514.24287309744650.757126902553537
791714.79863048866942.20136951133057
801712.30600127232124.69399872767878
811514.0331695263920.966830473608008
821813.19493137153174.80506862846828
831313.9671527784902-0.967152778490243
841514.93364182838890.0663581716110736
851213.2789398461791-1.27893984617910
861613.72366849199682.27633150800317
871715.19898670513911.80101329486089
881313.7778618697625-0.777861869762505
891512.35098914180842.64901085819162
901214.1283816040723-2.1283816040723
911114.5311068587945-3.53110685879453
921514.36697107723010.633028922769895
931514.93017960958640.0698203904135882
941815.02902497406312.97097502593685
951612.49747376799873.50252623200135
961213.6382270909777-1.63822709097771
971614.44048404146671.55951595853335
981514.61110480156350.388895198436529
991513.52884900545561.47115099454436
1001715.39529684122831.60470315877167
1011614.99588271067761.00411728932239
1021315.2872315400232-2.28723154002325
1031313.4244581860286-0.424458186028593
1041312.64313650762890.356863492371148
1051613.85296456593022.14703543406976
1061113.2510894948278-2.25108949482776
1071514.5087899445920.491210055408002
1081514.84070396164590.159296038354094
109914.1642409444759-5.16424094447593
1101411.10220640377092.89779359622905
1111414.0535949468925-0.0535949468924951
1121514.13628309734090.8637169026591
1131414.7225466449787-0.722546644978747
1141513.28795538164391.71204461835614
1151414.1288391303254-0.128839130325372
1161313.3082203413268-0.308220341326841
1171514.92662322165340.0733767783465921
1181614.74949933667271.25050066332734
1191414.0850010888461-0.0850010888460854
1201414.2438309804088-0.243830980408849
1211413.85280274571480.147197254285215
1221513.78010658807931.21989341192066
1231514.79088013622290.209119863777135
1241313.1283370574974-0.128337057497380
1251513.21553697066811.78446302933189
1261614.50237148277661.49762851722342
1271012.7823617273212-2.78236172732121
128812.5559456377475-4.55594563774745
1291413.03382521363120.966174786368766
1301212.8948242180844-0.89482421808436
1311315.0496665663129-2.04966656631293
1321514.71778434109430.28221565890569
1331414.8877475731738-0.88774757317379
1341512.97297581954972.0270241804503
1351914.86537604310024.13462395689978
1361715.52850346774491.47149653225507
1371614.77589601655931.22410398344071
1381712.96458291210614.03541708789390
1391315.5175042474868-2.51750424748675
1401614.88880302094341.11119697905656
1411414.6959285530744-0.695928553074447
1421213.5282913549783-1.52829135497834
1431213.4584491377609-1.45844913776091
1441312.83541202654440.164587973455570


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.5658294801295990.8683410397408020.434170519870401
130.9170362820559670.1659274358880660.0829637179440328
140.902791338265530.1944173234689390.0972086617344695
150.8595268495218430.2809463009563140.140473150478157
160.7926633718157690.4146732563684620.207336628184231
170.7955702654672860.4088594690654290.204429734532714
180.7397665828140410.5204668343719170.260233417185959
190.8308065579237430.3383868841525150.169193442076257
200.8157515119936850.368496976012630.184248488006315
210.756861569273690.4862768614526190.243138430726309
220.7851334104882940.4297331790234110.214866589511706
230.7458634405308450.508273118938310.254136559469155
240.7347734812161940.5304530375676110.265226518783806
250.8059430234313370.3881139531373270.194056976568664
260.8559345152120320.2881309695759360.144065484787968
270.831540725349160.336918549301680.16845927465084
280.8774091777899860.2451816444200280.122590822210014
290.8410264852653990.3179470294692020.158973514734601
300.8315864809618650.3368270380762690.168413519038135
310.8136974996146830.3726050007706350.186302500385317
320.8491713180082310.3016573639835380.150828681991769
330.8271731510728580.3456536978542840.172826848927142
340.7873004628645690.4253990742708620.212699537135431
350.7441082422662480.5117835154675040.255891757733752
360.7431965865798660.5136068268402680.256803413420134
370.8087861338756290.3824277322487420.191213866124371
380.7701086573254180.4597826853491640.229891342674582
390.8020988910181220.3958022179637550.197901108981878
400.7985796837662570.4028406324674870.201420316233743
410.7609138745416570.4781722509166870.239086125458343
420.7559781457270550.4880437085458890.244021854272945
430.7149643752450590.5700712495098830.285035624754941
440.6676454645087430.6647090709825140.332354535491257
450.6156442145859450.768711570828110.384355785414055
460.6062508277958880.7874983444082240.393749172204112
470.5543648977840230.8912702044319550.445635102215977
480.7208512933793710.5582974132412580.279148706620629
490.7363529668873330.5272940662253340.263647033112667
500.6921328807181940.6157342385636110.307867119281806
510.707293350991690.585413298016620.29270664900831
520.6649976802045480.6700046395909050.335002319795452
530.6256196010191110.7487607979617780.374380398980889
540.6804761004465380.6390477991069240.319523899553462
550.7133233207957960.5733533584084080.286676679204204
560.722404113808340.555191772383320.27759588619166
570.8165181740954110.3669636518091780.183481825904589
580.8527503176402390.2944993647195220.147249682359761
590.8949761728300070.2100476543399870.105023827169993
600.871616781762320.2567664364753600.128383218237680
610.8461918986254650.307616202749070.153808101374535
620.8363332401782180.3273335196435650.163666759821782
630.8055799172642150.388840165471570.194420082735785
640.7951409726182660.4097180547634680.204859027381734
650.7695638855371390.4608722289257220.230436114462861
660.7542239322461080.4915521355077840.245776067753892
670.7220689277523930.5558621444952130.277931072247607
680.7262560122993560.5474879754012890.273743987700644
690.7068612906854840.5862774186290310.293138709314516
700.6640359045025830.6719281909948330.335964095497417
710.6311233619377380.7377532761245240.368876638062262
720.8337101128729620.3325797742540770.166289887127038
730.8156511489215860.3686977021568280.184348851078414
740.820299915039540.3594001699209190.179700084960460
750.8021654760997490.3956690478005020.197834523900251
760.7738033339139990.4523933321720030.226196666086001
770.8581449166011120.2837101667977750.141855083398888
780.831889594268660.3362208114626810.168110405731340
790.8303290937034520.3393418125930960.169670906296548
800.9213213919197970.1573572161604060.0786786080802028
810.905746541015220.1885069179695610.0942534589847803
820.9585278085445380.08294438291092330.0414721914554617
830.9490149490500390.1019701018999220.0509850509499612
840.9338738087761890.1322523824476230.0661261912238114
850.922884440944430.1542311181111400.0771155590555699
860.9286934502862460.1426130994275070.0713065497137536
870.9180941148997310.1638117702005370.0819058851002685
880.8998924376479580.2002151247040850.100107562352042
890.9070189544821570.1859620910356860.0929810455178432
900.9050980424299220.1898039151401550.0949019575700776
910.9410060800270360.1179878399459280.0589939199729639
920.9241351424228020.1517297151543960.075864857577198
930.9037719435797310.1924561128405370.0962280564202686
940.936054034464120.1278919310717590.0639459655358797
950.9580538428596720.08389231428065690.0419461571403285
960.9647916402619430.07041671947611430.0352083597380572
970.9605598073273720.07888038534525620.0394401926726281
980.946859502802660.1062809943946780.0531404971973392
990.9388058409250910.1223883181498180.0611941590749089
1000.935419915020810.1291601699583790.0645800849791896
1010.9296281014415140.1407437971169710.0703718985584857
1020.9263620649843720.1472758700312550.0736379350156276
1030.9099013738919360.1801972522161270.0900986261080637
1040.8848568224874810.2302863550250370.115143177512519
1050.8959608477399570.2080783045200850.104039152260043
1060.9180339102317930.1639321795364140.0819660897682071
1070.8926370714466880.2147258571066240.107362928553312
1080.8630092251366840.2739815497266320.136990774863316
1090.920980222046960.1580395559060780.0790197779530392
1100.9350788178114490.1298423643771020.0649211821885512
1110.9226477653188250.1547044693623510.0773522346811753
1120.8957370179007740.2085259641984520.104262982099226
1130.8677124223404770.2645751553190470.132287577659523
1140.8331037781906380.3337924436187240.166896221809362
1150.8292606011780770.3414787976438460.170739398821923
1160.7806274887092060.4387450225815880.219372511290794
1170.7219828829527820.5560342340944370.278017117047218
1180.6907937727085730.6184124545828530.309206227291426
1190.6998796972848930.6002406054302140.300120302715107
1200.6278827583622370.7442344832755260.372117241637763
1210.5486571326125490.9026857347749020.451342867387451
1220.6741180994207310.6517638011585370.325881900579269
1230.5949558087828760.8100883824342490.405044191217124
1240.5343366089021790.9313267821956420.465663391097821
1250.4539095945303650.907819189060730.546090405469635
1260.3628514581208920.7257029162417850.637148541879108
1270.2848850784216940.5697701568433880.715114921578306
1280.3533157568974450.706631513794890.646684243102555
1290.5066093848001810.9867812303996370.493390615199819
1300.4735244522648060.9470489045296120.526475547735194
1310.6019638556195940.7960722887608130.398036144380406
1320.4522110605337230.9044221210674460.547788939466277


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level00OK
10% type I error level40.0330578512396694OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/10r2iv1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/10r2iv1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/121311292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/121311292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/221311292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/221311292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/3vakm1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/3vakm1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/4vakm1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/4vakm1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/5vakm1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/5vakm1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/6njjp1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/6njjp1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/7gbja1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/7gbja1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/8gbja1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/8gbja1292171716.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/9gbja1292171716.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292171632yug4exq4lqkhl6y/9gbja1292171716.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