Home » date » 2010 » Nov » 23 »

Multiple Regression_1

*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: Tue, 23 Nov 2010 09:48: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/Nov/23/t1290505809huz9ba60pjk8a2f.htm/, Retrieved Tue, 23 Nov 2010 10:50:21 +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/Nov/23/t1290505809huz9ba60pjk8a2f.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 «
1 3 4 4 2 1 3 2 2 2 1 3 5 5 4 1 5 4 5 3 2 3 1 1 2 1 2 2 4 1 4 3 5 6 4 1 2 1 5 3 1 2 3 4 1 2 3 5 5 4 1 7 2 7 4 1 4 2 2 4 2 6 2 7 3 1 2 2 5 4 1 4 1 5 1 1 4 4 7 4 1 2 3 3 1 1 6 6 6 4 1 1 1 2 4 2 3 3 6 3 1 2 2 1 2 2 5 5 5 6 1 3 5 4 5 2 5 3 4 4 1 1 3 7 6 1 7 5 7 1 1 2 5 5 2 2 5 4 6 4 1 5 2 5 4 1 1 1 1 1 2 4 4 6 2 1 5 6 4 1 1 2 2 2 2 1 1 3 2 2 1 5 2 6 2 2 7 4 6 6 1 4 2 6 2 1 1 1 1 1 1 5 5 6 4 1 5 5 6 3 1 1 1 1 3 1 6 1 1 1 1 5 2 7 4 1 5 4 2 3 1 3 5 3 4 1 4 3 5 3 1 4 3 3 2 1 4 1 4 1 1 5 2 2 5 1 3 3 3 4 2 2 2 7 1 2 6 5 7 2 1 1 4 5 4 1 4 4 1 3 1 3 2 2 2 2 3 3 5 3 1 6 6 2 3 1 3 2 4 2 2 5 3 7 2 1 2 2 2 4 1 4 5 5 4 1 3 5 6 2 1 2 5 3 2 1 6 6 7 5 2 5 4 4 4 1 5 2 3 5 1 4 5 5 5 2 1 2 3 2 1 3 1 2 3 1 4 6 6 4 1 2 6 6 2 1 5 3 5 2 1 2 4 2 2 3 4 5 3 5 2 2 2 4 2 2 5 4 6 3 1 3 3 5 2 1 1 2 2 2 1 5 2 5 2 1 2 3 2 2 1 2 3 1 2 1 2 7 2 1 1 5 2 4 3 1 5 2 5 3 1 2 2 5 3 1 4 5 3 3 1 2 1 2 1 3 6 5 7 4 1 1 2 1 1 1 1 1 5 1 1 4 2 5 1 1 2 2 2 3 1 4 0 6 2 1 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 time14 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Depressed[t] = + 0.740696636831173 + 0.00475423720840306`high-strung`[t] + 0.0425359188269914cannotdo[t] + 0.0431590863474944worrytoomuch[t] + 0.0696672775570097limitactivity[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.7406966368311730.1447485.11711e-060
`high-strung`0.004754237208403060.0325560.1460.8840890.442044
cannotdo0.04253591882699140.0292141.4560.1474580.073729
worrytoomuch0.04315908634749440.0289421.49120.1379770.068989
limitactivity0.06966727755700970.0362661.9210.05660.0283


Multiple Linear Regression - Regression Statistics
Multiple R0.30396767880756
R-squared0.092396349759656
Adjusted R-squared0.0685120431743836
F-TEST (value)3.86849622072053
F-TEST (DF numerator)4
F-TEST (DF denominator)152
p-value0.00506294335989188
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.553042530641777
Sum Squared Residuals46.4901181861965


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
111.23707392426831-0.237073924268314
211.06568391391937-0.0656839139193697
311.46210348455685-0.462103484556846
411.35940876258965-0.359408762589649
520.9799889087448851.02001109125511
611.07758057184895-0.0775805718489468
741.505262570904342.49473742909566
811.21753829448347-0.217538294483469
911.12011649067594-0.120116490675938
1021.462103484556850.537896515443153
1111.43983084960447-0.439830849604475
1211.20977270624179-0.209772706241793
1321.365409334839060.634590665160938
1411.32974149086747-0.32974149086747
1511.08771221378626-0.0877122137862561
1611.51063997563325-0.510639975633248
1711.07695740432844-0.0769574043284435
1811.56206120135654-0.562061201356542
1911.15297407578959-0.152974075789592
2021.350523455693350.64947654430665
2111.01777059036347-0.0177705903634728
2221.610946514087670.389053485912327
2311.48861167576636-0.488611675766362
2421.343381034972180.656618965027824
2511.59317590029507-0.593175900295067
2611.35843677341442-0.358436773414419
2711.31801469223442-0.318014692234425
2821.472235126494160.527764873505843
2911.34400420249268-0.344004202492679
3010.9008131567710690.0991868432289313
3121.328146334171730.671853665828266
3211.26198695878212-0.261986958782121
3311.06092967671097-0.0609296767109673
3411.09871135832956-0.0987113583295556
3511.24782873372615-0.247828733726155
3621.621078156024980.378921843975018
3711.24307449651775-0.243074496517752
3810.9008131567710690.0991868432289313
3911.51477104532115-0.514771045321148
4011.44510376776414-0.445103767764138
4111.04014771188509-0.0401477118850881
4210.9245843428130840.0754156571869161
4311.43032237518767-0.430322375187669
4411.22993150354717-0.229931503547169
4511.37578531186186-0.375785311861858
4611.31211860655426-0.312118606554258
4711.15613315630226-0.156133156302259
4811.04455312743876-0.0445531274387615
4911.28419422100721-0.284194221007205
5011.29071347420788-0.290713474207875
5121.207057830891430.79294216910857
5221.423349813763030.576650186236974
5311.41005909131305-0.41005909131305
5411.18201817999127-0.182018179991271
5511.06568391391937-0.0656839139193703
5621.307364369345860.692635630654145
5711.31975757840955-0.319757578409554
5811.15200208661436-0.152002086614359
5921.333523738900640.66647626109936
6011.20026423182499-0.200264231824987
6111.46685772176525-0.46685772176525
6211.36592801579032-0.365928015790322
6311.23169651953944-0.231696519539436
6411.67488756526105-0.674887565261047
6521.385916953799170.614083046200832
6611.3273533073547-0.3273533073547
6711.53652499932226-0.53652499932226
6821.099334525850060.90066547414994
6911.09281527264939-0.0928152726493887
7011.55255272693974-0.552552726939736
7111.40370969740891-0.403709697408911
7211.24720556620565-0.247205566205651
7311.14600151436495-0.14600151436495
7431.450206826627271.54979317337273
7521.147247849405960.852752150594044
7621.402567848937150.597432151062853
7711.23769709178885-0.237697091788845
7811.05617543950256-0.0561754395025643
7911.20466964737866-0.20466964737866
8011.10346559553796-0.103465595537959
8111.06030650919046-0.0603065091904641
8211.20394199328891-0.203941993288914
8311.23117783858818-0.231177838588175
8411.27433692493567-0.27433692493567
8511.26007421331046-0.260074213310461
8611.31087227151325-0.310872271513251
8710.9487264803269660.0512735196730337
8831.562684368877051.43731563112295
8910.943349075598060.05665092440194
9011.07344950216105-0.073449502161047
9111.13024813261325-0.130248132613247
9211.13059695426798-0.130596954267977
9311.15800265886377-0.158002658863769
9411.26295894795735-0.262958947957354
9511.45620739887668-0.456207398876680
9611.17375604061547-0.173756040615472
9711.18916060071244-0.189160600712445
9811.20466964737866-0.20466964737866
9911.27909116214407-0.279091162144073
10021.424321802938260.575678197061741
10111.33036465838797-0.330364658387973
10211.40194468141664-0.401944681416644
10311.28498724782424-0.284987247824240
10421.487639686591130.512360313408871
10511.13059695426798-0.130596954267977
10621.471611958973650.528388041026347
10721.162133728551670.837866271448331
10831.439452017169461.56054798283054
10921.332277403859630.667722596140366
11021.280856178136340.71914382186366
11111.47223512649416-0.472235126494157
11211.40291667059188-0.402916670591876
11310.9647542079444430.0352457920555574
11410.9871313294660580.0128686705339421
11511.65348243291466-0.653482432914664
11611.20581149585042-0.205811495850424
11711.06092967671097-0.0609296767109673
11821.242346842428010.757653157571994
11911.33800363024327-0.33800363024327
12011.33290057138014-0.332900571380137
12111.42432180293826-0.424321802938259
12210.9865081619455550.0134918380544454
12311.42369863541776-0.423698635417756
12411.17313287309497-0.173132873094968
12510.9912623991539580.00873760084604235
12611.23294285458044-0.232942854580442
12711.49874331770367-0.498743317703672
12821.358785595069150.641214404930851
12921.379567559895030.620432440104972
13011.01777059036347-0.0177705903634728
13111.33924996528428-0.339249965284276
13211.33924996528428-0.339249965284276
13311.32498725365907-0.324987253659067
13441.387163288840172.61283671115983
13511.47161195897365-0.471611958973653
13621.344004202492680.65599579750732
13711.28085617813634-0.28085617813634
13811.50939364059224-0.509393640592242
13911.28974148503264-0.289741485032643
14011.42334981376303-0.423349813763026
14110.9008131567710690.0991868432289313
14211.17375604061547-0.173756040615472
14311.19991541017026-0.199915410170257
14411.11598542098804-0.115985420988038
14511.49239392379953-0.492393923799533
14611.21691512696297-0.216915126962966
14711.06092967671097-0.0609296767109673
14821.308959526041590.691040473958409
14911.31801469223442-0.318014692234425
15011.45145316166828-0.451453161668277
15131.504639403383841.49536059661616
15211.07344950216105-0.073449502161047
15311.07043815112777-0.0704381511277733
15411.23294285458044-0.232942854580442
15511.08743786792048-0.0874378679204824
15621.285959236999470.714040763000528
15711.48465046537499-0.484650465374994


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.9998939963765650.0002120072468691410.000106003623434570
90.9996713637107920.000657272578415560.00032863628920778
100.9992849619836390.001430076032721780.000715038016360892
110.9984307981596360.003138403680727320.00156920184036366
120.9981334380717830.003733123856434960.00186656192821748
130.9987106243978870.002578751204225540.00128937560211277
140.9985236434156730.002952713168653520.00147635658432676
150.9971910035396270.00561799292074650.00280899646037325
160.9973706780027030.005258643994593450.00262932199729672
170.9955231387657420.00895372246851640.0044768612342582
180.9956312843951030.008737431209795020.00436871560489751
190.9935229520939840.01295409581203240.00647704790601622
200.9926748726400920.01465025471981660.0073251273599083
210.9883075652945340.02338486941093280.0116924347054664
220.9834887956252040.03302240874959260.0165112043747963
230.9838794829323650.03224103413526920.0161205170676346
240.9847140059467430.03057198810651500.0152859940532575
250.984565689498690.03086862100262170.0154343105013109
260.981241609286710.0375167814265810.0187583907132905
270.9756873149893550.04862537002129080.0243126850106454
280.9726050582086180.05478988358276310.0273949417913816
290.9660530273713090.06789394525738240.0339469726286912
300.9532921243216440.09341575135671240.0467078756783562
310.955644497554850.08871100489029950.0443555024451498
320.9457966905151780.1084066189696450.0542033094848224
330.9284596518398570.1430806963202860.071540348160143
340.9078755672899620.1842488654200750.0921244327100375
350.8868260648841080.2263478702317840.113173935115892
360.8664461514450360.2671076971099290.133553848554964
370.8387270436482440.3225459127035120.161272956351756
380.8036211394957010.3927577210085980.196378860504299
390.799567716455990.4008645670880190.200432283544009
400.7829939998703450.4340120002593090.217006000129655
410.7425681720479890.5148636559040230.257431827952011
420.6976460251544220.6047079496911550.302353974845578
430.6737732174546310.6524535650907390.326226782545369
440.6367874345225260.7264251309549480.363212565477474
450.6110130535858530.7779738928282950.388986946414147
460.5740063373909850.851987325218030.425993662609015
470.5258895676521190.9482208646957620.474110432347881
480.4744076382746140.9488152765492280.525592361725386
490.4374212867954960.8748425735909910.562578713204504
500.3998827906836350.799765581367270.600117209316365
510.443702346525710.887404693051420.55629765347429
520.4459922050627790.8919844101255590.554007794937221
530.4229032079738100.8458064159476210.57709679202619
540.3777755770973230.7555511541946470.622224422902677
550.3318090426809320.6636180853618640.668190957319068
560.3555662056312580.7111324112625160.644433794368742
570.3215482960378180.6430965920756350.678451703962182
580.2825722118122250.565144423624450.717427788187775
590.2942520825671520.5885041651343040.705747917432848
600.257804163235250.51560832647050.74219583676475
610.2432685079216380.4865370158432750.756731492078362
620.2233309270329910.4466618540659820.776669072967009
630.1930738246055080.3861476492110160.806926175394492
640.2024453142780780.4048906285561570.797554685721922
650.217678685197870.435357370395740.78232131480213
660.194960894225190.389921788450380.80503910577481
670.1891248006848600.3782496013697190.81087519931514
680.2441524873910670.4883049747821330.755847512608933
690.2097892577788410.4195785155576820.790210742221159
700.2059083559005210.4118167118010420.794091644099479
710.1884406172522110.3768812345044220.811559382747789
720.1646414041547970.3292828083095940.835358595845203
730.1385258118285630.2770516236571270.861474188171437
740.4085178507436350.817035701487270.591482149256365
750.4661567345153230.9323134690306460.533843265484677
760.472145303667290.944290607334580.52785469633271
770.4347952073539730.8695904147079460.565204792646027
780.3899110434617470.7798220869234950.610088956538253
790.3524660817490380.7049321634980770.647533918250962
800.311289695903940.622579391807880.68871030409606
810.2715414363085860.5430828726171720.728458563691414
820.2395036774670380.4790073549340750.760496322532962
830.2107861035383010.4215722070766030.789213896461699
840.1865118430507350.3730236861014710.813488156949265
850.1633083700903170.3266167401806340.836691629909683
860.1450414160116410.2900828320232820.854958583988359
870.1201445661379970.2402891322759950.879855433862003
880.3020381584633740.6040763169267480.697961841536626
890.2625237541563660.5250475083127330.737476245843634
900.2271010094448690.4542020188897380.772898990555131
910.1949611693839470.3899223387678940.805038830616053
920.166179591848220.332359183696440.83382040815178
930.1409050989289950.2818101978579900.859094901071005
940.1239871974784460.2479743949568910.876012802521554
950.1159277089315450.2318554178630910.884072291068455
960.09655424016209470.1931084803241890.903445759837905
970.08030623565926330.1606124713185270.919693764340737
980.06578938992094780.1315787798418960.934210610079052
990.05516351187317840.1103270237463570.944836488126822
1000.05513396708022230.1102679341604450.944866032919778
1010.04598346631986140.09196693263972280.954016533680139
1020.04098303780014020.08196607560028040.95901696219986
1030.03373624421114570.06747248842229140.966263755788854
1040.03168847184436850.0633769436887370.968311528155631
1050.0247335506038730.0494671012077460.975266449396127
1060.02322068017588250.0464413603517650.976779319824117
1070.03286665768609990.06573331537219990.9671333423139
1080.1344726666472890.2689453332945790.86552733335271
1090.1460427548829490.2920855097658970.853957245117051
1100.1649587252450150.3299174504900290.835041274754985
1110.1523409558084650.3046819116169290.847659044191535
1120.1369909251993560.2739818503987120.863009074800644
1130.1106947913875650.221389582775130.889305208612435
1140.0879783672591310.1759567345182620.912021632740869
1150.0956464789568130.1912929579136260.904353521043187
1160.0765191281352550.153038256270510.923480871864745
1170.05939019465426260.1187803893085250.940609805345737
1180.090353755216050.18070751043210.90964624478395
1190.07798539060545130.1559707812109030.922014609394549
1200.0644141700423720.1288283400847440.935585829957628
1210.05851432810338880.1170286562067780.941485671896611
1220.04472396385286730.08944792770573460.955276036147133
1230.03961941239678070.07923882479356130.96038058760322
1240.02989431913377340.05978863826754680.970105680866227
1250.02162822766874710.04325645533749410.978371772331253
1260.01561475168042450.0312295033608490.984385248319575
1270.01906668793819200.03813337587638410.980933312061808
1280.01902022813831230.03804045627662450.980979771861688
1290.02540495438556970.05080990877113940.97459504561443
1300.01773649792394420.03547299584788830.982263502076056
1310.01812145898405720.03624291796811440.981878541015943
1320.02083887363657470.04167774727314940.979161126363425
1330.02588245077504760.05176490155009510.974117549224952
1340.7969161182208520.4061677635582950.203083881779148
1350.7836551705867310.4326896588265380.216344829413269
1360.8234053300479040.3531893399041920.176594669952096
1370.76778382074670.4644323585066000.232216179253300
1380.7945576334928140.4108847330143720.205442366507186
1390.73197760566310.5360447886738010.268022394336900
1400.6716202012185920.6567595975628160.328379798781408
1410.590921008927420.818157982145160.40907899107258
1420.5274425597487880.9451148805024250.472557440251212
1430.4604496663361070.9208993326722150.539550333663893
1440.3838058399691280.7676116799382560.616194160030872
1450.2918448633027630.5836897266055270.708155136697237
1460.2159242427915520.4318484855831030.784075757208448
1470.1397875080368570.2795750160737140.860212491963143
1480.0874613170164230.1749226340328460.912538682983577
1490.05247181098189990.1049436219638000.9475281890181


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level110.0774647887323944NOK
5% type I error level290.204225352112676NOK
10% type I error level430.302816901408451NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/10dwut1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/10dwut1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/1odx01290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/1odx01290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/2hmxl1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/2hmxl1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/3hmxl1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/3hmxl1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/4hmxl1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/4hmxl1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/5aewn1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/5aewn1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/6aewn1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/6aewn1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/7kndq1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/7kndq1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/8dwut1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/8dwut1290505703.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/9dwut1290505703.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290505809huz9ba60pjk8a2f/9dwut1290505703.ps (open in new window)


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