Home » date » 2010 » Dec » 02 »

Workshop 7 Multiple Linear Regression

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 02 Dec 2010 09:26:04 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q.htm/, Retrieved Thu, 02 Dec 2010 10:48:09 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q.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:
Member of Sports clu data
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 2 2 1 1 1 4 1 3 1 4 1 7 3 3 1 5 1 7 2 2 1 2 2 5 2 1 1 1 2 5 1 1 1 1 1 4 1 3 1 2 2 4 3 3 2 1 1 6 1 1 1 1 2 5 1 1 1 1 1 1 1 1 1 3 2 5 1 1 1 1 1 4 2 1 2 1 2 6 3 1 1 1 2 7 2 2 1 2 2 7 3 3 1 4 1 2 2 1 1 1 1 6 1 1 1 1 1 3 1 1 1 2 2 6 1 1 1 3 2 6 1 3 1 1 1 5 1 1 1 1 2 6 3 2 1 1 2 4 1 3 2 1 2 3 3 1 2 2 2 4 1 1 1 1 2 5 1 1 2 1 2 6 1 1 2 1 1 6 3 3 2 1 1 4 1 1 1 1 2 6 1 3 1 1 1 6 1 1 1 1 2 5 1 3 1 1 2 6 3 1 1 1 2 4 1 1 1 1 1 6 1 1 1 1 2 7 1 3 1 1 1 5 2 3 1 1 1 6 1 3 1 1 2 6 1 1 2 1 1 5 2 2 2 4 2 7 2 3 1 1 2 6 2 2 1 1 1 3 1 1 1 4 1 4 1 1 1 2 2 5 2 3 1 2 2 4 2 3 2 1 1 3 1 1 1 1 2 5 3 1 1 2 2 5 1 1 1 1 1 4 1 2 1 1 1 5 1 1 1 1 2 1 2 2 1 1 2 2 1 1 2 1 2 3 3 3 1 1 1 4 2 2 1 2 1 3 3 3 1 1 1 7 1 1 1 1 1 2 1 1 1 1 1 4 3 1 1 2 1 2 1 1 1 1 2 5 1 1 1 2 2 6 1 2 1 4 2 6 1 2 1 1 2 6 1 1 1 1 1 6 2 2 1 1 2 6 3 3 1 2 2 6 1 1 1 3 1 6 1 3 1 1 1 4 2 2 1 1 1 4 2 2 1 1 2 5 3 3 1 1 1 6 2 3 1 1 1 6 1 1 1 1 1 7 3 2 1 1 1 6 2 3 1 1 2 6 1 3 2 1 1 6 1 2 1 2 2 3 2 1 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 time10 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Member[t] = + 1.04782670721478 + 0.0729570089347279Provison[t] + 0.0654005174473116Mother[t] + 0.00562364643803958Father[t] + 0.063112559403901Illness[t] -0.0432767813249698Tobacco[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.047826707214780.2237464.68316e-063e-06
Provison0.07295700893472790.0278022.62420.0095780.004789
Mother0.06540051744731160.0539321.21270.2271560.113578
Father0.005623646438039580.0498860.11270.9103950.455197
Illness0.0631125594039010.117830.53560.5930060.296503
Tobacco-0.04327678132496980.04231-1.02290.3080120.154006


Multiple Linear Regression - Regression Statistics
Multiple R0.256259646347524
R-squared0.0656690063461582
Adjusted R-squared0.0347308939735144
F-TEST (value)2.12259253425637
F-TEST (DF numerator)5
F-TEST (DF denominator)151
p-value0.0657160719619755
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.489914985929934
Sum Squared Residuals36.2425207092478


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
121.574495857738010.42550414226199
211.31193163381913-0.311931633819132
311.61832691419297-0.618326914192972
411.67713309428253-0.677133094282532
521.568872211300010.431127788699995
621.503471693852690.496528306147307
711.39848519646908-0.398485196469075
821.635675572092570.364324427907431
911.57642870278742-0.576428702787422
1021.503471693852690.496528306147306
1111.12509009546384-0.125090095463842
1221.503471693852690.496528306147306
1311.55902776176918-0.559027761769178
1421.707229737682040.292770262317955
1521.677133094282530.322866905717469
1621.661603695517940.338396304482057
1711.35000118449582-0.350001184495821
1811.57642870278742-0.576428702787422
1911.31428089465827-0.314280894658268
2021.489875140137480.510124859862518
2121.58767599566350.412324004336499
2211.50347169385269-0.503471693852694
2321.712853384120080.287146615879916
2421.504874537197950.495125462802054
2521.508194488956790.491805511043208
2621.430514684917970.569485315082034
2721.566584253256600.433415746743405
2821.639541262191320.360458737808677
2911.78158958996203-0.781589589962025
3011.43051468491797-0.430514684917966
3121.58767599566350.412324004336499
3211.57642870278742-0.576428702787422
3321.514718986728770.485281013271227
3421.707229737682040.292770262317955
3521.430514684917970.569485315082034
3611.57642870278742-0.576428702787422
3721.660633004598230.339366995401771
3811.58011950417608-0.580119504176085
3911.5876759956635-0.587675995663501
4021.639541262191320.360458737808677
4111.50777807316704-0.507778073167037
4221.726033522045540.273966477954459
4321.647452866672770.352547133327227
4411.22772733200833-0.227727332008328
4511.38723790359300-0.387237903592996
4621.536842722851120.463157277148885
4721.570275054645260.429724945354742
4811.35755767598324-0.357557675983238
4921.590995947422350.409004052577653
5021.503471693852690.496528306147306
5111.43613833135601-0.436138331356005
5211.50347169385269-0.503471693852694
5321.282667821999130.717332178000867
5421.347713226452410.652286773547589
5521.499606003753940.50039399624606
5611.45826206747835-0.458262067478347
5711.49960600375394-0.49960600375394
5811.64938571172215-0.64938571172215
5911.28460066704851-0.284600667048510
6011.51803893848762-0.518038938487619
6111.28460066704851-0.284600667048510
6221.460194912527720.539805087472276
6321.452222005250550.547777994749448
6421.582052349225460.417947650774538
6521.576428702787420.423571297212578
6611.64745286667277-0.647452866672773
6721.675200249233150.324799750766846
6821.489875140137480.510124859862518
6911.5876759956635-0.587675995663501
7011.50153884880332-0.501538848803317
7111.50153884880332-0.501538848803317
7221.645520021623400.354479978376604
7311.65307651311081-0.653076513110813
7411.57642870278742-0.576428702787422
7511.78581039305481-0.785810393054812
7611.65307651311081-0.653076513110813
7721.650788555067400.349211444932598
7811.53877556790049-0.538775567900492
7921.422958193430550.577041806569451
8021.580119504176080.419880495823915
8121.653076513110810.346923486889187
8221.507162495241360.492837504758643
8311.64552002162340-0.645520021623396
8421.712853384120080.287146615879916
8521.647452866672770.352547133327227
8611.36880496885932-0.368804968859317
8721.609799731785840.390200268214157
8821.503471693852690.496528306147306
8911.57642870278742-0.576428702787422
9011.43051468491797-0.430514684917966
9121.714786229169460.285213770830539
9221.574495857738050.425504142261955
9321.604176085347800.395823914652197
9411.64745286667277-0.647452866672773
9521.479969387810930.520030612189066
9611.71249827112605-0.712498271126051
9721.653076513110810.346923486889187
9811.64745286667277-0.647452866672773
9911.67520024923315-0.675200249233154
10021.576428702787420.423571297212578
10121.198047104398570.80195289560143
10211.43051468491797-0.430514684917966
10321.572563012688670.427436987311332
10421.653076513110810.346923486889187
10511.55896645897346-0.558966458973456
10611.70722973768204-0.707229737682045
10711.58205234922546-0.582052349225461
10811.34771322645241-0.347713226452411
10921.72040987560750.279590124392499
11011.21726730455182-0.217267304551821
11111.43051468491797-0.430514684917966
11211.24501468711220-0.245014687112202
11311.60417608534780-0.604176085347803
11421.517622522697860.482377477302136
11511.52324616913590-0.523246169135903
11621.72040987560750.279590124392499
11711.5876759956635-0.587675995663501
11821.430514684917970.569485315082034
11921.572563012688670.427436987311332
12011.44659835881251-0.446598358812513
12111.69738528815122-0.697385288151218
12221.649385711722150.35061428827785
12321.430514684917970.569485315082034
12411.50153884880332-0.501538848803317
12521.560899304022830.439100695977166
12621.780186746616770.219813253383227
12721.503471693852690.496528306147306
12821.712853384120080.287146615879916
12911.58073508210176-0.580735082101765
13021.588646686583210.411353313416785
13121.580119504176080.419880495823915
13221.606108930397180.39389106960282
13321.572563012688670.427436987311332
13411.59855243890976-0.598552438909764
13511.71847703055812-0.718477030558124
13621.633856312957560.366143687042438
13721.675200249233150.324799750766846
13821.675200249233150.324799750766846
13921.509095340290730.490904659709266
14011.56887221130001-0.568872211300005
14121.460194912527720.539805087472276
14221.653076513110810.346923486889187
14321.727065515760980.272934484239024
14411.68046878267716-0.68046878267716
14511.43613833135601-0.436138331356005
14621.647452866672770.352547133327227
14721.604176085347800.395823914652197
14821.649385711722150.35061428827785
14911.53315192146245-0.533151921462452
15021.655009358160190.34499064183981
15121.499250890759910.500749109240094
15221.582052349225460.417947650774538
15311.57256301268867-0.572563012688668
15411.43051468491797-0.430514684917966
15521.780186746616770.219813253383227
15611.43613833135601-0.436138331356005
15721.843299306020670.156700693979326


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.2594128849274120.5188257698548250.740587115072588
100.2047083239781470.4094166479562940.795291676021853
110.5251921103917270.9496157792165450.474807889608273
120.4771972147146610.9543944294293220.522802785285339
130.4712780755796620.9425561511593230.528721924420338
140.3832373049857930.7664746099715860.616762695014207
150.3871212383219160.7742424766438330.612878761678084
160.4368278995548170.8736557991096340.563172100445183
170.5551230021928420.8897539956143160.444876997807158
180.5808549727167020.8382900545665960.419145027283298
190.5052689209358580.9894621581282850.494731079064142
200.6222698496175790.7554603007648420.377730150382421
210.5745573168816480.8508853662367040.425442683118352
220.5842144036263720.8315711927472570.415785596373628
230.5133916371980330.9732167256039330.486608362801967
240.5132443578792640.9735112842414720.486755642120736
250.5130786705929970.9738426588140060.486921329407003
260.526493639362540.947012721274920.47350636063746
270.4841397468331410.9682794936662810.515860253166859
280.4283331886428140.8566663772856280.571666811357186
290.6063590565443490.7872818869113030.393640943455651
300.604465694016920.791068611966160.39553430598308
310.5744301717812970.8511396564374050.425569828218703
320.6117576162935920.7764847674128160.388242383706408
330.5908180509555620.8183638980888770.409181949044438
340.5462104769243430.9075790461513140.453789523075657
350.5489069955974580.9021860088050840.451093004402542
360.58014818671630.83970362656740.4198518132837
370.5375709412165980.9248581175668040.462429058783402
380.5831619505484870.8336760989030250.416838049451513
390.6108846100763040.7782307798473910.389115389923696
400.5745969401505160.8508061196989690.425403059849484
410.5627044276516940.8745911446966120.437295572348306
420.5215115852622340.9569768294755330.478488414737766
430.4883139020612530.9766278041225060.511686097938747
440.4417363549651110.8834727099302230.558263645034889
450.4179572943959240.8359145887918480.582042705604076
460.4129643441361130.8259286882722250.587035655863887
470.3896278791235960.7792557582471920.610372120876404
480.3702707052500820.7405414105001640.629729294749918
490.3524333998008320.7048667996016650.647566600199168
500.3487615647752140.6975231295504280.651238435224786
510.343837442048460.687674884096920.65616255795154
520.3503369781328390.7006739562656770.649663021867162
530.3836905056356220.7673810112712440.616309494364378
540.4153206763178150.830641352635630.584679323682185
550.3975590153761250.795118030752250.602440984623875
560.3975499392117650.795099878423530.602450060788235
570.429100907151810.858201814303620.57089909284819
580.4645087826787180.9290175653574350.535491217321282
590.4352816361781090.8705632723562170.564718363821891
600.4412587105672390.8825174211344790.558741289432761
610.4105753571425460.8211507142850930.589424642857454
620.4306867516857570.8613735033715150.569313248314243
630.4615449847981250.923089969596250.538455015201875
640.4457126947509680.8914253895019370.554287305249032
650.4312310979339320.8624621958678640.568768902066068
660.4695322784881210.9390645569762420.530467721511879
670.4418656250948520.8837312501897030.558134374905148
680.4470481199527990.8940962399055970.552951880047201
690.4688629605836240.9377259211672480.531137039416376
700.4691394694766040.9382789389532090.530860530523396
710.4686109860470830.9372219720941660.531389013952917
720.4466857593864980.8933715187729950.553314240613502
730.4801482880092080.9602965760184160.519851711990792
740.4984547216279560.9969094432559110.501545278372044
750.5671328973514890.8657342052970210.432867102648511
760.5989673171153610.8020653657692770.401032682884639
770.5890755766483320.8218488467033350.410924423351668
780.5988325509320680.8023348981358630.401167449067932
790.6180677185757990.7638645628484030.381932281424201
800.6084210397879130.7831579204241740.391578960212087
810.586815613077320.826368773845360.41318438692268
820.590999870331350.81800025933730.40900012966865
830.6195474794299090.7609050411401830.380452520570091
840.5901058176023810.8197883647952380.409894182397619
850.5674624223248380.8650751553503230.432537577675162
860.5433479700489330.9133040599021340.456652029951067
870.5259731097648320.9480537804703370.474026890235168
880.5256437124528770.9487125750942460.474356287547123
890.5461433865200180.9077132269599640.453856613479982
900.5357745019671530.9284509960656950.464225498032847
910.5014055566043640.9971888867912720.498594443395636
920.4890470744401370.9780941488802750.510952925559863
930.4698577106511450.939715421302290.530142289348855
940.5066303459024290.9867393081951430.493369654097571
950.5090727776059440.9818544447881130.490927222394056
960.5468586399193430.9062827201613140.453141360080657
970.5215847768388250.9568304463223510.478415223161175
980.5613450753706780.8773098492586430.438654924629322
990.604369893227560.791260213544880.39563010677244
1000.5861118369534290.8277763260931430.413888163046571
1010.6962876143299660.6074247713400680.303712385670034
1020.6819367712077280.6361264575845440.318063228792272
1030.6739166246791190.6521667506417630.326083375320881
1040.645433616254810.7091327674903790.354566383745190
1050.651739037342030.6965219253159390.348260962657970
1060.7246902005136030.5506195989727940.275309799486397
1070.7553800272565920.4892399454868150.244619972743408
1080.7255790815104490.5488418369791020.274420918489551
1090.6881215950397450.6237568099205090.311878404960254
1100.6443998346575390.7112003306849230.355600165342461
1110.6352552733576830.7294894532846330.364744726642317
1120.5891543400935020.8216913198129960.410845659906498
1130.6335962585479690.7328074829040630.366403741452031
1140.6367874469840130.7264251060319730.363212553015987
1150.6361477918203440.7277044163593130.363852208179656
1160.5900862722205640.8198274555588710.409913727779436
1170.6553627190652480.6892745618695030.344637280934752
1180.6777240016066670.6445519967866660.322275998393333
1190.6675990158195330.6648019683609350.332400984180467
1200.669480336899920.6610393262001610.330519663100081
1210.6778613383540920.6442773232918150.322138661645908
1220.6319307907735220.7361384184529570.368069209226478
1230.6644121863390450.671175627321910.335587813660955
1240.6570889632956670.6858220734086660.342911036704333
1250.6333154383199950.733369123360010.366684561680005
1260.5762968709649270.8474062580701470.423703129035073
1270.5754718486809090.8490563026381820.424528151319091
1280.5198377395918990.9603245208162020.480162260408101
1290.5436426065299410.9127147869401180.456357393470059
1300.4957660760183860.9915321520367710.504233923981614
1310.471646602964080.943293205928160.52835339703592
1320.4228875576199650.845775115239930.577112442380035
1330.4428549116456460.8857098232912930.557145088354354
1340.5104909871256350.979018025748730.489509012874365
1350.6189054145443880.7621891709112250.381094585455612
1360.5516682563417690.8966634873164620.448331743658231
1370.4900243825122770.9800487650245540.509975617487723
1380.4480300387208370.8960600774416750.551969961279163
1390.4521394555600860.9042789111201710.547860544439914
1400.49963472886230.99926945772460.5003652711377
1410.6087703950012380.7824592099975250.391229604998762
1420.5549406712413650.890118657517270.445059328758635
1430.5157614865210940.9684770269578110.484238513478906
1440.8516102378534370.2967795242931250.148389762146562
1450.7812672914700780.4374654170598450.218732708529922
1460.6997388649732730.6005222700534540.300261135026727
1470.8663632008466640.2672735983066730.133636799153336
1480.7363883560698540.5272232878602910.263611643930146


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 level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/10wq3e1291281952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/10wq3e1291281952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/11y661291281952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/11y661291281952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/21y661291281952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/21y661291281952.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/5b7591291281952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/5b7591291281952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/6mhmu1291281952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283274dpjzh2q7wwj1p7q/6mhmu1291281952.ps (open in new window)


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


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


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