Home » date » 2010 » Dec » 10 »

WS 10 Multiple 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: Fri, 10 Dec 2010 20:24: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/10/t1292012655lidqckjdtqoya1z.htm/, Retrieved Fri, 10 Dec 2010 21:24:25 +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/10/t1292012655lidqckjdtqoya1z.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 41 25 15 9 3 1 38 25 15 9 4 1 37 19 14 9 4 1 42 18 10 8 4 1 40 23 18 15 3 1 43 25 14 9 4 1 40 23 11 11 4 1 45 30 17 6 5 1 45 32 21 10 4 1 44 25 7 11 4 1 42 26 18 16 4 1 32 25 13 11 5 1 32 25 13 11 5 1 41 35 18 7 4 1 38 20 12 10 4 1 38 21 9 9 4 1 24 23 11 15 3 1 46 17 11 6 5 1 42 27 16 12 4 1 46 25 12 10 4 1 43 18 14 14 5 1 38 22 13 9 4 1 39 23 17 14 4 1 40 25 13 14 3 1 37 19 13 9 2 1 41 20 12 8 4 1 46 26 12 10 4 1 26 16 12 9 3 1 37 22 9 9 3 1 39 25 17 9 4 1 44 29 18 11 5 1 38 22 12 10 2 1 38 32 12 8 0 1 38 23 9 14 4 1 33 18 13 10 3 1 43 26 11 14 4 1 41 14 13 15 2 1 49 20 6 8 4 1 45 25 11 10 5 1 31 21 18 13 3 1 30 21 18 13 3 1 38 23 15 10 4 1 39 24 11 11 4 1 40 21 14 10 4 1 36 17 12 16 2 1 49 29 8 6 5 1 41 25 11 11 4 1 18 16 10 12 2 1 42 25 17 14 3 1 41 25 16 9 5 1 43 21 13 11 4 1 46 23 15 8 3 1 41 25 16 8 5 1 39 25 7 11 4 1 42 24 16 16 4 1 35 21 13 12 5 1 36 22 15 14 3 1 48 14 12 8 4 1 41 20 12 10 4 1 47 21 24 14 3 1 41 22 15 10 3 1 31 19 8 5 5 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 time9 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
StudyForCareer[t] = + 32.5974764805152 -0.213406913845935Gender[t] + 0.174696937710941PersonalStandards[t] + 0.0533645733833355ParentalExpectation[t] -0.222271249914753Doubts[t] + 1.40057205675814LeaderPreference[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)32.59747648051523.2766289.948500
Gender-0.2134069138459350.875608-0.24370.8078010.403901
PersonalStandards0.1746969377109410.1041991.67660.0958580.047929
ParentalExpectation0.05336457338333550.1312710.40650.684980.34249
Doubts-0.2222712499147530.156784-1.41770.1585040.079252
LeaderPreference1.400572056758140.483952.8940.0044130.002206


