Home » date » 2010 » Dec » 01 »

ws 7

*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, 01 Dec 2010 13:24:40 +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/01/t1291209857zhoh4m814790ltr.htm/, Retrieved Wed, 01 Dec 2010 14:24:38 +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/01/t1291209857zhoh4m814790ltr.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 «
2 5 2 3 3 4 4 2 4 2 4 3 4 4 4 4 2 4 2 5 4 2 4 2 2 2 2 4 3 2 2 2 3 2 4 4 5 1 3 2 4 5 3 5 1 2 1 4 4 3 4 3 3 3 4 3 3 3 2 3 2 4 4 2 4 1 3 2 2 4 4 4 4 3 3 3 4 4 2 2 4 2 4 4 3 3 3 2 2 3 4 3 3 2 2 2 4 2 4 4 1 1 3 4 3 4 5 1 1 1 4 4 3 4 2 3 3 4 3 3 2 2 2 2 2 2 3 4 2 2 3 4 4 4 4 2 3 4 4 3 2 4 1 4 2 4 3 5 4 2 4 3 3 4 4 4 4 3 5 2 3 2 4 2 2 2 4 3 3 5 2 3 2 2 4 4 4 2 4 3 3 4 4 4 2 3 2 4 4 3 4 2 2 2 3 4 4 4 3 1 2 4 4 4 4 2 3 2 4 4 1 4 1 2 3 4 5 4 4 4 4 4 4 4 5 2 1 4 1 4 4 2 4 2 5 3 4 4 4 4 2 2 3 4 3 3 5 2 4 2 5 4 2 5 2 4 1 4 3 4 4 2 2 1 2 4 5 3 2 4 2 4 4 4 4 2 4 2 4 3 4 5 2 2 2 5 5 4 4 2 3 1 4 4 3 4 2 2 2 2 3 4 5 2 4 1 4 3 2 4 2 3 2 4 3 2 5 1 1 2 4 4 4 4 2 2 4 2 4 2 4 1 5 2 5 4 4 4 2 2 2 4 4 4 3 1 4 2 4 4 1 4 1 4 1 4 4 4 4 2 2 2 4 4 2 4 2 2 2 4 5 1 2 1 2 1 3 3 4 3 5 4 5 5 3 3 5 2 3 2 4 5 2 4 2 4 2 4 5 4 4 1 2 2 4 4 3 5 1 3 1 4 4 2 3 2 2 3 2 3 2 5 2 2 1 4 4 3 4 1 3 1 4 4 2 5 1 2 2 4 5 1 4 2 3 3 4 4 3 4 1 2 2 3 4 2 5 1 4 2 4 5 3 4 2 2 2 2 4 3 4 1 5 4 4 3 3 5 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time11 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
standards[t] = + 2.48963932953509 + 0.0538450994962259organization[t] + 0.387877857721709punished[t] + 0.0566181025382133secondrate[t] -0.0508237544025616mistakes[t] -0.079317766161663competent[t] -0.0330405295816517neat[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2.489639329535090.5541114.4931.4e-057e-06
organization0.05384509949622590.0933580.57680.5649560.282478
punished0.3878778577217090.0857274.52461.2e-056e-06
secondrate0.05661810253821330.0774330.73120.465790.232895
mistakes-0.05082375440256160.087434-0.58130.561910.280955
competent-0.0793177661616630.096687-0.82040.4132980.206649
neat-0.03304052958165170.100069-0.33020.741720.37086


Multiple Linear Regression - Regression Statistics
Multiple R0.376060259714053
R-squared0.141421318936201
Adjusted R-squared0.107530055209998
F-TEST (value)4.1727956820584
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value0.000651696167687899
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.912727461888245
Sum Squared Residuals126.626855792114


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
123.10257040389327-1.10257040389327
223.10534340693532-1.10534340693532
343.076849395176220.923150604823783
423.20156648858478-1.20156648858478
533.04305253518977-0.0430525351897662
642.732475770992531.26752422900747
732.759721952438530.240278047561468
833.46964369170047-0.469643691700466
933.04570395930344-0.0457039593034414
1022.87030673340128-0.870306733401284
1143.903798786002190.0962012139978136
1243.048476962345430.951523037654572
1333.4562814806486-0.4562814806486
1433.05516691592853-0.0551669159285313
1542.580651771180621.41934822881938
1642.703103849900321.29689615009968
1733.08176583397876-0.0817658339787574
1833.15995734875563-0.159957348755631
1932.992107201858890.0078927981411074
2043.030942079576200.969057920423804
2122.80132983319782-0.801329833197823
2253.184661173096981.81533882690302
2343.914509572940380.0854904270596224
2423.07597148584311-1.07597148584311
2533.31202969061922-0.312029690619219
2643.184661173096980.815338826903018
2743.099549058799670.900450941200333
2833.12224872242312-0.122248722423117
2943.374190711444950.62580928855505
3043.099549058799670.900450941200333
3112.57118881455553-1.57118881455553
3243.830275367976180.169724632023825
3352.711422859026282.28857714097372
3423.16196150947353-1.16196150947353
3543.025147731440540.974852268559456
3633.13069449467244-0.130694494672444
3723.29387654481832-1.29387654481832
3843.252390242987340.747609757012658
3953.102322061841651.89767793815835
4043.189207690919530.810792309080468
4142.984417760014371.01558223998563
4243.150372813202230.849627186797771
4333.23460701816643-0.234607018166432
4443.293876544818320.70612345518168
4523.13258958838132-1.13258958838132
4622.65228009549776-0.652280095497758
4743.099918979779660.900081020220343
4822.74558963999272-0.745589639992722
4943.042930956261450.957069043738545
5042.714444204119951.28555579588005
5112.81911305801873-1.81911305801873
5243.042930956261450.957069043738545
5323.0098904266798-1.00989042667980
5412.71054494969317-1.71054494969317
5544.06720713521908-0.0672071352190847
5633.12035362871424-0.120353628714242
5723.12312663175623-1.12312663175623
5842.655053098539741.34494690146025
5932.816340054976750.183659945023254
6023.12993816426764-1.12993816426764
6123.14759981016024-1.14759981016024
6232.762494955480520.23750504451948
6322.67585766845432-0.67585766845432
6413.04872530439711-2.04872530439711
6532.734370864701410.265629135298592
6622.78909387353075-0.789093873530746
6733.20156648858478-0.20156648858478
6832.756300426930910.243699573069087
6932.703103849900320.29689615009968
7023.09954905879967-1.09954905879967
7132.601207999043520.398792000956481
7222.65505309853975-0.655053098539745
7343.54127201601760.458727983982398
7443.677207884717480.322792115282522
7543.260836015236670.739163984763332
7623.07597148584311-1.07597148584311
7732.711671201077960.288328798922041
7843.630930648137470.369069351862533
7933.06373552617603-0.0637355261760286
8043.093754710664020.906245289335984
8123.07532422244733-1.07532422244733
8233.1146808595069-0.114680859506902
8332.796783315375270.203216684624727
8443.739368905543210.260631094456791
8522.84181272164218-0.841812721642183
8642.847607069777831.15239293022217
8722.71167120107796-0.711671201077958
8822.67006332031867-0.670063320318668
8943.875304774243090.124695225756915
9033.12679524024567-0.126795240245667
9143.042930956261450.957069043738545
9222.81546214564363-0.815462145643634
9322.65782610158173-0.657826101581733
9432.601207999043520.398792000956481
9533.49044826161504-0.490448261615041
9653.861420803848951.13857919615105
9723.92612852864565-1.92612852864565
9833.52626179423868-0.526261794238679
9943.285430772568990.714569227431007
10033.20611300640733-0.206113006407330
10143.599785212264690.400214787735309
10232.818235148685620.181764851314379
10333.44606611874390-0.446066118743905
10423.07597148584311-1.07597148584311
10533.27898916103757-0.278989161037568
10623.30131764461117-1.30131764461117
10733.18832978158642-0.188329781586420
10823.80065510483228-1.80065510483228
10943.571291200505590.428708799494410
11022.84395615740274-0.843956157402736
11142.623907662666971.37609233733303
11242.997901549994541.00209845000546
11312.69666097929904-1.69666097929904
11453.587426414599441.41257358540056
11523.0594360913353-1.05943609133530
11633.22969057936389-0.229690579363892
11743.057939918970520.942060081029482
11812.62365932061529-1.62365932061529
11953.566744682683041.43325531731696
12032.876748344932710.12325165506729
12132.795535485062170.204464514937828
12233.10144415250854-0.101444152508543
12333.52324044914501-0.523240449145015
12423.01745828959602-1.01745828959602
12522.60422934413718-0.604229344137184
12643.181639828003320.818360171996682
12742.931471353762051.06852864623795
12833.17886682496133-0.178866824961330
12932.790988967239620.209011032760379
13033.04872530439711-0.0487253043971058
13143.556280978726670.443719021273333
13233.12224872242312-0.122248722423117
13342.724029998743211.27597000125679
13442.841812721642181.15818727835782
13523.20156648858478-1.20156648858478
13643.099549058799670.900450941200333
13722.63424852862517-0.634248528625171
13843.091228790603850.908771209396152
13933.53825067092394-0.538250670923938
14033.69321324789151-0.69321324789151
14122.97986998312196-0.979869983121957
14223.88564564020129-1.88564564020129
14354.124842422133060.875157577866938
14422.70587685294231-0.705876852942307
14543.40054128744350.599458712556501
14633.15616716133788-0.156167161337881
14733.05604482526164-0.0560448252616432
14833.12779472850709-0.127794728507091
14932.631597104511500.368402895488504
15043.93192287678130.0680771232187017
15143.232463582405880.767536417594121
15243.099549058799670.900450941200333
15343.31265617010420.687343829895803
15442.692761724872261.30723827512774
15553.934066312541851.06593368745815
15633.15528925200477-0.155289252004769
15733.02023129263800-0.0202312926380044
15843.875304774243090.124695225756915
15943.911488227846710.0885117721532867


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.557257169793390.8854856604132210.442742830206611
110.4285395074434990.8570790148869980.571460492556501
120.2934549518879480.5869099037758970.706545048112052
130.2974693167578750.594938633515750.702530683242125
140.2680493421265010.5360986842530020.731950657873499
150.3255494906975840.6510989813951680.674450509302416
160.2509681543537440.5019363087074890.749031845646256
170.1825876241255410.3651752482510830.817412375874458
180.1705312554065620.3410625108131250.829468744593438
190.1373836330375380.2747672660750770.862616366962462
200.1824868117426590.3649736234853180.817513188257341
210.1495820625826160.2991641251652310.850417937417384
220.5766638864345350.846672227130930.423336113565465
230.5464785973812140.9070428052375730.453521402618786
240.574692537669480.850614924661040.42530746233052
250.5169043413471380.9661913173057240.483095658652862
260.495595430308460.991190860616920.50440456969154
270.4728215541780430.9456431083560860.527178445821957
280.4063779087352620.8127558174705250.593622091264738
290.3579320586547790.7158641173095570.642067941345221
300.3334402724396050.666880544879210.666559727560395
310.6205325966451710.7589348067096580.379467403354829
320.560400694935450.87919861012910.43959930506455
330.7106415827279180.5787168345441650.289358417272082
340.7708291638356120.4583416723287770.229170836164388
350.7654756096832490.4690487806335020.234524390316751
360.7265687967424540.5468624065150920.273431203257546
370.7472245505553080.5055508988893850.252775449444692
380.7418912109079070.5162175781841860.258108789092093
390.817945863454860.3641082730902790.182054136545140
400.8059307605511310.3881384788977380.194069239448869
410.792290416046730.4154191679065410.207709583953270
420.7699168831259920.4601662337480160.230083116874008
430.7295472586228420.5409054827543160.270452741377158
440.71215872404890.5756825519021990.287841275951100
450.7496007050357050.5007985899285900.250399294964295
460.730825755895840.5383484882083210.269174244104160
470.7459371816760970.5081256366478060.254062818323903
480.7529882692479490.4940234615041030.247011730752051
490.7406411512096130.5187176975807750.259358848790387
500.7556495260233720.4887009479532570.244350473976629
510.8689902835990950.262019432801810.131009716400905
520.8622931984353980.2754136031292030.137706801564602
530.8892157229581220.2215685540837550.110784277041878
540.9450833550670760.1098332898658490.0549166449329244
550.9346567330454190.1306865339091620.065343266954581
560.9188237666476450.162352466704710.081176233352355
570.9304831609907020.1390336780185960.0695168390092978
580.944064099146460.1118718017070800.0559359008535402
590.9298565343967610.1402869312064780.0701434656032388
600.9368877185514880.1262245628970240.0631122814485118
610.9439517443109530.1120965113780940.056048255689047
620.9302107626046520.1395784747906960.0697892373953481
630.9231850770685780.1536298458628440.076814922931422
640.9710221656097140.0579556687805720.028977834390286
650.9630544999652370.07389100006952690.0369455000347634
660.9592968307600540.08140633847989170.0407031692399458
670.9487499739076550.1025000521846900.0512500260923448
680.9365615585437930.1268768829124150.0634384414562074
690.9223428665420980.1553142669158040.0776571334579022
700.9294031868790610.1411936262418770.0705968131209386
710.9163618998105710.1672762003788580.083638100189429
720.9074124117945520.1851751764108960.0925875882054482
730.8923259079188990.2153481841622030.107674092081101
740.8740029046548930.2519941906902140.125997095345107
750.8652410860794960.2695178278410080.134758913920504
760.8740266961013040.2519466077973930.125973303898696
770.8511744567668120.2976510864663770.148825543233188
780.8269957163072760.3460085673854470.173004283692724
790.7952668925824180.4094662148351650.204733107417582
800.7935877741931950.4128244516136090.206412225806805
810.8048195158952520.3903609682094960.195180484104748
820.7715932840118940.4568134319762130.228406715988106
830.7380391899005950.5239216201988090.261960810099405
840.7052993694933880.5894012610132240.294700630506612
850.6997201444100080.6005597111799850.300279855589992
860.7192430672038920.5615138655922150.280756932796108
870.7020435580838360.5959128838323290.297956441916164
880.6801747986986250.639650402602750.319825201301375
890.6376579047732310.7246841904535380.362342095226769
900.5932308159625990.8135383680748020.406769184037401
910.5974713426177490.8050573147645010.402528657382251
920.5910380033896770.8179239932206450.408961996610323
930.5682940225943850.863411954811230.431705977405615
940.5320660104910160.9358679790179670.467933989508984
950.5013426734023760.9973146531952490.498657326597624
960.5242679541786410.9514640916427170.475732045821359
970.6888410869847980.6223178260304040.311158913015202
980.6588836138805410.6822327722389180.341116386119459
990.6355391408098130.7289217183803740.364460859190187
1000.5950101070201760.8099797859596490.404989892979824
1010.5526261283159320.8947477433681350.447373871684068
1020.5047003890907370.9905992218185270.495299610909263
1030.4697994471698280.9395988943396550.530200552830172
1040.4951868464699150.990373692939830.504813153530085
1050.4614992371058850.922998474211770.538500762894115
1060.5156312261268050.968737547746390.484368773873194
1070.4787981242418610.9575962484837230.521201875758139
1080.6198808188855270.7602383622289470.380119181114473
1090.5763605622357830.8472788755284330.423639437764216
1100.6283817591914620.7432364816170760.371618240808538
1110.6909585587073850.618082882585230.309041441292615
1120.742615851424380.514768297151240.25738414857562
1130.813590500684640.3728189986307190.186409499315359
1140.8503429642644720.2993140714710560.149657035735528
1150.8688267164504530.2623465670990950.131173283549547
1160.848157001861240.3036859962775190.151842998138760
1170.8637941629428350.272411674114330.136205837057165
1180.9186861307893870.1626277384212270.0813138692106135
1190.9386878278601260.1226243442797480.0613121721398739
1200.9339882618231180.1320234763537640.066011738176882
1210.9127898201281580.1744203597436840.0872101798718422
1220.895818247304440.2083635053911190.104181752695560
1230.8788470802904840.2423058394190320.121152919709516
1240.8754991794202250.2490016411595490.124500820579775
1250.8553810120388720.2892379759222570.144618987961128
1260.8445349824855110.3109300350289780.155465017514489
1270.8361081633945070.3277836732109870.163891836605493
1280.80057807587320.39884384825360.1994219241268
1290.7516325749100530.4967348501798950.248367425089947
1300.695372090973260.6092558180534790.304627909026739
1310.6536205311366430.6927589377267140.346379468863357
1320.609244887600750.78151022479850.39075511239925
1330.5828298067196930.8343403865606140.417170193280307
1340.5965438477459020.8069123045081950.403456152254098
1350.787163544541360.4256729109172810.212836455458641
1360.7839557574322980.4320884851354040.216044242567702
1370.7778586255427180.4442827489145640.222141374457282
1380.7574132436638450.485173512672310.242586756336155
1390.7289542674762860.5420914650474290.271045732523714
1400.7470004177091150.5059991645817690.252999582290885
1410.7151942017975440.5696115964049120.284805798202456
1420.945280085818270.1094398283634590.0547199141817295
1430.9129331352508570.1741337294982850.0870668647491426
1440.9538275915074680.0923448169850640.046172408492532
1450.9385896112786070.1228207774427860.061410388721393
1460.8891525361641590.2216949276716820.110847463835841
1470.8168434815011020.3663130369977960.183156518498898
1480.7067936279380160.5864127441239670.293206372061984
1490.5556013911663210.8887972176673590.444398608833679


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 level40.0285714285714286OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/10gnli1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/10gnli1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/1s46o1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/1s46o1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/2kv5r1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/2kv5r1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/3kv5r1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/3kv5r1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/4kv5r1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/4kv5r1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/5kv5r1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/5kv5r1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/6d5nc1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/6d5nc1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/76vmx1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/76vmx1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/86vmx1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/86vmx1291209867.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/96vmx1291209867.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291209857zhoh4m814790ltr/96vmx1291209867.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