Home » date » 2010 » Dec » 20 »

Workshop7

*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: Mon, 20 Dec 2010 13:08:41 +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/20/t1292850535yvprq5yusq63rgi.htm/, Retrieved Mon, 20 Dec 2010 14:09:07 +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/20/t1292850535yvprq5yusq63rgi.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:
multiple regression
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 2 3 3 4 4 2 4 2 4 3 4 4 4 4 2 4 2 5 4 2 4 2 2 2 2 4 3 2 2 2 3 2 4 4 5 1 3 2 4 5 3 5 1 2 1 4 4 3 4 3 3 3 4 3 3 3 2 3 2 4 4 2 4 1 3 2 2 4 4 4 4 3 3 3 4 4 2 2 4 2 4 4 3 3 3 2 2 3 4 3 3 2 2 2 4 2 4 4 1 1 3 4 3 4 5 1 1 1 4 4 3 4 2 3 3 4 3 3 2 2 2 2 2 2 3 4 2 2 3 4 4 4 4 2 3 4 4 3 2 4 1 4 2 4 3 5 4 2 4 3 3 4 4 4 4 3 5 2 3 2 4 2 2 2 4 3 3 5 2 3 2 2 4 4 4 2 4 3 3 4 4 4 2 3 2 4 4 3 4 2 2 2 3 4 4 4 3 1 2 4 4 4 4 2 3 2 4 4 1 4 1 2 3 4 5 4 4 4 4 4 4 4 5 2 1 4 1 4 4 2 4 2 5 3 4 4 4 4 2 2 3 4 3 3 5 2 4 2 5 4 2 5 2 4 1 4 3 4 4 2 2 1 2 4 5 3 2 4 2 4 4 4 4 2 4 2 4 3 4 5 2 2 2 5 5 4 4 2 3 1 4 4 3 4 2 2 2 2 3 4 5 2 4 1 4 3 2 4 2 3 2 4 3 2 5 1 1 2 4 4 4 4 2 2 4 2 4 2 4 1 5 2 5 4 4 4 2 2 2 4 4 4 3 1 4 2 4 4 1 4 1 4 1 4 4 4 4 2 2 2 4 4 2 4 2 2 2 4 5 1 2 1 2 1 3 3 4 3 5 4 5 5 3 3 5 2 3 2 4 5 2 4 2 4 2 4 5 4 4 1 2 2 4 4 3 5 1 3 1 4 4 2 3 2 2 3 2 3 2 5 2 2 1 4 4 3 4 1 3 1 4 4 2 5 1 2 2 4 5 1 4 2 3 3 4 4 3 4 1 2 2 3 4 2 5 1 4 2 4 5 3 4 2 2 2 2 4 3 4 1 5 4 4 3 3 5 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


