Home » date » 2010 » Dec » 22 »

Meervoudige lineaire regressie

*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: Wed, 22 Dec 2010 19:11:38 +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/22/t1293045013xnb6ygtp7r7nz10.htm/, Retrieved Wed, 22 Dec 2010 20:10:16 +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/22/t1293045013xnb6ygtp7r7nz10.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 «
14 11 12 24 24 11 7 8 25 25 6 17 8 30 17 12 10 8 19 18 8 12 9 22 18 10 12 7 22 16 10 11 4 25 20 11 11 11 23 16 16 12 7 17 18 11 13 7 21 17 13 14 12 19 23 12 16 10 19 30 8 11 10 15 23 12 10 8 16 18 11 11 8 23 15 4 15 4 27 12 9 9 9 22 21 8 11 8 14 15 8 17 7 22 20 14 17 11 23 31 15 11 9 23 27 16 18 11 21 34 9 14 13 19 21 14 10 8 18 31 11 11 8 20 19 8 15 9 23 16 9 15 6 25 20 9 13 9 19 21 9 16 9 24 22 9 13 6 22 17 10 9 6 25 24 16 18 16 26 25 11 18 5 29 26 8 12 7 32 25 9 17 9 25 17 16 9 6 29 32 11 9 6 28 33 16 12 5 17 13 12 18 12 28 32 12 12 7 29 25 14 18 10 26 29 9 14 9 25 22 10 15 8 14 18 9 16 5 25 17 10 10 8 26 20 12 11 8 20 15 14 14 10 18 20 14 9 6 32 33 10 12 8 25 29 14 17 7 25 23 16 5 4 23 26 9 12 8 21 18 10 12 8 20 20 6 6 4 15 11 8 24 20 30 28 13 12 8 24 26 10 12 8 26 22 8 14 6 24 17 7 7 4 22 12 15 13 8 14 14 9 12 9 24 17 10 13 6 24 21 12 14 7 24 19 13 8 9 24 18 10 11 5 19 10 11 9 5 31 29 8 11 8 22 31 9 13 8 27 19 13 10 6 19 9 11 11 8 25 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'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
CM[t] = -3.87026014455676 + 0.791349774058288DA[t] + 0.270704258738877PC[t] + 0.219843764606092PE[t] + 0.521408237815545PS[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-3.870260144556762.544353-1.52110.1302810.06514
DA0.7913497740582880.1293686.11700
PC0.2707042587388770.1317372.05490.041580.02079
PE0.2198437646060920.1660721.32380.1875360.093768
PS0.5214082378155450.0872495.976100


Multiple Linear Regression - Regression Statistics
Multiple R0.634260918916661
R-squared0.402286913265007
Adjusted R-squared0.386761898025137
F-TEST (value)25.9121750960921
F-TEST (DF numerator)4
F-TEST (DF denominator)154
p-value2.22044604925031e-16
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.48151208983068
Sum Squared Residuals3092.92839413997


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12425.3383064212331-1.33830642123309
22521.52347324349393.47652675650608
31722.880808149669-5.88080814966899
41819.9984863668756-1.99848636687557
51819.1585642661729-1.1585642661729
61620.3015762850773-4.3015762850773
72020.9355654459668-0.93556544596678
81622.2230050966366-6.22300509663662
91822.4426337403493-4.4426337403493
101720.8422220800589-3.84222208005892
112322.75202823431370.247971765686259
123022.0623994485217.93760055147898
132315.45784610733137.5421538926687
141818.4342616534289-0.434261653428938
151521.5634738028183-6.56347380281835
161218.3131003122037-6.31310031220365
172119.13780126401461.86219873598544
181514.49675034030360.503249659696428
192020.0723980306551-0.0723980306551079
203126.22127997124484.77872002875525
212724.94871666365762.05128333634241
223427.03186730246916.96813269753088
232119.80647290268671.19352709731332
243121.05977767717669.9402223228234
251919.9992490893717-0.99924908937171
261620.4920852802051-4.49208528020508
272021.6667202360762-1.66672023607619
282118.65639358552342.34360641447657
292222.0755475508178-0.0755475508177946
301719.5610870051518-2.56108700515179
312420.83384445770123.16615554229879
322530.7381273145773-5.7381273145773
332625.92732174706550.0726782529345164
342523.93295911511621.06704088488382
351722.8676600473722-5.86766004737222
363227.66757605331314.33242394668688
373323.18941894520619.81058105479386
381322.0029462111371-9.00294621113711
393227.73616963555094.26383036444913
402525.5341334979027-0.534133497902692
412927.83636517882421.16363482117583
422222.0555472711556-0.0555472711555851
431817.16226692337570.837733076624342
441721.717580730209-4.71758073020897
452022.0656444834678-2.06564448346782
461520.79059886343-5.79059886343
472022.5822822413443-2.5822822413443
483327.64910121864325.35089878135682
492922.085644763136.91435523686997
502326.3847213884515-3.38472138845147
512623.01662206225222.98337793774785
521819.2086620378096-1.20866203780956
532019.47860357405230.521396425947702
541111.2025626778838-0.202562677883786
552828.9965626842308-0.996562684230813
562623.93828584748932.06171415251066
572222.6070530009456-0.607053000945571
581720.0832579654635-3.08325796546347
591215.9144743753898-3.91447437538977
601420.5776072761893-6.57760727618935
611720.9927305158623-3.99273051586228
622121.3952532548412-0.395253254841174
631923.4685008263027-4.46850082630272
641823.0753125771399-5.07531257713993
651018.0269597836796-8.0269597836796
662924.53379989404674.46620010595332
673118.668016242827912.3319837571721
681922.6078157234417-3.60781572344171
69920.3501486117217-11.3501486117217
702022.6062902784494-2.60629027844944
712817.676060261329610.3239397386704
721918.17670549698680.823294503013169
733023.36906800552566.63093199447445
742927.28333400404191.71666599595808
752621.66672023607624.33327976392381
762319.47860357405233.5213964259477
771322.9964276376277-9.9964276376277
782122.8653718798838-1.86537187988381
791922.0841193181378-3.08411931813776
802822.7080112667155.29198873328499
812325.9614356473142-2.96143564731424
821814.47827550563363.52172449436637
832120.81059914309220.189400856907793
842022.0254497791811-2.02544977918114
852320.38024610369612.61975389630388
862121.13292661846-0.132926618460004
872121.6768174483884-0.676817448388418
881523.3961146075155-8.39611460751546
892827.11304040946980.886959590530243
901917.69453509599961.30546490400043
912621.62118647431664.37881352568343
921013.4779419017776-3.47794190177762
931617.234084564629-1.23408456462904
942220.89384529668781.10615470331216
951919.3776453082829-0.377645308282863
963129.05121581491311.94878418508689
973125.50936273830145.49063726169858
982924.87766174490034.12233825509966
991917.42459355975681.57540644024317
1002218.70649135716013.29350864283992
1012322.29462859292780.705371407072249
1021516.1434584848497-1.1434584848497
1032021.0218711403783-1.02187114037834
1041819.6691125691801-1.66911256918008
1052322.81298594075880.187014059241242
1062520.14954240428174.85045759571834
1072116.09183526822084.90816473177922
1082418.87623735012955.12376264987047
1092525.1584632159514-0.158463215951451
1101719.5972739519955-2.59727395199554
1111314.5476108344364-1.54761083443636
1122818.81527964368459.1847203563155
1132119.82895549479951.17104450520045
1142527.2094346653622-2.20943466536216
115920.5825928770218-11.5825928770218
1161618.0284852286719-2.02848522867187
1171920.2737669605913-1.27376696059126
1181719.0181530426818-2.01815304268177
1192524.71877568673930.281224313260733
1202014.65790359002195.34209640997811
1212921.16550642288517.8344935771149
1221418.4858848700579-4.48588487005786
1232226.4519836706592-4.45198367065921
1241515.8319909442903-0.831990944290274
1251925.568032277258-6.56803227725803
1262022.1448828796205-2.14488287962052
1271517.5179369256647-2.51793692566469
1282022.0848820406339-2.08488204063389
1291820.7612640939517-2.76126409395169
1303325.50174783843987.49825216156016
1312223.2858218519299-1.28582185192992
1321616.6016208487318-0.601620848731829
1331719.3212429608835-2.32124296088349
1341615.16159971566360.83840028433637
1352117.39297062279013.60702937720988
1362627.5864239222436-1.58642392224364
1371820.8915571291994-2.89155712919943
1381822.0732593833294-4.07325938332939
1391718.6371560283574-1.63715602835736
1402223.9946881948887-1.99468819488872
1413023.61595837212156.38404162787845
1423027.00577756793762.9942224320624
1432429.0519871882406-5.05198718824063
1442121.9437080946466-0.943708094646622
1452125.4299301971865-4.42993019718646
1462927.16616809515981.83383190484022
1473122.86766004737228.13233995262778
1482018.71811401446461.28188598553541
1491613.69301518644462.30698481355535
1502218.87700007262573.12299992737434
1512020.1821431846379-0.182143184637921
1522827.39515220461970.604847795380281
1533827.179122052494310.8208779475057
1542218.2675665504443.73243344955596
1552025.6204391923142-5.62043919231425
1561717.9968622917052-0.996862291705158
1572824.45893136280883.54106863719124
1582224.1472696772871-2.14726967728707
1593126.31615743297634.68384256702373


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.2116404479719040.4232808959438080.788359552028096
90.1036325976370020.2072651952740040.896367402362998
100.04628332324331220.09256664648662440.953716676756688
110.136453455808620.272906911617240.86354654419138
120.678571770591380.642856458817240.32142822940862
130.6434140760114610.7131718479770770.356585923988539
140.5677835581716610.8644328836566770.432216441828339
150.5691225577631250.861754884473750.430877442236875
160.5132834821551450.973433035689710.486716517844855
170.436445285343430.8728905706868610.56355471465657
180.3924405874403260.7848811748806520.607559412559674
190.333851104177080.667702208354160.66614889582292
200.3899997676210810.7799995352421620.610000232378919
210.3659118872742880.7318237745485760.634088112725712
220.3858648280572940.7717296561145880.614135171942706
230.3329082798398050.665816559679610.667091720160195
240.5630825796052680.8738348407894640.436917420394732
250.4976826196183050.995365239236610.502317380381695
260.4739191662707820.9478383325415640.526080833729218
270.4153803025466250.830760605093250.584619697453375
280.3638986948034450.727797389606890.636101305196555
290.3070215998006770.6140431996013540.692978400199323
300.2578655940895810.5157311881791620.742134405910419
310.3024088174096840.6048176348193690.697591182590316
320.3668535912507950.7337071825015890.633146408749205
330.3390286004369580.6780572008739150.660971399563042
340.3612078932414410.7224157864828830.638792106758559
350.3684445469532230.7368890939064460.631555453046777
360.3614744902540240.7229489805080470.638525509745976
370.5775782003888080.8448435992223830.422421799611192
380.7826051704576090.4347896590847830.217394829542391
390.7844052903210420.4311894193579150.215594709678958
400.743494921594230.5130101568115390.25650507840577
410.7028843929741180.5942312140517650.297115607025882
420.6551463962620420.6897072074759160.344853603737958
430.6113685549427830.7772628901144330.388631445057217
440.5974323763860620.8051352472278760.402567623613938
450.5602915202529130.8794169594941730.439708479747087
460.5998473112539430.8003053774921140.400152688746057
470.568314842726950.86337031454610.43168515727305
480.5717093348773410.8565813302453170.428290665122659
490.637060955314450.7258780893711010.362939044685551
500.610135935480980.779728129038040.38986406451902
510.5770588537046840.8458822925906310.422941146295316
520.5299873110626770.9400253778746470.470012688937323
530.4814049680146380.9628099360292750.518595031985362
540.4322109349337120.8644218698674230.567789065066288
550.3856905303426280.7713810606852570.614309469657372
560.3474237604999480.6948475209998950.652576239500052
570.3042949316562460.6085898633124920.695705068343754
580.2784089067297760.5568178134595530.721591093270224
590.2684936646588820.5369873293177630.731506335341118
600.3099990656917850.619998131383570.690000934308215
610.3028804624301690.6057609248603390.69711953756983
620.2641276015798890.5282552031597770.735872398420111
630.2609548001926860.5219096003853710.739045199807314
640.2953235284015710.5906470568031420.704676471598429
650.3788383685787310.7576767371574620.621161631421269
660.3732231138836770.7464462277673550.626776886116323
670.6928331172637780.6143337654724430.307166882736222
680.6788361168459350.642327766308130.321163883154065
690.8608027604399910.2783944791200170.139197239560009
700.8435394527077120.3129210945845770.156460547292288
710.939681608831360.1206367823372790.0603183911686395
720.9250948220712240.1498103558575530.0749051779287764
730.9431374654455670.1137250691088660.056862534554433
740.9317961582565140.1364076834869720.0682038417434858
750.9320909991648740.1358180016702520.0679090008351258
760.9267805763325280.1464388473349440.073219423667472
770.974450704893840.05109859021232090.0255492951061604
780.9683104951053280.06337900978934340.0316895048946717
790.9636716847383820.0726566305232360.036328315261618
800.9672576227535720.06548475449285690.0327423772464285
810.9621129246643140.0757741506713720.037887075335686
820.9590834075208950.08183318495820960.0409165924791048
830.9482063015569030.1035873968861940.051793698443097
840.937796732227950.1244065355441030.0622032677720513
850.9281538517128370.1436922965743250.0718461482871627
860.9143747421262240.1712505157475510.0856252578737755
870.895568279027220.208863441945560.10443172097278
880.9408640997971940.1182718004056130.0591359002028063
890.9277051811775190.1445896376449630.0722948188224814
900.911844446412740.1763111071745190.0881555535872597
910.9105046105100870.1789907789798270.0894953894899133
920.9024302293614210.1951395412771580.0975697706385788
930.8842654722984640.2314690554030730.115734527701536
940.8623757342967710.2752485314064580.137624265703229
950.8348482008466740.3303035983066520.165151799153326
960.8084804178227890.3830391643544230.191519582177211
970.8215198341742950.356960331651410.178480165825705
980.8169005859516840.3661988280966320.183099414048316
990.7864659305562350.427068138887530.213534069443765
1000.7676187437548470.4647625124903070.232381256245153
1010.7296590299721670.5406819400556650.270340970027833
1020.6945713112666340.6108573774667330.305428688733367
1030.6565078333637140.6869843332725730.343492166636286
1040.617437329409740.7651253411805190.382562670590259
1050.5706569314495540.8586861371008910.429343068550446
1060.5674690700234920.8650618599530160.432530929976508
1070.5738047810613150.852390437877370.426195218938685
1080.5952378461490840.8095243077018320.404762153850916
1090.5456896300755040.9086207398489910.454310369924496
1100.5227976374794190.9544047250411630.477202362520581
1110.4822488274088530.9644976548177070.517751172591147
1120.6753407582433830.6493184835132340.324659241756617
1130.6644860894214350.671027821157130.335513910578565
1140.6231605477879720.7536789044240550.376839452212027
1150.8156093711932720.3687812576134560.184390628806728
1160.798092730415990.403814539168020.20190726958401
1170.7755282190511720.4489435618976560.224471780948828
1180.7456119024366250.508776195126750.254388097563375
1190.6990321678366820.6019356643266360.300967832163318
1200.7328205229879820.5343589540240370.267179477012018
1210.7902987816206950.4194024367586090.209701218379305
1220.7868151732063440.4263696535873120.213184826793656
1230.7861111687500380.4277776624999240.213888831249962
1240.742034337143440.5159313257131210.257965662856561
1250.7896968186773480.4206063626453040.210303181322652
1260.7670029199164580.4659941601670840.232997080083542
1270.7590160937320140.4819678125359720.240983906267986
1280.7308953799057030.5382092401885940.269104620094297
1290.7079010381806710.5841979236386580.292098961819329
1300.774565228197410.4508695436051810.22543477180259
1310.7256418638152210.5487162723695570.274358136184779
1320.6700852202014070.6598295595971860.329914779798593
1330.6694184882239310.6611630235521370.330581511776069
1340.6128107809877930.7743784380244150.387189219012208
1350.5770331454064150.8459337091871690.422966854593584
1360.5517010499927590.8965979000144830.448298950007241
1370.5590750936131890.8818498127736220.440924906386811
1380.5799307423986710.8401385152026580.420069257601329
1390.5283085194822860.9433829610354290.471691480517714
1400.4520967641192160.9041935282384310.547903235880784
1410.5642414748368140.8715170503263720.435758525163186
1420.5056895499194660.9886209001610680.494310450080534
1430.4571576180313630.9143152360627260.542842381968637
1440.3720925243864990.7441850487729990.6279074756135
1450.4409981725150250.881996345030050.559001827484975
1460.3442221296911380.6884442593822750.655777870308862
1470.3868152163330810.7736304326661620.613184783666919
1480.2823878728726980.5647757457453950.717612127127302
1490.1972451135617110.3944902271234220.802754886438289
1500.1553472756133730.3106945512267460.844652724386627
1510.1162953637282620.2325907274565250.883704636271738


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 level70.0486111111111111OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/10f7wg1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/10f7wg1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/1qohm1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/1qohm1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/2jxgq1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/2jxgq1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/3jxgq1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/3jxgq1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/4jxgq1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/4jxgq1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/5t6yb1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/5t6yb1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/6t6yb1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/6t6yb1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/74fxd1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/74fxd1293045088.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/84fxd1293045088.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/22/t1293045013xnb6ygtp7r7nz10/84fxd1293045088.ps (open in new window)


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