Home » date » 2010 » Dec » 09 »

Paper: Multiple Linear Regression (Linear Trend)

*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:38:52 +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/t1291898217tn31igw1jnra9y2.htm/, Retrieved Thu, 09 Dec 2010 13:37:22 +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/t1291898217tn31igw1jnra9y2.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 time10 seconds
R Server'George Udny Yule' @ 72.249.76.132
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.96722882487706 + 0.338739169615999CM[t] -0.370733791378405D[t] + 0.173454693435831PE[t] + 0.048155789305374PC[t] + 0.414415238664376O[t] + 0.0195267114176807`H `[t] -0.00254732860272504t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.967228824877063.1065572.24270.0263690.013185
CM0.3387391696159990.0571935.922800
D-0.3707337913784050.116406-3.18480.001760.00088
PE0.1734546934358310.1016831.70580.0900950.045047
PC0.0481557893053740.1285850.37450.7085530.354276
O0.4144152386643760.0751935.511300
`H `0.01952671141768070.1276920.15290.8786660.439333
t-0.002547328602725040.006168-0.4130.6801820.340091


Multiple Linear Regression - Regression Statistics
Multiple R0.614545793502647
R-squared0.377666532311799
Adjusted R-squared0.348816636458703
F-TEST (value)13.0907416177475
F-TEST (DF numerator)7
F-TEST (DF denominator)151
p-value4.10338429901458e-13
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.4353914418521
Sum Squared Residuals1782.08906817135


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12423.36008290666970.6399170933303
22522.75689532053112.24310467946888
33024.53958784925025.46041215074979
41920.5497834763604-1.54978347636043
52220.82615566904391.1738443309561
62223.3158162465616-1.31581624656163
72522.80980284891952.19019715108048
82319.80004804378993.19995195621013
91718.7822363353937-1.78223633539366
102121.8089527605843-0.80895276058432
111923.1167179796368-4.11671797963679
121923.6592384288345-4.65923842883448
131523.5393128544941-8.53931285449405
141617.1894615696005-1.18946156960050
152319.654845310453.34515468955
162724.21890406115622.7810959388438
172221.21796233313160.782037666868405
181416.5371454664626-2.53714546646256
192224.2133759326396-2.21337593263964
202324.3060990583595-1.30609905835951
212321.71854977942931.28145022057074
221922.6600108417653-3.66001084176532
231824.1049457209068-6.1049457209068
242023.3757339063873-3.37573390638733
252322.61206418571610.387935814283944
262523.52737922195351.47262077804648
271923.5244420640875-4.52444206408749
282424.0251628809969-0.0251628809969272
292221.72266839034360.277331609656368
302623.50051092082892.49948907917106
312922.71322002722426.28677997277577
323225.44062499178716.5593750082129
332521.68288131742813.31711868257193
342924.62814942566494.37185057433512
352825.23845611458342.7615438854166
361717.0601380163531-0.0601380163531021
372826.29580862746751.70419137253245
382923.07452195449305.92547804550697
392627.8691994778676-1.86919947786763
402523.66721226231021.33278773768976
411419.4606216675032-5.46062166750324
422522.14223469809262.85776530190735
432621.83033016000764.16966983999239
442020.433957994168-0.433957994168018
451821.5077925054716-3.50779250547162
463224.82943104605867.17056895394144
472525.2742828932654-0.274282893265404
482521.68807244774513.31192755225495
492320.89949022640982.10050977359018
502122.2866056488887-1.28660564888866
512024.2875172456324-4.28751724563239
521516.4933916627726-1.49339166277261
533027.03875398885582.96124601114416
542425.5559440077963-1.55594400779633
552624.50133760895381.49866239104625
562421.76413705280222.23586294719776
572221.59509795540490.404902044595074
581415.5840538002886-1.58405380028861
592422.40703826123561.59296173876444
602422.96423248373841.03576751626160
612423.38295724771020.617042752289785
622420.16649297853973.83350702146025
631918.49908606298350.500913937016457
643126.97915946956164.02084053043840
652226.9078641570514-4.90786415705139
662721.45621640405075.54378359594928
671917.68290764376671.31709235623332
682522.4372517471612.56274825283898
692025.1583990491765-5.15839904917651
702121.6109898495906-0.610989849590591
712727.7343855534004-0.734385553400403
722324.5225995384187-1.52259953841868
732525.7763981883151-0.776398188315096
742022.3637662373848-2.36376623738476
752222.482950321875-0.482950321874988
762323.1330262843134-0.133026284313445
772524.01443097042620.98556902957381
782523.52926590440471.47073409559533
791724.0388904116908-7.03889041169081
801921.4002460073737-2.40024600737372
812524.0850343680040.914965631995982
821922.3524440420347-3.35244404203470
832023.1424834269455-3.14248342694555
842622.58613826676673.41386173323331
852320.93785492932072.06214507067932
862724.58496175062682.41503824937321
871720.8884850749446-3.88848507494460
881723.4710677945635-6.47106779456346
891719.6695405130879-2.66954051308790
902221.95485365032220.0451463496778307
912123.7260603697963-2.72606036979633
923228.85361927092963.14638072907044
932124.8145503105897-3.81455031058973
942124.3882977810568-3.38829778105680
951821.1802601032482-3.18026010324816
961821.1964497861098-3.19644978610981
972322.88279991560500.117200084395035
981920.5695533666805-1.56955336668047
992020.8539641213514-0.853964121351367
1002122.395925037391-1.39592503739102
1012024.0307052826698-4.03070528266981
1021718.5849371598002-1.58493715980023
1031820.2816301091783-2.28163010917832
1041920.7410407575224-1.74104075752237
1052222.1051202498069-0.105120249806918
1061518.6315165374418-3.63151653744184
1071418.7567940134575-4.75679401345753
1081826.8029547198515-8.8029547198515
1092421.47018018308772.52981981691228
1103523.569749983509811.4302500164902
1112919.21147409580449.7885259041956
1122121.8313873417681-0.831387341768137
1132018.37669205372171.62330794627827
1142223.1900750069294-1.19007500692941
1151316.6510839127491-3.65108391274912
1162623.21441814239862.78558185760142
1171716.67555938408260.324440615917431
1182519.97539545268825.02460454731181
1192020.7622584686874-0.762258468687355
1201918.04140078676710.958599213232875
1212122.4946143030851-1.49461430308515
1222220.97676186218271.02323813781726
1232422.71156391267551.28843608732448
1242122.9512651944144-1.95126519441439
1252625.58346184767850.416538152321532
1262420.51840168873683.48159831126324
1271620.1892640026714-4.18926400267138
1282322.29913668707230.700863312927737
1291820.6121662423911-2.61216624239106
1301622.3138878394759-6.31388783947587
1312623.92331544941562.07668455058441
1321918.84081700468330.159182995316669
1332116.62601885816034.37398114183967
1342122.1723071687452-1.17230716874521
1352218.43361931773723.56638068226279
1362319.68190250132613.31809749867393
1372924.84455532613324.1554446738668
1382119.02061239857531.9793876014247
1392119.72280706022231.27719293977767
1402321.7930654871621.20693451283801
1412722.91602680012134.08397319987874
1422525.2796869741909-0.279686974190913
1432120.86743770208620.132562297913804
1441016.8397398735801-6.83973987358006
1452022.5558599122971-2.55585991229709
1462622.60451220064513.39548779935495
1472423.58416883893190.415831161068146
1482931.6943493231591-2.69434932315913
1491918.70604516280660.293954837193363
1502421.93863908444742.06136091555264
1511920.485430266394-1.48543026639402
1522423.36751946582520.632480534174842
1532221.68409749734780.315902502652156
1541723.7914510648184-6.7914510648184
1552422.96779430185021.03220569814981
1562522.36460671571152.63539328428855
1573024.14729924443055.85270075556945
1581920.1574948715408-1.15749487154078
1592220.43386706422421.56613293577575


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.4211463500424580.8422927000849150.578853649957543
120.2953931388920560.5907862777841130.704606861107944
130.2258603180437280.4517206360874560.774139681956272
140.2054369815077340.4108739630154680.794563018492266
150.3409627803483580.6819255606967160.659037219651642
160.3204824138618280.6409648277236570.679517586138171
170.4860978589656020.9721957179312030.513902141034398
180.3947493205783780.7894986411567570.605250679421622
190.3137477947817160.6274955895634320.686252205218284
200.2987885339824620.5975770679649240.701211466017538
210.397113959304830.794227918609660.60288604069517
220.3311061948637790.6622123897275580.668893805136221
230.3630883050409660.7261766100819330.636911694959034
240.3172833641235170.6345667282470350.682716635876483
250.2649231373689980.5298462747379960.735076862631002
260.2109872855444430.4219745710888850.789012714455557
270.1804632646307920.3609265292615840.819536735369208
280.1567330725710730.3134661451421470.843266927428927
290.1188603503942660.2377207007885330.881139649605734
300.1357208689314310.2714417378628620.864279131068569
310.3070432661873030.6140865323746060.692956733812697
320.5795805822837630.8408388354324730.420419417716237
330.5408627864690220.9182744270619560.459137213530978
340.5466683816286820.9066632367426360.453331618371318
350.4997563903469270.9995127806938550.500243609653073
360.5169920288486830.9660159423026340.483007971151317
370.4808655694662040.9617311389324080.519134430533796
380.5431303561298870.9137392877402260.456869643870113
390.5986709583222740.8026580833554520.401329041677726
400.5454513771886660.9090972456226670.454548622811334
410.6072367724530540.7855264550938920.392763227546946
420.572658222164210.854683555671580.42734177783579
430.568723468026150.86255306394770.43127653197385
440.5384727127430440.9230545745139120.461527287256956
450.5393981825624110.9212036348751770.460601817437589
460.6395362375474590.7209275249050830.360463762452541
470.6227996606822110.7544006786355780.377200339317789
480.6056457061471930.7887085877056140.394354293852807
490.5635116419855170.8729767160289670.436488358014483
500.5309445434311200.938110913137760.46905545656888
510.6042294083240640.7915411833518720.395770591675936
520.566943480117880.866113039764240.43305651988212
530.6079066696872260.7841866606255480.392093330312774
540.5822683622049290.8354632755901410.417731637795071
550.5391109093749180.9217781812501630.460889090625082
560.5075679956156840.9848640087686310.492432004384316
570.4587601972524340.9175203945048670.541239802747566
580.4204597802696220.8409195605392440.579540219730378
590.3835709651018330.7671419302036660.616429034898167
600.3435409953703970.6870819907407940.656459004629603
610.3012152739618070.6024305479236140.698784726038193
620.3133980972653090.6267961945306190.686601902734691
630.2784190040746470.5568380081492940.721580995925353
640.2828859275049420.5657718550098840.717114072495058
650.3891099092310500.7782198184621010.610890090768950
660.481205805026450.96241161005290.51879419497355
670.4472923430304260.8945846860608530.552707656969574
680.4324274899759110.8648549799518220.567572510024089
690.5196961878757840.9606076242484330.480303812124216
700.4754114711839070.9508229423678150.524588528816093
710.4386551742285140.8773103484570280.561344825771486
720.4081989607609710.8163979215219430.591801039239029
730.3774196841367910.7548393682735820.622580315863209
740.3503081899298360.7006163798596730.649691810070164
750.3095997839424130.6191995678848270.690400216057587
760.2714294238388470.5428588476776940.728570576161153
770.2469682091760750.493936418352150.753031790823925
780.2264048168090470.4528096336180930.773595183190953
790.3281897111107470.6563794222214940.671810288889253
800.2975926190142680.5951852380285360.702407380985732
810.2673023307287230.5346046614574450.732697669271277
820.2557873992558270.5115747985116530.744212600744173
830.2435804205876190.4871608411752390.75641957941238
840.2639068247672430.5278136495344860.736093175232757
850.2549733488876000.5099466977752010.7450266511124
860.2545628747071130.5091257494142260.745437125292887
870.2464971257580440.4929942515160880.753502874241956
880.3202020521904440.6404041043808880.679797947809556
890.2883555148609420.5767110297218840.711644485139058
900.2554840797081220.5109681594162430.744515920291878
910.2298150810472940.4596301620945880.770184918952706
920.2470076790968490.4940153581936980.752992320903151
930.2357492361005870.4714984722011740.764250763899413
940.2146425007051250.429285001410250.785357499294875
950.1925048168990540.3850096337981090.807495183100946
960.1731703053067740.3463406106135490.826829694693226
970.1469389030464470.2938778060928940.853061096953553
980.1214065589418320.2428131178836640.878593441058168
990.0988076627941690.1976153255883380.90119233720583
1000.07983179171177870.1596635834235570.920168208288221
1010.0809942537818830.1619885075637660.919005746218117
1020.06444166554424690.1288833310884940.935558334455753
1030.05472642815089250.1094528563017850.945273571849108
1040.04676997203924880.09353994407849760.953230027960751
1050.03687754952687840.07375509905375670.963122450473122
1060.03467012298743160.06934024597486330.965329877012568
1070.04438080273906020.08876160547812030.95561919726094
1080.2304690974542900.4609381949085800.76953090254571
1090.2394020473617460.4788040947234930.760597952638254
1100.6463074143149440.7073851713701120.353692585685056
1110.8841873890930370.2316252218139260.115812610906963
1120.8557282782496130.2885434435007750.144271721750387
1130.830809216148760.3383815677024790.169190783851240
1140.800240936374360.399518127251280.19975906362564
1150.8285294886351870.3429410227296260.171470511364813
1160.8085264229490830.3829471541018350.191473577050918
1170.7698994024153560.4602011951692880.230100597584644
1180.8199028917734850.3601942164530290.180097108226515
1190.7806712727130170.4386574545739670.219328727286983
1200.7416729203527020.5166541592945950.258327079647298
1210.6972877398754080.6054245202491840.302712260124592
1220.646574854999020.7068502900019610.353425145000980
1230.5964673274866960.8070653450266090.403532672513304
1240.5476794726596930.9046410546806140.452320527340307
1250.4898803681074110.9797607362148210.510119631892589
1260.4896909757397430.9793819514794860.510309024260257
1270.5224941032288410.9550117935423180.477505896771159
1280.45883940633280.91767881266560.5411605936672
1290.4213746405046790.8427492810093580.578625359495321
1300.6759957280723050.648008543855390.324004271927695
1310.625361324966510.7492773500669810.374638675033490
1320.5853621521624290.8292756956751410.414637847837571
1330.5670746067883640.8658507864232720.432925393211636
1340.6346714453419410.7306571093161180.365328554658059
1350.5796978895594140.8406042208811710.420302110440586
1360.5549603046797240.8900793906405520.445039695320276
1370.527953200905750.94409359818850.47204679909425
1380.7577302311294520.4845395377410950.242269768870548
1390.6838850799075420.6322298401849150.316114920092458
1400.604936914274250.79012617145150.39506308572575
1410.659303755339920.6813924893201590.340696244660080
1420.6639545747082720.6720908505834560.336045425291728
1430.5634306952158750.873138609568250.436569304784125
1440.6715040600671240.6569918798657510.328495939932876
1450.6800807030799280.6398385938401430.319919296920072
1460.8772861593217440.2454276813565130.122713840678256
1470.8405594881826010.3188810236347980.159440511817399
1480.7567350159756130.4865299680487730.243264984024387


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.0289855072463768OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/1021w91291898320.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/1021w91291898320.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/1j36l1291898320.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/1j36l1291898320.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/2tdno1291898320.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/2tdno1291898320.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/3tdno1291898320.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/3tdno1291898320.ps (open in new window)


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/921w91291898320.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/09/t1291898217tn31igw1jnra9y2/921w91291898320.ps (open in new window)


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