Home » date » 2010 » Dec » 09 »

Paper: Multiple Linear Regression

*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: Thu, 09 Dec 2010 12:18:23 +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/09/t1291897078qri95mbfnd3298p.htm/, Retrieved Thu, 09 Dec 2010 13:17:58 +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/09/t1291897078qri95mbfnd3298p.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 «
24 14 11 12 24 26 10 25 11 7 8 25 23 14 17 6 17 8 30 25 18 18 12 10 8 19 23 15 18 8 12 9 22 19 18 16 10 12 7 22 29 11 20 10 11 4 25 25 17 16 11 11 11 23 21 19 18 16 12 7 17 22 7 17 11 13 7 21 25 12 23 13 14 12 19 24 13 30 12 16 10 19 18 15 23 8 11 10 15 22 14 18 12 10 8 16 15 14 15 11 11 8 23 22 16 12 4 15 4 27 28 16 21 9 9 9 22 20 12 15 8 11 8 14 12 12 20 8 17 7 22 24 13 31 14 17 11 23 20 16 27 15 11 9 23 21 9 21 9 14 13 19 21 11 31 14 10 8 18 23 12 19 11 11 8 20 28 11 16 8 15 9 23 24 14 20 9 15 6 25 24 18 21 9 13 9 19 24 11 22 9 16 9 24 23 14 17 9 13 6 22 23 17 25 16 18 16 26 24 12 26 11 18 5 29 18 14 25 8 12 7 32 25 14 17 9 17 9 25 21 15 32 16 9 6 29 26 11 33 11 9 6 28 22 15 13 16 12 5 17 22 14 32 12 18 12 28 22 11 25 12 12 7 29 23 12 29 14 18 10 26 30 17 22 9 14 9 25 23 15 18 10 15 8 14 17 9 17 9 16 5 25 23 16 20 10 10 8 26 23 13 15 12 11 8 20 25 15 20 14 14 10 18 24 11 33 14 9 6 32 24 10 29 10 12 8 25 23 16 23 14 17 7 25 21 13 26 16 5 4 23 2 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
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
PS[t] = + 6.80689662687926 + 0.337375488932305CM[t] -0.374730059936113D[t] + 0.174440171909909PE[t] + 0.0466548470870712PC[t] + 0.420990395069853O[t] + 0.0111700079917464`H `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.806896626879263.0737862.21450.0282830.014141
CM0.3373754889323050.0569425.924900
D-0.3747300599361130.115686-3.23920.0014720.000736
PE0.1744401719099090.1013771.72070.087340.04367
PC0.04665484708707120.1281820.3640.7163840.358192
O0.4209903950698530.0732885.744300
`H `0.01117000799174640.1257350.08880.9293280.464664


