Home » date » 2010 » Nov » 24 »

WS7 Multiple

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Wed, 24 Nov 2010 00:25:48 +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/24/t1290558279rs5z7410wllese4.htm/, Retrieved Wed, 24 Nov 2010 01:24:50 +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/24/t1290558279rs5z7410wllese4.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 1 3 4 2 1 1 1 3 3 3 1 2 2 3 3 4 2 4 1 3 5 3 2 1 1 3 4 2 2 4 1 3 1 2 3 1 3 5 3 1 1 1 1 5 2 1 1 1 3 2 3 1 2 4 2 2 5 2 3 5 3 1 3 1 3 3 2 1 1 1 2 4 4 1 2 1 3 4 1 1 2 1 3 4 2 2 5 2 3 4 4 2 2 1 3 5 2 1 2 1 3 3 3 2 2 1 3 5 3 1 2 1 3 3 3 2 3 1 3 4 1 1 3 1 3 4 3 2 3 2 3 4 3 2 1 1 3 3 2 1 1 2 3 5 2 2 4 1 2 4 2 1 1 4 3 5 2 1 3 1 3 2 4 1 2 1 2 5 3 2 1 1 3 4 1 2 2 1 3 5 2 2 1 1 3 4 1 1 2 1 3 5 3 2 1 1 2 3 2 1 1 1 3 3 1 1 1 1 3 4 3 2 1 1 3 4 2 1 3 1 3 5 3 2 3 1 1 5 1 1 1 1 3 3 3 2 3 1 2 5 3 1 1 1 3 5 2 2 2 1 3 4 3 1 3 1 3 5 3 1 2 1 2 3 3 2 1 3 2 4 3 1 1 2 3 5 3 1 1 1 3 3 3 1 1 1 3 5 2 2 1 1 3 4 2 1 3 2 2 3 3 2 2 1 2 5 1 2 2 1 3 4 3 1 2 1 2 5 3 1 4 1 3 3 1 1 3 1 3 5 1 2 3 1 3 4 1 1 3 1 2 5 4 2 1 1 3 4 3 2 3 1 3 5 1 1 1 1 3 5 2 1 1 2 3 5 4 2 1 1 3 4 3 1 1 1 2 5 3 2 3 1 3 4 2 2 3 1 3 5 3 1 1 1 2 4 3 1 1 1 3 3 3 1 2 1 3 4 2 1 2 2 3 3 3 2 1 1 2 5 2 1 4 1 2 4 3 2 3 1 3 4 1 1 2 1 2 4 3 1 1 1 3 4 2 1 1 1 3 4 2 2 3 1 3 3 4 2 2 1 3 4 2 1 1 1 3 3 3 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 time12 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
Gender[t] = + 3.78655833907257 -0.102045310896942Weight[t] -0.174659926437502Drugs[t] -0.0207654197460563Sports[t] -0.207471195750587Vegetables[t] + 0.27079311874039`Alcohol `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.786558339072570.4415888.574900
Weight-0.1020453108969420.069263-1.47330.142710.071355
Drugs-0.1746599264375020.085561-2.04130.0429240.021462
Sports-0.02076541974605630.081789-0.25390.7999180.399959
Vegetables-0.2074711957505870.06821-3.04170.0027660.001383
`Alcohol `0.270793118740390.0987042.74350.0068010.0034


