Home » date » 2010 » Dec » 02 »

Workshop 7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 02 Dec 2010 11:00:34 +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/02/t1291295633swtgyaazx263d78.htm/, Retrieved Thu, 02 Dec 2010 14:13:53 +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/02/t1291295633swtgyaazx263d78.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 «
5 1 1 1 2 1 21 4 1 4 1 4 1 21 7 1 5 2 4 1 24 7 2 2 1 4 2 21 5 1 1 1 3 2 21 5 1 1 1 2 2 22 4 1 2 1 3 2 22 4 2 1 1 4 1 20 6 2 1 1 2 1 21 5 2 1 1 3 0 21 1 2 3 2 3 2 21 5 1 1 1 3 1 22 4 2 1 1 4 1 22 6 1 1 1 3 1 23 7 1 2 1 2 1 23 7 1 4 2 5 2 21 2 2 1 1 2 2 24 6 2 1 1 3 1 23 4 2 1 1 3 2 21 3 1 2 1 3 1 23 6 1 3 1 3 2 32 6 1 1 1 4 1 21 5 2 1 2 3 2 21 4 2 1 1 1 2 21 6 1 1 2 3 1 21 4 2 1 1 2 2 21 3 2 2 4 4 1 20 4 2 1 1 4 1 24 5 1 1 1 4 1 22 6 1 1 1 1 2 22 6 2 1 1 3 2 21 4 2 1 1 1 2 21 6 1 1 1 4 1 21 6 2 1 1 2 2 21 5 2 1 1 3 1 23 6 2 1 1 3 1 23 4 1 1 1 2 2 21 6 2 1 1 4 1 20 7 1 1 1 1 2 21 5 2 1 1 2 1 20 6 2 1 1 3 2 21 6 1 1 1 3 1 22 5 2 4 1 5 2 21 7 2 1 1 3 1 22 6 2 1 1 4 1 22 3 1 4 3 3 2 22 4 1 2 2 4 1 22 5 1 2 1 2 1 21 4 1 1 1 3 1 21 3 2 1 1 2 2 21 5 1 2 2 3 1 23 5 1 1 1 2 2 23 4 2 1 1 3 2 23 5 2 1 1 4 1 22 1 2 1 1 1 1 24 2 2 1 1 1 1 23 3 2 1 1 1 2 21 4 2 2 1 4 1 22 3 2 1 1 2 2 22 7 2 1 1 2 2 21 2 2 1 1 3 1 21 4 1 2 2 5 1 21 2 2 1 1 3 2 21 5 1 2 1 3 1 20 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
roken[t] = -0.471846127072205 -0.0304867246153451algemene_tevredenheid[t] -0.401462556568098meer_sport[t] + 0.385195401689889drugs[t] + 0.370121634831214drankgebruik[t] + 0.351301598737133geslacht[t] + 0.0289776729828369leeftijd[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-0.4718461270722050.678865-0.69510.4880780.244039
algemene_tevredenheid-0.03048672461534510.050639-0.6020.5480350.274017
meer_sport-0.4014625565680980.144001-2.78790.0059780.002989
drugs0.3851954016898890.1233723.12220.0021470.001073
drankgebruik0.3701216348312140.0769424.81044e-062e-06
geslacht0.3513015987371330.1471432.38750.0181850.009092
leeftijd0.02897767298283690.0201191.44030.1518290.075915


Multiple Linear Regression - Regression Statistics
Multiple R0.503703860024925
R-squared0.253717578604009
Adjusted R-squared0.224451601294362
F-TEST (value)8.66936975722927
F-TEST (DF numerator)6
F-TEST (DF denominator)153
p-value3.99815324181318e-08
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.838010449731623
Sum Squared Residuals107.446011620488


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
111.05952909601200-0.0595290960119978
241.830259090289772.16974090971023
352.210927337082132.78907266291787
421.688637958612770.311362041387232
511.78095232958034-0.780952329580343
611.43980836773197-0.439808367731967
721.840416727178530.159583272821475
811.39981886073883-0.399818860738834
910.6275798148285540.372420185171446
1010.6768865755379790.323113424462021
1131.886632073163521.11336792683648
1211.45862840382605-0.458628403826047
1311.45777420670451-0.457774206704508
1411.45711935219354-0.457119352193539
1521.056510992746980.94348900725302
1642.845417551701971.15458244829803
1711.18776133097558-0.187761330975578
1811.05565679562544-0.0556567956254411
1911.40997649762759-0.409976497627591
2021.548579526039570.451420473960426
2132.069220007776200.930779992223795
2211.76928564105908-0.769285641059079
2311.76468517470213-0.764685174702135
2410.6697332279651640.330266772034837
2511.78435940791775-0.784359407917755
2611.03985486279638-0.039854862796377
2722.58589179042385-0.585891790423847
2811.51572955267018-0.515729552670182
2911.82875003865726-0.82875003865726
3011.03920000828541-0.0392000082854081
3111.3490030483969-0.349003048396901
3210.6697332279651640.330266772034837
3311.76928564105908-0.769285641059079
3410.9788814135656870.0211185864343132
3511.08614352024079-0.0861435202407862
3611.05565679562544-0.0556567956254411
3711.44131741936447-0.441317419364475
3811.33884541150814-0.338845411508144
3910.9797356106872260.0202643893127742
4010.6290888664610620.370911133538938
4111.3490030483969-0.349003048396901
4211.42814167921070-0.428141679210702
4342.119733042674671.88026695732533
4410.996192398027260.00380760197274099
4511.39680075747382-0.396800757473818
4642.641294255173651.35870574482635
4722.24443216496250-0.244432164962495
4821.059529096012000.940470903988004
4911.46013745545856-0.460137455458555
5011.07034158741172-0.070341587411722
5121.872801478498770.127198521501227
5211.46878604071480-0.468786040714804
5311.46793184359326-0.467931843593265
5411.42728748208916-0.427287482089163
5510.4968248220225760.503175177977424
5610.4373604244243940.562639575575606
5710.7002199525805080.299780047419492
5821.457774206704510.542225793295492
5911.09931926039456-0.099319260394559
6010.9483946889503420.0516053110496581
6111.11964834812115-0.119648348121148
6222.58557612681087-0.585576126810872
6311.47094994685828-0.470949946858281
6421.400673057860370.599326942139627
6541.779443277947832.22055672205217
6611.37798072137974-0.377980721379738
6711.02667912264260-0.0266791226426042
6811.39680075747382-0.396800757473818
6921.769285641059080.230714358940921
7032.212436388714640.787563611285358
7111.3490030483969-0.349003048396901
7211.45777420670451-0.457774206704508
7311.12915113049894-0.129151130498935
7411.42965073084321-0.42965073084321
7511.08463446860828-0.084634468608278
7611.08463446860828-0.084634468608278
7712.02978192046115-1.02978192046115
7842.181560689026901.81843931097310
7911.02667912264260-0.0266791226426042
8012.11042960290746-1.11042960290746
8121.367823084490980.632176915509019
8211.45928325833702-0.459283258337016
8311.79977236567442-0.799772365674424
8412.18345871573181-1.18345871573181
8511.43895417061043-0.438954170610428
8611.05716584725795-0.0571658472579492
8711.76928564105908-0.769285641059079
8811.42814167921070-0.428141679210702
8910.7002199525805080.299780047419492
9022.53967644443886-0.539676444438857
9111.79977236567442-0.799772365674424
9211.37798072137974-0.377980721379738
9311.43895417061043-0.438954170610428
9411.76403032019117-0.764030320191166
9511.42728748208916-0.427287482089163
9620.6589207365654381.34107926343456
9711.750465604965-0.750465604964999
9851.708967046339363.29103295366064
9911.33733635987564-0.337336359875636
10011.36782308449098-0.367823084490981
10111.40695839436257-0.406958394362574
10221.425778430456650.574221569543345
10312.18345871573181-1.18345871573181
10432.376071478263490.623928521736513
10511.40997649762759-0.409976497627591
10611.40997649762759-0.409976497627591
10711.02667912264260-0.0266791226426042
10831.768431443937541.23156855606246
10911.39680075747382-0.396800757473818
11011.39916400622787-0.399164006227865
11111.16114690674679-0.161146906746788
11211.73879891644373-0.738798916443734
11311.50143667147363-0.501436671473626
11411.14797116659302-0.147971166593015
11521.900535979287680.0994640207123233
11620.7592919518514051.24070804814859
11741.795900065287872.20409993471213
11842.568654117421691.43134588257831
11911.70982124346090-0.709821243460897
12011.11361214159111-0.113612141591115
12110.8202654010820960.179734598917904
12211.45777420670451-0.457774206704508
12342.167191560853601.83280843914640
12412.18260451861027-1.18260451861027
12511.39765495459536-0.397654954595357
12611.17156699981923-0.171566999819229
12711.42879653372167-0.428796533721671
12831.406958394362571.59304160563743
12911.31851632378156-0.318516323781555
13012.13480680953335-1.13480680953335
13112.46053781362506-1.46053781362506
13241.719124683228112.28087531677189
13342.226340294838801.77365970516120
13411.456265155072-0.456265155072
13522.13670483623825-0.136704836238251
13610.6697332279651640.330266772034837
13721.781996159163710.218003840836293
13811.36782308449098-0.367823084490981
13931.738798916443731.26120108355627
14022.12058723979621-0.120587239796212
14121.396800757473820.603199242526182
14211.36933213612349-0.369332136123489
14311.37948977301225-0.379489773012246
14421.379489773012250.620510226987754
14511.39680075747382-0.396800757473818
14622.53967644443886-0.539676444438857
14722.15060874236241-0.150608742362413
14810.7276885739308370.272311426069163
14911.80605770217663-0.806057702176625
15021.667757451208110.332242548791893
15111.76777658942657-0.76777658942657
15221.396800757473820.603199242526182
15311.69355408858269-0.693554088582688
15411.05867489889046-0.0586748988904574
15511.82724098702475-0.827240987024753
15611.40997649762759-0.409976497627591
15711.78009813245880-0.780098132458804
15811.79675426240941-0.796754262409408
15911.90092495436007-0.900924954360071
16011.36631403285847-0.366314032858473


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.6893000751173580.6213998497652840.310699924882642
110.7268367650636740.5463264698726520.273163234936326
120.7654181648994840.4691636702010330.234581835100516
130.6999023487426060.6001953025147880.300097651257394
140.6416112445023350.7167775109953290.358388755497665
150.6587226512505120.6825546974989770.341277348749488
160.7332484323692960.5335031352614080.266751567630704
170.6555069432569420.6889861134861170.344493056743058
180.576243471004450.84751305799110.42375652899555
190.4903226378908980.9806452757817960.509677362109102
200.4077375635216490.8154751270432990.59226243647835
210.3403061315531990.6806122631063970.659693868446801
220.3907503454703910.7815006909407820.609249654529609
230.5985657751646610.8028684496706780.401434224835339
240.6288146880854910.7423706238290180.371185311914509
250.801564022683250.3968719546334990.198435977316750
260.757498630530560.4850027389388790.242501369469439
270.8150546694745420.3698906610509160.184945330525458
280.8084234454396540.3831531091206910.191576554560346
290.82593273271650.3481345345670010.174067267283501
300.782338326299380.435323347401240.21766167370062
310.7375031057188420.5249937885623160.262496894281158
320.706908913232950.5861821735341010.293091086767051
330.6993943210688770.6012113578622470.300605678931123
340.6456673248397380.7086653503205250.354332675160262
350.589940386925660.820119226148680.41005961307434
360.5325389994296920.9349220011406160.467461000570308
370.4859746730038160.9719493460076320.514025326996184
380.4310584685106320.8621169370212630.568941531489368
390.3751665889939960.7503331779879920.624833411006004
400.3456800591162560.6913601182325120.654319940883744
410.2994903545326200.5989807090652390.70050964546738
420.2688058842941650.5376117685883310.731194115705834
430.4694027563506790.9388055127013570.530597243649321
440.4156343801338220.8312687602676450.584365619866178
450.3810597264228990.7621194528457970.618940273577101
460.4186457329218660.8372914658437310.581354267078134
470.3836330241566040.7672660483132080.616366975843396
480.4111439456144140.8222878912288280.588856054385586
490.3725904507884560.7451809015769120.627409549211544
500.3243007006945350.648601401389070.675699299305465
510.2819939630890690.5639879261781390.71800603691093
520.2604624842383450.520924968476690.739537515761655
530.2376740025636540.4753480051273080.762325997436346
540.2097502300603620.4195004601207250.790249769939638
550.1883261148238750.3766522296477510.811673885176125
560.1697872142670070.3395744285340140.830212785732993
570.1450376806455420.2900753612910840.854962319354458
580.1289447572487950.257889514497590.871055242751205
590.1051051890033990.2102103780067990.8948948109966
600.08445243550867480.1689048710173500.915547564491325
610.06686515745598790.1337303149119760.933134842544012
620.06127171185253180.1225434237050640.938728288147468
630.05072457662919560.1014491532583910.949275423370805
640.04799256017519480.09598512035038960.952007439824805
650.1762262303260570.3524524606521140.823773769673943
660.1539080851060560.3078161702121120.846091914893944
670.1271223178743550.254244635748710.872877682125645
680.1090885166480240.2181770332960490.890911483351976
690.0902798470618090.1805596941236180.909720152938191
700.0851758779116230.1703517558232460.914824122088377
710.07040527620838630.1408105524167730.929594723791614
720.05961968846799150.1192393769359830.940380311532009
730.04908668144867310.09817336289734620.950913318551327
740.04038520903909760.08077041807819530.959614790960902
750.03154449299961410.06308898599922830.968455507000386
760.02435170892622340.04870341785244670.975648291073777
770.02650909419224220.05301818838448430.973490905807758
780.08221796291554090.1644359258310820.91778203708446
790.06653473552911580.1330694710582320.933465264470884
800.07311714169971740.1462342833994350.926882858300282
810.06870098848599090.1374019769719820.931299011514009
820.05755829004640520.1151165800928100.942441709953595
830.0539886199227470.1079772398454940.946011380077253
840.07000163093583170.1400032618716630.929998369064168
850.05900772355249290.1180154471049860.940992276447507
860.04680749353844440.09361498707688870.953192506461556
870.04285073364875530.08570146729751060.957149266351245
880.03513661224100120.07027322448200230.964863387758999
890.02836291457721760.05672582915443520.971637085422782
900.02409990979710640.04819981959421280.975900090202894
910.02219463991496070.04438927982992130.97780536008504
920.01756519516170220.03513039032340440.982434804838298
930.01406168970235550.02812337940471090.985938310297645
940.01325176686804450.02650353373608900.986748233131955
950.01071034359030160.02142068718060320.989289656409698
960.01990329582721720.03980659165443440.980096704172783
970.01736917070115700.03473834140231390.982630829298843
980.327159125156550.65431825031310.67284087484345
990.2931476537327810.5862953074655620.706852346267219
1000.2619735392246540.5239470784493080.738026460775346
1010.2326810162522560.4653620325045110.767318983747744
1020.2086821774681920.4173643549363830.791317822531808
1030.2336243787762380.4672487575524760.766375621223762
1040.2232567969262530.4465135938525060.776743203073747
1050.1936887572542590.3873775145085180.806311242745741
1060.1667062958301550.3334125916603090.833293704169845
1070.1376865099550890.2753730199101780.862313490044911
1080.1681917204703090.3363834409406190.83180827952969
1090.1456937443062520.2913874886125050.854306255693748
1100.1230478622252130.2460957244504270.876952137774787
1110.1005048153090330.2010096306180660.899495184690967
1120.095659246454110.191318492908220.90434075354589
1130.07827057180131130.1565411436026230.921729428198689
1140.06139371964465730.1227874392893150.938606280355343
1150.05167090575657220.1033418115131440.948329094243428
1160.06471251223988690.1294250244797740.935287487760113
1170.2167787491573460.4335574983146920.783221250842654
1180.325566124040740.651132248081480.67443387595926
1190.3132156408858990.6264312817717980.686784359114101
1200.2694055607197470.5388111214394950.730594439280253
1210.2336495246868040.4672990493736070.766350475313196
1220.1967301695514080.3934603391028170.803269830448592
1230.5095029044453470.9809941911093060.490497095554653
1240.5035227938944590.9929544122110820.496477206105541
1250.4725825735215790.9451651470431570.527417426478421
1260.4200323434652450.840064686930490.579967656534755
1270.3654007410419080.7308014820838160.634599258958092
1280.480470021586010.960940043172020.51952997841399
1290.4426565177072660.8853130354145310.557343482292734
1300.434798306784860.869596613569720.56520169321514
1310.4806930333497520.9613860666995040.519306966650248
1320.8520107873396780.2959784253206450.147989212660322
1330.9885777962062780.02284440758744480.0114222037937224
1340.9818607130168360.03627857396632860.0181392869831643
1350.9711893952202280.05762120955954510.0288106047797725
1360.9556255640209960.08874887195800820.0443744359790041
1370.9445079814678140.1109840370643720.0554920185321859
1380.920715737156750.1585685256864980.0792842628432492
1390.9875266397664860.02494672046702790.0124733602335139
1400.988665320374820.02266935925035850.0113346796251793
1410.992265285128770.01546942974245950.00773471487122973
1420.9847352474405340.03052950511893250.0152647525594662
1430.9726458343653480.05470833126930440.0273541656346522
1440.9868972556672940.02620548866541230.0131027443327061
1450.9734490749589340.05310185008213130.0265509250410656
1460.980923052364190.03815389527161890.0190769476358095
1470.9858550602127530.02828987957449360.0141449397872468
1480.9628706238972930.07425875220541350.0371293761027067
1490.9342383493183280.1315233013633450.0657616506816723
1500.8513786284260630.2972427431478740.148621371573937


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level180.127659574468085NOK
10% type I error level320.226950354609929NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/10s3i31291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/10s3i31291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/13k391291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/13k391291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/2dbku1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/2dbku1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/3dbku1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/3dbku1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/4dbku1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/4dbku1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/56k1x1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/56k1x1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/66k1x1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/66k1x1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/7zcji1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/7zcji1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/8zcji1291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/8zcji1291287622.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/9s3i31291287622.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291295633swtgyaazx263d78/9s3i31291287622.ps (open in new window)


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