Multiple Linear Regression - Regression Statistics
Multiple R0.368414053928045
R-squared0.135728915131696
Adjusted R-squared0.104862090672114
F-TEST (value)4.39724258999894
F-TEST (DF numerator)5
F-TEST (DF denominator)140
p-value0.000948505454698712
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.99882997972892
Sum Squared Residuals3498.36216327312


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
14139.75323653123431.24676346876571
23841.1538085879926-3.15380858799256
33740.0522623883436-3.05226238834359
44239.8863784070142.11362159298596
54038.2303088764741.76969112352598
64341.10044401460921.89955598539078
74040.1464139192078-0.146413919207826
84544.20140822981630.798591770183674
94542.47460334235442.5253966576456
104440.28234950109643.71765049890363
114239.93270049645022.06729950354977
123242.0031089981545-10.0031089981545
133242.0031089981545-10.0031089981545
144143.5054141850815-2.50541418508148
153839.8979589293731-1.89795892937309
163840.1348333968488-2.13483339684878
172437.8567568627907-13.8567568627907
184641.61016059927414.38983940072592
194240.88975328705351.11024671294649
204640.77144361792785.2285563820722
214340.1667812578172.83321874218299
223840.5229886280931-2.52298862809306
233939.7997876097636-0.79978760976358
244038.5351511348941.46484886510602
253737.197753701444-0.197753701443968
264140.34250142920260.657498570797402
274640.94614055563875.05385944436126
282638.0208703716859-12.0208703716859
293738.9089582778016-1.90895827780158
303941.2605377347592-2.26053773475923
314442.96871961591501.03128038408504
323837.44620869127870.553791308721298
333836.83657645470131.16342354529866
343839.3728710226969-1.37287102269690
353338.2013575705764-5.20135757057641
364340.00369098259642.99630901740361
374134.99064151340076.00935848659926
384940.02231398890268.97768601109741
394542.11865110130262.8813488986974
403138.3254575008817-7.32545750088165
413038.3254575008817-8.32545750088165
423840.5821434626559-2.58214346265592
433940.3211108569188-1.32111085691877
444040.1793850138507-0.179385013850704
453635.23909650323550.760903496764521
464943.54643013165545.45356986834463
474140.49580779462970.504192205370292
481835.8467554184169-17.8467554184169
494238.74860942842733.25139057157267
504142.607745218134-1.60774521813403
514339.90374919055263.09625080944738
524639.62611390572736.37388609427271
534142.8300164680488-1.83001646804878
543940.2823495010964-1.28234950109637
554239.47657747426172.52342252573832
563541.082049997396-6.082049997396
573638.1177894685278-2.11778946852783
584839.2943198029378.70568019706305
594139.89795892937311.10204107062691
604738.42337369126698.57662630873309
614139.00687446818681.99312553181315
623142.0217320044607-11.0217320044607
633641.1711793715311-5.17117937153113
644641.26053773475924.73946226524077
654440.67729208706353.32270791293645
664336.93270130696166.06729869303845
674040.457020298676-0.457020298676028
684039.04865851921110.951341480788867
694637.03084648643988.96915351356022
703940.5851661578578-1.58516615785781
714441.55958973199972.44041026800034
723836.35045275280921.64954724719076
733939.5933718001774-0.593371800177387
744142.9037745201726-1.90377452017257
753938.58851570827730.411484291722681
764039.4921777853660.507822214634013
774440.20656584731413.79343415268594
784239.41565216726462.58434783273544
794642.58635464585023.41364535414980
804439.92993293047264.0700670695274
813740.4278400036854-3.42784000368544
823937.10839533821591.89160466178413
834038.17996699829261.82003300170742
844238.74860942842733.25139057157267
853738.8409904868573-1.84099048685732
863337.7694188267806-4.7694188267806
873539.8330138336307-4.83301383363071
884235.57211668866226.42788331133784
893635.96501370785520.0349862921448101
904439.58627793654284.41372206345717
914539.86770402102045.13229597897956
924741.15855037594135.8414496240587
934041.2458831375109-1.24588313751089
944938.804919177193910.1950808228061
954844.34382465751613.65617534248390
962940.8247568116237-11.8247568116237
974541.76039288981193.2396071101881
982936.5754401890142-7.57544018901423
994140.50833403084470.49166596915528
1003437.1287374372689-3.12873743726892
1013836.12713302966371.87286697033629
1023737.9848252021538-0.984825202153773
1034844.22853768359233.77146231640773
1043941.052818322718-2.052818322718
1053440.5906499101257-6.59064991012567
1063536.611433978859-1.61143397885899
1074140.20930817373560.790691826264434
1084339.45436214339953.54563785660045
1094138.58367116095382.41632883904624
1103936.10673955092332.89326044907675
1113641.1721250853871-5.17212508538709
1123241.6506671879746-9.65066718797462
1134640.08418500975575.91581499024433
1144241.03242484397750.967575156022457
1154236.36198189548095.63801810451912
1164539.46017854471045.53982145528964
1173940.8635181674461-1.86351816744613
1184541.12657637484183.87342362515821
1194842.49517443050045.50482556949957
1202838.3487961550053-10.3487961550053
1213537.6538253439451-2.65382534394511
1223839.0591644282081-1.05916442820812
1234238.45275773579433.54724226420565
1243638.2128867132480-2.21288671324805
1253740.8519376450871-3.85193764508708
1263839.2029105984942-1.20291059849421
1274340.91965030680712.08034969319290
1283534.69935399931090.300646000689057
1293639.8357300199209-3.83573001992094
1303336.4221338235871-3.42213382358712
1313938.25364753059770.746352469402314
1323241.239095782788-9.23909578278799
1334539.33003322400135.66996677599866
1343539.8833043321248-4.88330433212475
1353837.80433800326330.195661996736691
1363637.4335535555576-1.43355355555760
1374238.18670297332813.81329702667193
1384139.54549097906191.45450902093808
1394738.93004234117388.06995765882624
1403538.7019808300795-3.70198083007948
1414337.76834421341855.23165578658146
1424040.189917062979-0.189917062978970
1434640.80436333288335.19563666711673
1444441.76039288981192.23960711018810
1453538.8117326720480-3.81173267204804
1462939.7317684391319-10.7317684391319


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.2282636437471410.4565272874942810.77173635625286
100.1115857816093440.2231715632186880.888414218390656
110.05038172171293470.1007634434258690.949618278287065
120.2844386739305410.5688773478610830.715561326069459
130.3204794253461070.6409588506922140.679520574653893
140.3397397644790010.6794795289580030.660260235520999
150.2484478158330580.4968956316661170.751552184166942
160.1809765921428660.3619531842857310.819023407857134
170.7413921852893080.5172156294213830.258607814710692
180.7230911150773210.5538177698453570.276908884922679
190.6788715324987770.6422569350024470.321128467501223
200.7249111512282560.5501776975434870.275088848771744
210.7217984857748990.5564030284502030.278201514225101
220.6731246185240430.6537507629519130.326875381475957
230.6038222349092320.7923555301815370.396177765090768
240.5642364963234090.8715270073531820.435763503676591
250.5051855608311230.9896288783377550.494814439168877
260.4352053544084250.870410708816850.564794645591575
270.4708063715655630.9416127431311250.529193628434437
280.7327740245929370.5344519508141270.267225975407063
290.6789872462324360.6420255075351290.321012753767564
300.6308326468156150.738334706368770.369167353184385
310.5707120208755610.8585759582488780.429287979124439
320.5182501008669230.9634997982661530.481749899133077
330.4592845269362580.9185690538725170.540715473063742
340.4018846031077110.8037692062154220.598115396892289
350.3810234609904960.7620469219809920.618976539009504
360.3552045488281010.7104090976562020.644795451171899
370.4280862457290080.8561724914580160.571913754270992
380.5653835279552240.8692329440895530.434616472044776
390.5251807084194690.9496385831610620.474819291580531
400.5516254718168830.8967490563662340.448374528183117
410.5966755333112390.8066489333775220.403324466688761
420.5515269792718960.8969460414562080.448473020728104
430.5018195700839440.9963608598321130.498180429916056
440.4494824829083260.8989649658166510.550517517091675
450.4073206840619890.8146413681239770.592679315938011
460.3891318667127860.7782637334255710.610868133287214
470.3386005219195880.6772010438391760.661399478080412
480.8303977088519630.3392045822960740.169602291148037
490.821344711622860.3573105767542790.178655288377140
500.789266553294130.4214668934117420.210733446705871
510.7708551712870470.4582896574259050.229144828712953
520.8046371242264810.3907257515470370.195362875773519
530.7729875395791480.4540249208417040.227012460420852
540.7402993032807790.5194013934384420.259700696719221
550.7135265562193010.5729468875613980.286473443780699
560.733915235137310.532169529725380.26608476486269
570.7029303733621840.5941392532756310.297069626637816
580.7998053961450530.4003892077098950.200194603854947
590.7652674747480360.4694650505039270.234732525251964
600.8374052052730080.3251895894539840.162594794726992
610.8098366691307890.3803266617384220.190163330869211
620.913234314610730.173531370778540.08676568538927
630.918521734160050.1629565316799020.0814782658399508
640.9126494415002260.1747011169995470.0873505584997737
650.8988976178891910.2022047642216180.101102382110809
660.9071246249554220.1857507500891560.092875375044578
670.8885139006266270.2229721987467450.111486099373373
680.8643935811310370.2712128377379260.135606418868963
690.9103334387202090.1793331225595820.089666561279791
700.8925090376427120.2149819247145770.107490962357288
710.8726829741720320.2546340516559360.127317025827968
720.848256820828480.3034863583430390.151743179171520
730.8221908711225180.3556182577549650.177809128877482
740.7965905558268130.4068188883463730.203409444173187
750.7600661360560820.4798677278878360.239933863943918
760.7215182136562860.5569635726874280.278481786343714
770.697534296519820.6049314069603610.302465703480180
780.6613231056296030.6773537887407940.338676894370397
790.6328257160073880.7343485679852250.367174283992612
800.614644088942560.770711822114880.38535591105744
810.5891621845636980.8216756308726050.410837815436302
820.5492577876999830.9014844246000340.450742212300017
830.50762343219480.98475313561040.4923765678052
840.4995607849601340.9991215699202690.500439215039866
850.4525698445660480.9051396891320950.547430155433952
860.432362022483270.864724044966540.56763797751673
870.4786714905868660.9573429811737320.521328509413134
880.4655414117655550.931082823531110.534458588234445
890.4161883433494530.8323766866989050.583811656650547
900.3938102387156180.7876204774312370.606189761284382
910.3830909957285550.7661819914571110.616909004271444
920.4012525116783660.8025050233567320.598747488321634
930.3674674520146390.7349349040292770.632532547985361
940.4990313722738540.9980627445477070.500968627726146
950.5174679194860940.9650641610278120.482532080513906
960.7946674552673380.4106650894653250.205332544732662
970.7683804182569350.4632391634861290.231619581743065
980.8101833212501580.3796333574996850.189816678749842
990.7714832368993130.4570335262013750.228516763100687
1000.7533449683878440.4933100632243120.246655031612156
1010.7103922949034920.5792154101930170.289607705096509
1020.6659803933612680.6680392132774640.334019606638732
1030.6498250569269510.7003498861460980.350174943073049
1040.6074806661390120.7850386677219770.392519333860988
1050.598237187449030.803525625101940.40176281255097
1060.5573291435137710.8853417129724580.442670856486229
1070.5029081062702190.9941837874595620.497091893729781
1080.4628548451047590.9257096902095180.537145154895241
1090.4136518811436730.8273037622873450.586348118856327
1100.3647438877892180.7294877755784350.635256112210782
1110.3482947498880640.6965894997761280.651705250111936
1120.5316757932001550.936648413599690.468324206799845
1130.5468414278324060.9063171443351870.453158572167594
1140.4858062879139370.9716125758278750.514193712086063
1150.4878267553080530.9756535106161060.512173244691947
1160.4590314739511890.9180629479023790.540968526048811
1170.4038358259113530.8076716518227070.596164174088647
1180.3667067579597780.7334135159195560.633293242040222
1190.3775223563517540.7550447127035080.622477643648246
1200.5727097857605070.8545804284789850.427290214239493
1210.5167029719451540.9665940561096910.483297028054846
1220.4459888711763040.8919777423526080.554011128823696
1230.4035838149673950.807167629934790.596416185032605
1240.3437315824135690.6874631648271380.656268417586431
1250.3031896698880660.6063793397761320.696810330111934
1260.2468781626864120.4937563253728230.753121837313588
1270.2301720242346140.4603440484692280.769827975765386
1280.1732060999297730.3464121998595460.826793900070227
1290.1472733331526750.2945466663053500.852726666847325
1300.1406461908867610.2812923817735220.859353809113239
1310.1062273091124030.2124546182248060.893772690887597
1320.2250949835186460.4501899670372920.774905016481354
1330.1606578197321090.3213156394642180.83934218026789
1340.1510299924951920.3020599849903830.848970007504808
1350.09726324580387450.1945264916077490.902736754196126
1360.06335973694438920.1267194738887780.936640263055611
1370.03079943357421040.06159886714842080.96920056642579


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 level10.00775193798449612OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/10t44j1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/10t44j1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/1n37p1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/1n37p1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/2n37p1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/2n37p1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/3n37p1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/3n37p1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/4xvps1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/4xvps1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/5xvps1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/5xvps1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/684od1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/684od1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/784od1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/784od1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/81dng1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/81dng1292012634.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/91dng1292012634.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012655lidqckjdtqoya1z/91dng1292012634.ps (open in new window)


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