Multiple Linear Regression - Estimated Regression Equation
mistakes[t] = + 1.98324156116145 -0.0448001902119397standards[t] -0.0356772706903457organization[t] + 0.351017163481253punished[t] + 0.112612004015097secondrate[t] -0.0911763790187378competent[t] -0.0725515712595284neat[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.983241561161450.5231123.79120.0002160.000108
standards-0.04480019021193970.075288-0.5950.5526970.276348
organization-0.03567727069034570.086798-0.4110.6816240.340812
punished0.3510171634812530.0798834.39412.1e-051e-05
secondrate0.1126120040150970.0715741.57340.1177140.058857
competent-0.09117637901873780.089734-1.01610.3112090.155604
neat-0.07255157125952840.092819-0.78160.4356360.217818


Multiple Linear Regression - Regression Statistics
Multiple R0.406253173307400
R-squared0.165041640822333
Adjusted R-squared0.132082758223214
F-TEST (value)5.00750109855809
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value0.000103787659412546
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.848151185471069
Sum Squared Residuals109.342785879229


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
132.100213365180550.899786634819452
232.248502639886020.751497360113985
322.0677258804434-0.0677258804433997
422.2056313898933-0.205631389893299
532.232185741062050.76781425893795
621.587044250015910.412955749984087
711.59178400747228-0.591784007472284
832.514659180399760.485340819600239
922.12676771634932-0.126767716349325
1021.967226230427140.0327737695728583
1132.839500961428280.160499038571717
1222.23025680084283-0.230256800842827
1322.45634925483422-0.456349254834219
1422.15925885485328-0.159258854853285
1531.542600655195121.45739934480488
1611.43437181324525-0.434371813245248
1732.163642016918510.836357983081492
1822.37728888358111-0.377288883581106
1931.978478441643881.02152155835612
2042.118841826706571.88115817329343
2121.970037047664290.0299629523357089
2232.205278448268930.794721551731066
2353.003228911706551.99677108829345
2422.09583020311535-0.0958302031153507
2522.23776593300611-0.237765933006109
2632.250078638480870.749921361519126
2722.04629025544704-0.0462902554470395
2822.06965482066262-0.0696548206626204
2922.1720834108981-0.172083410898099
3022.04629025544704-0.0462902554470395
3131.644510087326981.35548991267302
3242.860936586424641.13906341357536
3311.83443944714963-0.834439447149635
3432.361114643901110.638885356098888
3532.006229822691470.993770177308529
3622.07684879996499-0.0768487999649925
3712.2853769404552-1.28537694045520
3812.11603100946942-1.11603100946942
3922.14977933994054-0.149779339940542
4022.23145383072166-0.231453830721665
4121.734273030463330.265726969536669
4212.04629025544704-1.04629025544704
4322.23338277094089-0.233382770940887
4412.19577656003132-1.19577656003132
4522.20844220713045-0.208442207130447
4621.523972193669130.476027806330873
4742.116031009469421.88396899053058
4821.918921101401120.0810788985988785
4921.933678251431940.0663217485680571
5021.843562366671230.156437633328771
5111.94228566661670-0.942285666616702
5221.933678251431940.0663217485680571
5321.950727060596290.0492729394037062
5411.95214415024547-0.952144150245467
5553.229006212837031.77099378716297
5621.982861603709110.0171383962908947
5722.17595106862649-0.175951068626487
5821.582661087950690.41733891204931
5911.70439601148738-0.704396011487381
6032.313860231843170.686139768156828
6111.98760136116548-0.987601361165477
6211.74007328217773-0.740073282177726
6321.564032626424700.435967373575305
6432.180690826082860.819309173917141
6521.718637657181370.281362342818632
6621.789256634454890.210743365545111
6722.16083119968136-0.160831199681358
6842.037848861467451.96215113853255
6911.47917200345719-0.479172003457187
7022.13589063587092-0.135890635870919
7121.663138548852980.336861451147025
7221.672261468374570.327738531625431
7322.36163014823795-0.361630148237947
7422.56541853127178-0.565418531271781
7512.12322498877179-1.12322498877179
7622.09583020311535-0.0958302031153507
7721.740073282177730.259926717822274
7822.54679372351257-0.546793723512572
7921.870249599694010.129750400305991
8011.93367825143194-0.933678251431943
8142.140273797936141.85972620206386
8222.12395689911218-0.123956899112175
8331.943861665211561.05613833478844
8422.54453619937571-0.544536199375711
8511.87604985140840-0.876049851408404
8621.899061474999620.100938525000379
8721.784873472389670.215126527610334
8811.45142062240960-0.451420622409599
8922.74832458240955-0.748324582409546
9012.05103001290341-1.05103001290341
9121.933678251431940.0663217485680571
9211.68770014394739-0.687700143947393
9321.820550743080010.179449256919988
9421.663138548852980.336861451147025
9532.406430338449890.593569661550113
9642.801894750518721.19810524948128
9712.83792496283342-1.83792496283342
9832.627271184414860.372728815585143
9912.18858258072895-1.18858258072895
10012.14220639192215-1.14220639192215
10122.56103536920656-0.561035369206559
10211.79118922844090-0.791189228440896
10332.474598747644190.525401252355808
10422.09583020311535-0.0958302031153507
10522.16521436174658-0.165214361746581
10612.66874870681960-1.66874870681960
10722.21475796318168-0.214757963181677
10822.98183107547364-0.981831075473644
10912.46985899018782-1.46985899018782
11021.778876522966130.221123477033869
11121.596902733644680.403097266355323
11242.046290255447041.95370974455296
11332.050514508566580.949485491433424
11422.63165800024687-0.631658000246865
11552.299618586149182.70038141385082
11612.18226682467772-1.18226682467772
11722.26274793934679-0.262747939346788
11811.91526984967628-0.915269849676284
11922.44368360773509-0.443683607735091
12011.99059444940951-0.990594449409508
12111.81262485343725-0.812624853437255
12222.17788366261249-0.177883662612494
12322.66294845510520-0.662948455105203
12421.896424982146740.103575017853261
12531.672261468374571.32773853162543
12622.28575590917122-0.285755909171220
12711.97161304625915-0.97161304625915
12822.18226682467772-0.182266824677717
12921.831249661196460.168750338803536
13032.091090445658980.90890955434102
13122.69069983615279-0.690699836152791
13222.06965482066262-0.0696548206626204
13321.579850270713540.420149729286459
13411.78644947098452-0.786449470984525
13522.20563138989330-0.205631389893298
13622.04629025544704-0.0462902554470395
13721.780490310324440.219509689675557
13832.151332965210530.848667034789472
13912.44210760914023-1.44210760914023
14032.824418881246610.175581118753392
14142.392408752526241.60759124747376
14222.93191215908931-0.931912159089312
14353.322115185841781.67788481415822
14411.67226146837457-0.672261468374569
14522.36043311835911-0.360433118359110
14632.203702449674080.796297550325924
14722.22075491260521-0.220754912605212
14822.36623337007350-0.366233370073505
14931.841108144825231.15889185517477
15022.86093658642464-0.860936586424642
15112.28575590917122-1.28575590917122
15222.04629025544704-0.0462902554470395
15312.00835546061983-1.00835546061983
15421.890295150869180.109704849130824
15532.718963067770430.281036932229570
15622.14220639192215-0.142206391922149
15721.999914066640248.59333597585943e-05
15822.74832458240955-0.748324582409546
15943.038906182396890.961093817603105


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.3527159755659430.7054319511318870.647284024434057
110.2779638781190800.5559277562381590.72203612188092
120.1913929377435740.3827858754871470.808607062256426
130.1715694395671460.3431388791342930.828430560432854
140.1049493920519520.2098987841039030.895050607948048
150.3099620607953720.6199241215907450.690037939204628
160.2853256324061660.5706512648123330.714674367593834
170.2289604655540800.4579209311081610.77103953444592
180.2028491214264380.4056982428528760.797150878573562
190.1989061720885370.3978123441770730.801093827911463
200.3808741954529340.7617483909058680.619125804547066
210.3237918424354480.6475836848708960.676208157564552
220.2622758264226000.5245516528452010.7377241735774
230.3155388994427590.6310777988855190.68446110055724
240.256345932467020.512691864934040.74365406753298
250.2657396443900450.531479288780090.734260355609955
260.2161724491765730.4323448983531460.783827550823427
270.1837239525252370.3674479050504730.816276047474763
280.1427729104853410.2855458209706830.857227089514659
290.1156029251076190.2312058502152380.884397074892381
300.092822915640020.185645831280040.90717708435998
310.2272472262232290.4544944524464590.77275277377677
320.2057107454670170.4114214909340330.794289254532983
330.1961785549575840.3923571099151670.803821445042416
340.1604674302506720.3209348605013450.839532569749328
350.1515727210944880.3031454421889770.848427278905512
360.1403192774908590.2806385549817180.859680722509141
370.2918214166184210.5836428332368420.708178583381579
380.3701016814712180.7402033629424350.629898318528782
390.3227207186547770.6454414373095540.677279281345223
400.2857883306080090.5715766612160180.714211669391991
410.2417787215261820.4835574430523640.758221278473818
420.2914753046880450.582950609376090.708524695311955
430.2531121790285780.5062243580571560.746887820971422
440.3126327868304470.6252655736608940.687367213169553
450.2760396101485050.5520792202970110.723960389851495
460.2408157293624550.4816314587249110.759184270637544
470.4068775447010120.8137550894020250.593122455298988
480.3587081944549820.7174163889099630.641291805545018
490.3129412400446930.6258824800893850.687058759955308
500.2717955617175410.5435911234350830.728204438282459
510.2815857017953280.5631714035906570.718414298204672
520.2420131944655500.4840263889310990.75798680553445
530.2076875727590240.4153751455180470.792312427240977
540.2080041495618920.4160082991237840.791995850438108
550.267105051003120.534210102006240.73289494899688
560.2311505728169070.4623011456338150.768849427183093
570.1984785684169990.3969571368339980.801521431583001
580.1751109071483290.3502218142966570.824889092851671
590.1626486432699640.3252972865399280.837351356730036
600.1508601880807970.3017203761615940.849139811919203
610.1765958378159790.3531916756319570.823404162184021
620.1648931776231810.3297863552463630.835106822376819
630.1464950746997530.2929901493995060.853504925300247
640.1422117379352200.2844234758704400.85778826206478
650.1208715146090470.2417430292180930.879128485390953
660.1012898832765440.2025797665530880.898710116723456
670.08434204175896440.1686840835179290.915657958241036
680.2249037941631260.4498075883262510.775096205836874
690.1997030545635440.3994061091270890.800296945436455
700.1703302128581170.3406604257162330.829669787141883
710.1477571892794360.2955143785588720.852242810720564
720.1269777911727630.2539555823455260.873022208827237
730.1164760712922910.2329521425845830.883523928707709
740.1115138453645280.2230276907290560.888486154635472
750.1312946606817110.2625893213634210.86870533931829
760.1092456297623870.2184912595247730.890754370237613
770.090912781652180.181825563304360.90908721834782
780.08310386945158170.1662077389031630.916896130548418
790.06695859201897060.1339171840379410.93304140798103
800.07301429959065730.1460285991813150.926985700409343
810.1615974720522880.3231949441045760.838402527947712
820.1379467436643690.2758934873287370.862053256335631
830.1616417115898590.3232834231797170.838358288410141
840.1536897711639110.3073795423278230.846310228836089
850.1518447355944940.3036894711889870.848155264405506
860.1273055705384160.2546111410768320.872694429461584
870.1067648498439060.2135296996878110.893235150156094
880.09011174613894760.1802234922778950.909888253861052
890.0903055629862890.1806111259725780.90969443701371
900.1018086041052030.2036172082104050.898191395894797
910.082322458269050.16464491653810.91767754173095
920.07581982565114520.1516396513022900.924180174348855
930.06122710396505750.1224542079301150.938772896034943
940.04982624396511280.09965248793022560.950173756034887
950.04470299853874870.08940599707749750.955297001461251
960.06675114416205250.1335022883241050.933248855837947
970.1437776261289690.2875552522579380.856222373871031
980.1274273859399690.2548547718799390.87257261406003
990.1516280727115700.3032561454231400.84837192728843
1000.1782783317658860.3565566635317720.821721668234114
1010.1585837818492150.3171675636984310.841416218150785
1020.1579149494534630.3158298989069270.842085050546536
1030.1379509286333370.2759018572666730.862049071366663
1040.1143429735484930.2286859470969860.885657026451507
1050.0928340134038720.1856680268077440.907165986596128
1060.1548321122309000.3096642244617990.8451678877691
1070.1359557014342880.2719114028685750.864044298565712
1080.1512038010795060.3024076021590120.848796198920494
1090.2075729837877080.4151459675754170.792427016212292
1100.1835971060855660.3671942121711330.816402893914434
1110.1587787349865410.3175574699730810.84122126501346
1120.3996172413916850.7992344827833690.600382758608315
1130.4029647355563980.8059294711127960.597035264443602
1140.3611524863792750.722304972758550.638847513620725
1150.8015005418557130.3969989162885740.198499458144287
1160.8176038885781670.3647922228436650.182396111421833
1170.786769332503070.4264613349938590.213230667496929
1180.8357952533100340.3284094933799320.164204746689966
1190.8008959153959270.3982081692081460.199104084604073
1200.885396581595470.2292068368090600.114603418404530
1210.882601468556420.2347970628871610.117398531443580
1220.8706658369176770.2586683261646470.129334163082323
1230.8553990458630730.2892019082738530.144600954136927
1240.821783283835780.3564334323284380.178216716164219
1250.8879622957550880.2240754084898240.112037704244912
1260.8553606337984620.2892787324030770.144639366201538
1270.8607905773849360.2784188452301290.139209422615064
1280.8213592369285160.3572815261429670.178640763071484
1290.781943080703840.4361138385923190.218056919296159
1300.8546921809032690.2906156381934620.145307819096731
1310.8738395546236190.2523208907527620.126160445376381
1320.8335336299225640.3329327401548720.166466370077436
1330.8363308702007160.3273382595985670.163669129799284
1340.8079964263633430.3840071472733150.192003573636657
1350.7524124523595310.4951750952809390.247587547640469
1360.7047157103043910.5905685793912170.295284289695609
1370.6340694406714030.7318611186571930.365930559328597
1380.5705795837868580.8588408324262840.429420416213142
1390.6298439956840160.7403120086319680.370156004315984
1400.5621735370243490.8756529259513030.437826462975651
1410.7340371773821320.5319256452357360.265962822617868
1420.754942266713080.490115466573840.24505773328692
1430.7173995909280250.5652008181439490.282600409071975
1440.749234584511430.5015308309771380.250765415488569
1450.7100730230747330.5798539538505330.289926976925267
1460.7965975282568570.4068049434862850.203402471743143
1470.6872449370806540.6255101258386930.312755062919346
1480.5433110303237230.9133779393525530.456688969676277
1490.4564808859306060.9129617718612130.543519114069394


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 level20.0142857142857143OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/10z1z01292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/10z1z01292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/13sj91292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/13sj91292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/23sj91292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/23sj91292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/33sj91292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/33sj91292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/4ej0u1292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/4ej0u1292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/5ej0u1292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/5ej0u1292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/6ej0u1292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/6ej0u1292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/76shf1292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/76shf1292850509.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/8z1z01292850509.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/20/t1292850535yvprq5yusq63rgi/8z1z01292850509.ps (open in new window)


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