Multiple Linear Regression - Regression Statistics
Multiple R0.613973533520472
R-squared0.376963499863614
Adjusted R-squared0.352369953805599
F-TEST (value)15.3277408216924
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value1.07580611086178e-13
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.42600565680683
Sum Squared Residuals1784.10224359181


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12423.19383792993650.806162070063475
22522.55273236944672.44726763055335
33024.35844129887465.64155870112544
41920.3508644107059-1.35086441070588
52220.59486828505301.40513171494695
62223.2090613878984-1.20906138789838
72522.62721709812752.37278290187246
82319.56794744777583.43205255222421
91718.6438192086904-1.64381920869035
102121.6733554165168-0.673355416516811
111922.9460422505056-3.94604225050558
121923.4343690281779-4.43436902817787
131523.3722515581343-8.37225155813431
141616.9717712421553-0.971771242155311
152319.47808778867693.52191221132312
162724.12615541114322.87384458885678
172221.06291452330350.937085476696502
181416.3476939858197-2.34769398581970
192224.0976123636836-2.09761236368359
202324.0965302143664-1.09653021436639
212321.57514781219511.42485218780491
221922.5315551582794-3.53155515827943
231823.9537756229784-5.95377562297838
242023.2976820748665-3.29768207486649
252322.50370976630040.496290233699556
262523.38319715279931.61680284720068
271923.4334667832308-4.4334667832308
282423.90668241679820.0933175832017823
292221.5900299391210.409970060879009
302623.3698131165582.63018688344198
312922.56403323277756.43596676722252
323225.34444935185726.65555064814283
332521.56343436189863.43656563810136
342924.52574230317224.47425769682777
352825.09748654347272.90251345652733
361716.94182212579690.0581778742030905
372826.19059159234891.80940840765113
382922.98120830598956.01879169401048
392627.7706385200149-1.77063852001489
402523.56897208097011.43102791902985
411419.3795629717581-5.37956297175806
422522.05552559977192.9444744002281
432621.75273549245924.24726450754078
442020.3551589059586-0.355158905958581
451821.4435360136149-3.44353601361491
463224.75942711384537.2405728861547
472525.1715052606450-0.171505260645027
482521.59838728565433.40161271434573
492320.84609818164142.15390181835858
502122.2337553214121-1.23375532141214
512024.2400778356035-4.24007783560355
521516.4063035063195-1.40630350631953
533026.95141891835573.04858108164434
542425.5276209604837-1.52762096048365
552624.47149840241481.52850159758519
562421.70703976790542.29296023209459
572221.59527384806390.404726151936135
581415.4647300334008-1.46473003340083
592422.37519508262851.62480491737149
602422.94111219801701.05888780198303
612423.39961768357300.60038231642697
622420.10606925709863.89393074290138
631918.45813626575190.541863734248147
643127.01340286125653.98659713874353
652226.8534365895336-4.85343658953355
662721.44908977306965.55091022693044
671917.67725603835281.32274396164716
682522.41676641055622.58323358944378
692025.115944649428-5.11594464942802
702121.5913350604495-0.591335060449544
712727.7165573575398-0.716557357539801
722324.4732905256934-1.47329052569339
732525.783760449496-0.783760449496022
742022.3164415449032-2.31644154490324
752222.4948867833241-0.494886783324118
762323.1806722460821-0.180672246082066
772524.04134973850030.958650261499702
782523.55536350170321.44463649829678
791724.0589961434255-7.05899614342552
801921.4206409661957-2.42064096619568
812524.09664675701010.903353242989863
821922.4163783827431-3.41637838274308
832023.1586975168811-3.15869751688114
842622.59025703907713.40974296092294
852320.96312003852942.03687996147056
862724.59668899496572.40331100503428
871720.8979447261035-3.89794472610345
881723.4526693089768-6.45266930897682
891719.7140987636228-2.71409876362277
902221.96574646647320.0342535335268300
912123.7753115338017-2.77531153380173
923228.87697836724843.12302163275159
932124.8242218519478-3.82422185194781
942124.4050846865295-3.40508468652948
951821.2391647620643-3.23916476206433
961821.2445053897907-3.24450538979066
972322.91073173882360.0892682611763867
981920.6259781030955-1.62597810309550
992020.8661440442532-0.866144044253181
1002122.4278148330794-1.42781483307941
1012024.0931439799901-4.0931439799901
1021718.5960751594744-1.59607515947442
1031820.3004839077328-2.30048390773280
1041920.7480145734531-1.74801457345310
1052222.1332173240308-0.133217324030845
1061518.6776186614073-3.67761866140732
1071418.8035111382256-4.80351113822563
1081826.8777903546510-8.87779035465097
1092421.54212428540552.4578757145945
1103523.606856687025711.3931433129743
1112919.33160955138979.66839044861029
1122121.9570400261406-0.957040026140595
1132018.43650753534621.56349246465377
1142223.2805387990828-1.28053879908277
1151316.6661117736317-3.66611177363172
1162623.29462454175772.70537545824226
1171716.73138524615650.268614753843451
1182520.05998986321734.94001013678267
1192020.8885685919793-0.888568591979344
1201918.12567501139040.874324988609644
1212122.6102566438842-1.61025664388422
1222221.09436920635850.905630793641523
1232422.83775680562611.16224319437393
1242123.0965412425226-2.09654124252263
1252625.67845758686780.321542413132153
1262420.61108949202943.38891050797060
1271620.3072031663297-4.30720316632972
1282322.44629592543190.553704074568086
1291820.7804640883523-2.78046408835229
1301622.4501613332031-6.45016133320309
1312624.05834925645631.94165074354365
1321918.95756380721410.0424361927858609
1332116.69976581483244.30023418516759
1342122.3289347474948-1.32893474749477
1352218.51752770921183.48247229078815
1362319.73321127756983.2667887224302
1372924.95506044453914.04493955546088
1382119.09895262034421.90104737965575
1392119.91831597983111.08168402016885
1402321.92831616712741.07168383287259
1412723.05402541403073.94597458596934
1422525.4223704008277-0.422370400827714
1432121.0146197079921-0.0146197079921077
1441016.9635948368745-6.96359483687447
1452022.7162157947920-2.71621579479203
1462622.74405034414523.25594965585483
1472423.71567050279730.284329497202718
1482931.8824036716209-2.88240367162089
1491918.80928320193230.190716798067704
1502422.10388020983971.89611979016026
1511920.6921991090226-1.69219910902255
1522423.54824973115300.451750268847024
1532221.85898645716110.141013542838923
1541723.9180546657576-6.91805466575759
1552423.19383792993650.806162070063492
1562522.55273236944672.44726763055334
1573024.35844129887465.64155870112544
1581920.3508644107059-1.35086441070588
1592220.59486828505301.40513171494695


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.1520815625600960.3041631251201920.847918437439904
110.4523373569917050.904674713983410.547662643008295
120.3882135200768020.7764270401536040.611786479923198
130.727745224959590.544509550080820.27225477504041
140.6394251704595960.7211496590808090.360574829540404
150.5469430984595250.906113803080950.453056901540475
160.4502752858770950.900550571754190.549724714122905
170.4917278303228840.9834556606457690.508272169677116
180.4027364916038640.8054729832077270.597263508396136
190.319511209266560.639022418533120.68048879073344
200.2630236302950690.5260472605901390.73697636970493
210.3280720282252210.6561440564504420.671927971774779
220.2671821302687750.534364260537550.732817869731225
230.3100980167628450.620196033525690.689901983237155
240.2971193192902630.5942386385805250.702880680709737
250.2367449352460650.4734898704921310.763255064753935
260.1862335488547650.372467097709530.813766451145235
270.1639662969633110.3279325939266210.83603370303669
280.133167677360550.26633535472110.86683232263945
290.1075384253306000.2150768506612010.8924615746694
300.1093538981889900.2187077963779790.89064610181101
310.2627544055958230.5255088111916460.737245594404177
320.5436676334900330.9126647330199340.456332366509967
330.516866542906750.96626691418650.48313345709325
340.5618552107977460.8762895784045070.438144789202254
350.5314685752111320.9370628495777350.468531424788868
360.507283411067720.985433177864560.49271658893228
370.4801472489134960.9602944978269910.519852751086504
380.580055828923480.839888342153040.41994417107652
390.606866947595260.786266104809480.39313305240474
400.557665975877920.884668048244160.44233402412208
410.5977367034949420.8045265930101160.402263296505058
420.5657127830346640.8685744339306720.434287216965336
430.5952435692315360.8095128615369280.404756430768464
440.5469104051729550.906179189654090.453089594827045
450.534308113997380.931383772005240.46569188600262
460.6551200658295470.6897598683409060.344879934170453
470.6235922891970420.7528154216059160.376407710802958
480.6092127129334530.7815745741330940.390787287066547
490.5652424772533690.8695150454932610.434757522746631
500.5226650170796570.9546699658406870.477334982920343
510.5829392174832580.8341215650334840.417060782516742
520.54521833941140.90956332117720.4547816605886
530.5954034378306610.8091931243386780.404596562169339
540.5655629782227280.8688740435545450.434437021777272
550.5229850565357330.9540298869285340.477014943464267
560.4903150716545910.9806301433091820.509684928345409
570.4417263260627570.8834526521255140.558273673937243
580.4018857334396740.8037714668793480.598114266560326
590.3672981373420210.7345962746840420.632701862657979
600.3258957289277860.6517914578555720.674104271072214
610.2842621936652790.5685243873305590.715737806334721
620.2997245577710750.5994491155421510.700275442228924
630.2614289016302550.5228578032605090.738571098369745
640.2658044012300590.5316088024601170.734195598769941
650.3603213772244980.7206427544489970.639678622775501
660.4488957219230450.897791443846090.551104278076955
670.41100769695510.82201539391020.5889923030449
680.389890735766870.779781471533740.61010926423313
690.471999191817480.943998383634960.52800080818252
700.4263563017383420.8527126034766840.573643698261658
710.3874187028015050.774837405603010.612581297198495
720.3573655328046490.7147310656092980.642634467195351
730.3248193248129490.6496386496258990.67518067518705
740.3046966652795710.6093933305591410.69530333472043
750.2657004963028740.5314009926057480.734299503697126
760.2291151170378780.4582302340757570.770884882962122
770.2004360824020630.4008721648041260.799563917597937
780.1755483686172160.3510967372344320.824451631382784
790.287626527636520.575253055273040.71237347236348
800.2659432735463820.5318865470927640.734056726453618
810.2318779334611330.4637558669222650.768122066538867
820.2305956328408870.4611912656817730.769404367159113
830.2292404372039190.4584808744078380.770759562796081
840.230780344412660.461560688825320.76921965558734
850.2099830136352300.4199660272704610.79001698636477
860.195102568498850.39020513699770.80489743150115
870.2022171593747120.4044343187494230.797782840625288
880.2997437417164080.5994874834328160.700256258283592
890.2797994671960030.5595989343920070.720200532803997
900.2433377486335610.4866754972671210.75666225136644
910.2309674559115600.4619349118231210.76903254408844
920.2256494702803270.4512989405606530.774350529719673
930.2327714863076080.4655429726152160.767228513692392
940.2290872135116680.4581744270233360.770912786488332
950.2198686140624280.4397372281248570.780131385937572
960.2127455076827680.4254910153655350.787254492317232
970.1795864399671650.3591728799343310.820413560032835
980.1541992921764120.3083985843528240.845800707823588
990.1278779357196180.2557558714392360.872122064280382
1000.1074065611647530.2148131223295060.892593438835247
1010.1195298315731430.2390596631462860.880470168426857
1020.09937959679379330.1987591935875870.900620403206207
1030.08812409182382020.1762481836476400.91187590817618
1040.07669568924810510.1533913784962100.923304310751895
1050.06079581389543480.1215916277908700.939204186104565
1060.06000192376392920.1200038475278580.93999807623607
1070.07582065502316960.1516413100463390.92417934497683
1080.2711280289565330.5422560579130660.728871971043467
1090.2506847711834850.501369542366970.749315228816515
1100.697817075758570.604365848482860.30218292424143
1110.9065478860233990.1869042279532020.093452113976601
1120.8832255745035020.2335488509929960.116774425496498
1130.859986546582640.2800269068347190.140013453417360
1140.8334168780704450.333166243859110.166583121929555
1150.8575977352148860.2848045295702280.142402264785114
1160.8399596233865840.3200807532268330.160040376613416
1170.8041966959467710.3916066081064580.195803304053229
1180.8469112020718090.3061775958563820.153088797928191
1190.8125251990218540.3749496019562910.187474800978146
1200.7761410836737040.4477178326525920.223858916326296
1210.7364946299086170.5270107401827650.263505370091383
1220.6885848297340650.6228303405318690.311415170265935
1230.6396427441955980.7207145116088040.360357255804402
1240.5951796185301440.8096407629397110.404820381469856
1250.5374644087857640.9250711824284730.462535591214236
1260.5345498187563060.9309003624873870.465450181243694
1270.5708297550779690.8583404898440630.429170244922031
1280.5081152286853120.9837695426293750.491884771314688
1290.4681870173045230.9363740346090460.531812982695477
1300.644059237891450.71188152421710.35594076210855
1310.6151487684366420.7697024631267170.384851231563358
1320.5528443785934970.8943112428130060.447155621406503
1330.563906793292170.872186413415660.43609320670783
1340.5210908314142620.9578183371714750.478909168585738
1350.5053706766942880.9892586466114230.494629323305712
1360.510680011728290.978639976543420.48931998827171
1370.548340475253240.9033190494935210.451659524746761
1380.8037433221590.3925133556820.196256677841
1390.7405440289730540.5189119420538920.259455971026946
1400.6776863893827950.644627221234410.322313610617205
1410.7202883367623350.559423326475330.279711663237665
1420.7209245842069790.5581508315860420.279075415793021
1430.6309047411419860.7381905177160270.369095258858014
1440.7630770860737380.4738458278525230.236922913926262
1450.7488315768028360.5023368463943280.251168423197164
1460.6435136873014710.7129726253970580.356486312698529
1470.6397449928162210.7205100143675580.360255007183779
1480.5912196178871850.817560764225630.408780382112815
1490.5097170230912220.9805659538175570.490282976908778


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 level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/10ei9x1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/10ei9x1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/17ycl1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/17ycl1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/27ycl1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/27ycl1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/37ycl1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/37ycl1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/4iqto1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/4iqto1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/5iqto1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/5iqto1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/6sza81291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/6sza81291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/7sza81291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/7sza81291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/8lqrb1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/8lqrb1291897092.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/9lqrb1291897092.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291897078qri95mbfnd3298p/9lqrb1291897092.ps (open in new window)


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