Multiple Linear Regression - Regression Statistics
Multiple R0.513150770489091
R-squared0.263323713253547
Adjusted R-squared0.239405651995546
F-TEST (value)11.0094087649121
F-TEST (DF numerator)5
F-TEST (DF denominator)154
p-value4.47475256848406e-09
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.861618664997342
Sum Squared Residuals114.327555476257


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
112.95516767518455-1.95516767518455
213.63752261146938-2.63752261146938
313.6316104928753-2.6316104928753
422.91644428727736-0.916444287277362
523.15925829697839-1.15925829697839
623.47553595153933-1.47553595153933
732.705085681621470.294914318378529
813.26187673024706-2.26187673024706
912.76738194085964-1.76738194085964
1022.49175666184553-0.491756661845531
1132.379966117017930.620033882982073
1233.17365905675049-0.17365905675049
1322.51482269722795-0.514822697227954
1433.03880247654046-0.0388024765404633
1532.491756661845530.508243338154469
1632.494057277481900.505942722518103
1732.762097239206020.237902760793982
1832.770762514816340.229237485183657
1932.587437312768510.412562687231485
2032.563291319065760.436708680934245
2132.831331280789880.168668719210124
2232.732039126909200.267960873090797
2332.876188399669990.123811600330012
2433.44445217549088-0.44445217549088
2532.326389427958790.673610572041214
2623.88399310207472-1.88399310207472
2732.554626043455430.44537395654457
2832.718913319021840.281086680978161
2922.77414308877305-0.774143088773045
3033.01803705679441-0.0180370567944066
3132.948803015210550.0511969847894516
3233.03880247654046-0.0388024765404633
3332.774143088773050.225856911226955
3423.17365905675049-1.17365905675049
3533.34831898318799-0.348318983187993
3632.876188399669990.123811600330012
3732.656671354352370.343328645647627
3832.359200697271870.64079930272813
3913.14422836139411-2.14422836139411
4032.563291319065760.436708680934245
4122.7949085085191-0.794908508519102
4232.741331819459960.258668180540039
4332.482011427914870.517988572085131
4432.587437312768510.412562687231485
4523.51981994804771-1.51981994804771
4623.16774693815643-1.16774693815643
4732.79490850851910.205091491480898
4832.998999130312990.00100086968701296
4932.948803015210550.0511969847894516
5032.927464473092760.0725355269072376
5122.77076251481634-0.770762514816343
5222.91599174589746-0.915991745897464
5332.689482623665460.310517376334543
5422.17249492126734-0.172494921267340
5532.933376591686820.0666234083131816
5632.708520550146880.291479449853123
5732.831331280789880.168668719210124
5822.59948316233554-0.599483162335542
5932.461246008168810.538753991831187
6033.14422836139411-0.144228361394108
6133.24036155369699-0.240361553696995
6232.599483162335540.400516837664458
6332.896953819416040.103046180583956
6422.35920069727187-0.359200697271870
6532.635905934606320.364094065393684
6632.79490850851910.205091491480898
6722.89695381941604-0.896953819416044
6832.79152793456240.208472065437600
6933.13493566884335-0.134935668843350
7032.978233710566930.0217662894330696
7122.34715484770484-0.347154847704843
7222.46124600816881-0.461246008168813
7333.03880247654046-0.0388024765404633
7422.89695381941604-0.896953819416044
7533.07161374585355-0.0716137458535476
7632.635905934606320.364094065393684
7732.596102588378840.40389741162116
7833.07161374585355-0.0716137458535476
7932.584056738811810.415943261188188
8032.656671354352370.343328645647627
8132.62024858208160.379751417918401
8232.864142550102960.135857449897040
8333.26979224905338-0.269792249053377
8422.6687172039194-0.6687172039194
8533.03880247654046-0.0388024765404633
8632.864142550102960.135857449897040
8732.969568434956610.0304315650433949
8832.66871720391940.3312827960806
8933.68581459887489-0.685814598874887
9023.07161374585355-1.07161374585355
9132.66533662996270.334663370037302
9232.566671893022460.433328106977542
9332.629993816012260.37000618398774
9432.554626043455430.44537395654457
9532.274540232164280.725459767835718
9612.59948316233554-1.59948316233554
9732.172494921267340.82750507873266
9812.89695381941604-1.89695381941604
9932.896953819416040.103046180583956
10032.533860623709370.466139376290626
10132.482011427914870.517988572085131
10232.650759235758320.349240764241683
10322.71408115874812-0.714081158748119
10432.66871720391940.3312827960806
10532.876188399669990.123811600330012
10622.76209723920602-0.762097239206017
10733.07161374585355-0.0716137458535476
10832.514822697227950.485177302772046
10932.860761976146260.139238023853742
11023.63218361524704-1.63218361524704
11143.802437303976210.197562696023788
11243.444452175490880.55554782450912
11323.88990522066877-1.88990522066877
11453.796525185382161.20347481461784
11544.05246500297054-0.0524650029705445
11643.889905220668770.110094779331227
11743.264684181832040.735315818167963
11843.991950531565720.00804946843428492
11953.619112101928381.38088789807162
12033.88990522066877-0.889905220668773
12114.09399584246266-3.09399584246266
12253.535477300572431.46452269942757
12333.64090318542607-0.640903185426072
12454.093995842462660.906004157537342
12533.67371445473916-0.673714454739156
12643.429598874338880.570401125661121
12743.571669143842210.428330856157786
12843.423686755744820.576313244255177
12943.487008678734630.512991321265375
13043.319286534642810.68071346535719
13153.754994345890041.24500565410996
13243.619112101928380.380887898071617
13353.991950531565711.00804946843429
13433.26468418183204-0.264684181832037
13543.571669143842210.428330856157786
13643.492920797328680.507079202671318
13743.787859909771830.21214009022817
13843.619112101928380.380887898071617
13943.754994345890040.245005654109958
14053.746329070279721.25367092972028
14154.052465002970540.947534997029456
14253.673714454739161.32628554526084
14353.877805076533041.12219492346696
14453.95041969207361.04958030792640
14543.35215209852460.647847901475401
14643.682434024918190.317565975081815
14743.796525185382160.203474814617845
14843.919335916025150.0806640839748456
14953.796525185382161.20347481461784
15043.619112101928380.380887898071617
15153.929654272327541.07034572767246
15243.411640906177800.588359093822205
15353.619112101928381.38088789807162
15453.889905220668771.11009477933123
15553.673714454739161.32628554526084
15643.694479874485210.305520125514787
15743.889905220668770.110094779331227
15843.886524646712070.113475353287930
15953.577581262436271.42241873756373
16043.746329070279720.253670929720283


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.8168729163189450.3662541673621090.183127083681055
100.7040718846649340.5918562306701320.295928115335066
110.6521300687629340.6957398624741330.347869931237066
120.7515858333116950.496828333376610.248414166688305
130.7518958990806380.4962082018387230.248104100919362
140.7177981896641070.5644036206717870.282201810335893
150.7109814385968690.5780371228062620.289018561403131
160.6393889610372890.7212220779254230.360611038962711
170.553065309306580.8938693813868410.446934690693421
180.5115302105037180.9769395789925630.488469789496282
190.4306618798310730.8613237596621470.569338120168927
200.3823221367737150.764644273547430.617677863226285
210.3218815917154410.6437631834308830.678118408284559
220.292984939029910.585969878059820.70701506097009
230.2337483318365910.4674966636731810.766251668163409
240.2553165985070980.5106331970141950.744683401492902
250.2003299172854560.4006598345709130.799670082714544
260.1814144753431450.362828950686290.818585524656855
270.1400153817098780.2800307634197550.859984618290123
280.1158854511880420.2317709023760830.884114548811958
290.1616567102622490.3233134205244990.83834328973775
300.1353029749372790.2706059498745590.86469702506272
310.1036510742398620.2073021484797240.896348925760138
320.07876019779010320.1575203955802060.921239802209897
330.05856027820765910.1171205564153180.94143972179234
340.06356506054223570.1271301210844710.936434939457764
350.05258825641964710.1051765128392940.947411743580353
360.03935670223291530.07871340446583050.960643297767085
370.0283019699954250.056603939990850.971698030004575
380.02041348615156320.04082697230312650.979586513848437
390.1621569179809940.3243138359619870.837843082019006
400.1348773035355780.2697546070711550.865122696464422
410.1607756314152020.3215512628304040.839224368584798
420.1324935776278980.2649871552557970.867506422372102
430.1071437279127270.2142874558254540.892856272087273
440.08672650840307210.1734530168061440.913273491596928
450.08835277998473470.1767055599694690.911647220015265
460.08604093961501610.1720818792300320.913959060384984
470.06854729650271090.1370945930054220.931452703497289
480.05551038071800990.1110207614360200.94448961928199
490.0443128564063850.088625712812770.955687143593615
500.03812155438052020.07624310876104030.96187844561948
510.03972605342276620.07945210684553240.960273946577234
520.04291537623998090.08583075247996170.95708462376002
530.03314457249489570.06628914498979140.966855427505104
540.04672942344371220.09345884688742440.953270576556288
550.03951124288330860.07902248576661720.96048875711669
560.03161008482650660.06322016965301310.968389915173493
570.02458489420921550.04916978841843090.975415105790784
580.02585386984284580.05170773968569160.974146130157154
590.02028860739728660.04057721479457310.979711392602713
600.01542581404328880.03085162808657760.984574185956711
610.01286342185057140.02572684370114280.987136578149429
620.01023074799378740.02046149598757490.989769252006213
630.007589351609025250.01517870321805050.992410648390975
640.008279392309763980.01655878461952800.991720607690236
650.006323257642157760.01264651528431550.993676742357842
660.004700425361576790.009400850723153580.995299574638423
670.005379374526817070.01075874905363410.994620625473183
680.00394762740556780.00789525481113560.996052372594432
690.003242393978673850.00648478795734770.996757606021326
700.002574848726483660.005149697452967320.997425151273516
710.003285627377449850.00657125475489970.99671437262255
720.003337768482136430.006675536964272860.996662231517864
730.002438592381576830.004877184763153650.997561407618423
740.002812229406774390.005624458813548790.997187770593226
750.002004904651112660.004009809302225320.997995095348887
760.001491224074105520.002982448148211040.998508775925894
770.001137250930623120.002274501861246230.998862749069377
780.0007865711936644920.001573142387328980.999213428806335
790.0005422515258886190.001084503051777240.999457748474111
800.0003625497247383280.0007250994494766560.999637450275262
810.0002802744367658800.0005605488735317610.999719725563234
820.0001844158938238890.0003688317876477790.999815584106176
830.0001433767281310690.0002867534562621390.999856623271869
840.0001487440145061640.0002974880290123280.999851255985494
850.0001005736977120870.0002011473954241730.999899426302288
866.41277486835746e-050.0001282554973671490.999935872251316
874.01455411493225e-058.0291082298645e-050.99995985445885
882.72119670741097e-055.44239341482193e-050.999972788032926
892.86178763386354e-055.72357526772708e-050.999971382123661
904.51070512741976e-059.02141025483953e-050.999954892948726
913.24612636327273e-056.49225272654547e-050.999967538736367
922.16543319603123e-054.33086639206246e-050.99997834566804
931.60008118215821e-053.20016236431642e-050.999983999188178
949.65954933074491e-061.93190986614898e-050.99999034045067
956.38451249530044e-061.27690249906009e-050.999993615487505
966.6522130918953e-050.0001330442618379060.999933477869081
975.03957840616786e-050.0001007915681233570.999949604215938
980.0008994366755517460.001798873351103490.999100563324448
990.0006259942479735390.001251988495947080.999374005752026
1000.0004302892934242280.0008605785868484570.999569710706576
1010.0002934870621508010.0005869741243016020.99970651293785
1020.0002095811491550310.0004191622983100610.999790418850845
1030.0001695853274095370.0003391706548190740.99983041467259
1040.0001162464737390420.0002324929474780840.99988375352626
1058.42685219615734e-050.0001685370439231470.999915731478038
1060.0001484984176925870.0002969968353851740.999851501582307
1070.0001209105862021830.0002418211724043670.999879089413798
1088.00686891492178e-050.0001601373782984360.99991993131085
1096.32944479054834e-050.0001265888958109670.999936705552094
1100.001064139614118460.002128279228236910.998935860385882
1110.002374888329845020.004749776659690040.997625111670155
1120.003147093755652830.006294187511305670.996852906244347
1130.01354429781794110.02708859563588220.98645570218206
1140.0621939732555850.124387946511170.937806026744415
1150.08164208801031430.1632841760206290.918357911989686
1160.07975009646548170.1595001929309630.920249903534518
1170.08651860469854110.1730372093970820.913481395301459
1180.07791917515065570.1558383503013110.922080824849344
1190.1217151963980440.2434303927960880.878284803601956
1200.1402607390323990.2805214780647980.859739260967601
1210.966893279923060.06621344015387830.0331067200769391
1220.9906081196590040.01878376068199210.00939188034099605
1230.996954132573570.006091734852859570.00304586742642978
1240.9968505938679040.006298812264192720.00314940613209636
1250.9996778052643370.0006443894713251970.000322194735662599
1260.9995077389609990.0009845220780030750.000492261039001537
1270.999451505949360.001096988101282550.000548494050641273
1280.9991485829934930.001702834013013360.000851417006506679
1290.9987189696543960.002562060691208470.00128103034560423
1300.9982637898998530.003472420200295080.00173621010014754
1310.998202401337930.003595197324140990.00179759866207050
1320.9973748113621380.005250377275724320.00262518863786216
1330.9969937561168840.006012487766232820.00300624388311641
1340.9980991533104920.003801693379016730.00190084668950836
1350.997598591186750.004802817626499180.00240140881324959
1360.996341951814030.007316096371940350.00365804818597018
1370.9941833188415720.01163336231685560.00581668115842779
1380.9922663363297730.01546732734045360.0077336636702268
1390.9966602321638340.006679535672332360.00333976783616618
1400.9952196732730270.009560653453945860.00478032672697293
1410.9915825595862980.01683488082740350.00841744041370176
1420.9883941646003950.02321167079921080.0116058353996054
1430.981095643730340.037808712539320.01890435626966
1440.969148598115210.06170280376957950.0308514018847898
1450.9491989998034720.1016020003930570.0508010001965284
1460.9146510361120480.1706979277759030.0853489638879517
1470.8862600502706730.2274798994586550.113739949729327
1480.8903859225674950.2192281548650100.109614077432505
1490.8196794147574160.3606411704851670.180320585242584
1500.8455365237997750.3089269524004510.154463476200225
1510.7115095245854840.5769809508290320.288490475414516


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level620.433566433566434NOK
5% type I error level790.552447552447552NOK
10% type I error level920.643356643356643NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/10n9r31290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/10n9r31290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/1z78h1290558334.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/1z78h1290558334.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/2z78h1290558334.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/2z78h1290558334.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/3z78h1290558334.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/3z78h1290558334.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/4k9sx1290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/4k9sx1290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/5k9sx1290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/5k9sx1290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/6k9sx1290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/6k9sx1290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/7visi1290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/7visi1290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/8n9r31290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/8n9r31290558335.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/9n9r31290558335.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290558279rs5z7410wllese4/9n9r31290558335.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