Home » date » 2010 » Nov » 23 »

Mini-Tutorial Multiple regression + trend

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 00:53:22 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8.htm/, Retrieved Tue, 23 Nov 2010 02:06:41 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8.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 «
13 26 9 6 25 25 16 20 9 6 25 24 19 21 9 13 19 21 15 31 14 8 18 23 14 21 8 7 18 17 13 18 8 9 22 19 19 26 11 5 29 18 15 22 10 8 26 27 14 22 9 9 25 23 15 29 15 11 23 23 16 15 14 8 23 29 16 16 11 11 23 21 16 24 14 12 24 26 17 17 6 8 30 25 15 19 20 7 19 25 15 22 9 9 24 23 20 31 10 12 32 26 18 28 8 20 30 20 16 38 11 7 29 29 16 26 14 8 17 24 19 25 11 8 25 23 16 25 16 16 26 24 17 29 14 10 26 30 17 28 11 6 25 22 16 15 11 8 23 22 15 18 12 9 21 13 14 21 9 9 19 24 15 25 7 11 35 17 12 23 13 12 19 24 14 23 10 8 20 21 16 19 9 7 21 23 14 18 9 8 21 24 7 18 13 9 24 24 10 26 16 4 23 24 14 18 12 8 19 23 16 18 6 8 17 26 16 28 14 8 24 24 16 17 14 6 15 21 14 29 10 8 25 23 20 12 4 4 27 28 14 25 12 7 29 23 14 28 12 14 27 22 11 20 14 10 18 24 15 17 9 9 25 21 16 17 9 6 22 23 14 20 10 8 26 23 16 31 14 11 23 20 14 21 10 8 16 23 12 19 9 8 27 21 16 23 14 10 25 27 9 15 8 8 14 12 14 24 9 10 19 15 16 28 8 7 20 22 16 16 9 8 16 21 15 19 9 7 18 21 16 21 9 9 22 20 12 21 15 5 21 24 16 20 8 7 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
Selfconfidence[t] = + 13.7934790500029 + 0.0180156866769969ConcernMistakes[t] -0.291927723214096DoubtsActions[t] + 0.0657465203235145ParentalCriticism[t] + 0.0287198566927615PersonalStandards[t] + 0.143702684659464Organization[t] -0.00594246494433589t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)13.79347905000291.5345758.988500
ConcernMistakes0.01801568667699690.0369830.48710.6269110.313455
DoubtsActions-0.2919277232140960.068806-4.24283.9e-052e-05
ParentalCriticism0.06574652032351450.068650.95770.339830.169915
PersonalStandards0.02871985669276150.0491290.58460.5597540.279877
Organization0.1437026846594640.0500592.87070.0047180.002359
t-0.005942464944335890.003996-1.4870.1392290.069615


Multiple Linear Regression - Regression Statistics
Multiple R0.452228504829141
R-squared0.204510620580000
Adjusted R-squared0.171133443821119
F-TEST (value)6.1272594161393
F-TEST (DF numerator)6
F-TEST (DF denominator)143
p-value9.7470573310332e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.06931613429479
Sum Squared Residuals612.335904702341


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11316.3336375854807-3.33363758548074
21616.0758983158146-0.0758983158146235
31915.94476998567693.05523001432306
41514.58929868244070.410701317559324
51415.2268030617307-1.22680306173065
61315.7005913734923-2.70059137349233
71914.75734146321754.24265853678253
81516.3756681276067-1.37566812760669
91416.1238693108693-2.12386931086935
101514.56652364064090.433476359359081
111615.26526583241900.734734167581041
121615.20074030748870.799259692511256
131615.27611996663170.723880033368312
141717.2451198548642-0.245119854864192
151512.80655569433262.19344430566739
161516.0535521995662-1.05355219956623
172016.77592965999183.2240703400082
181816.90611192269051.09388807730952
191616.6144426959105-0.614442695910548
201614.51912363791301.48087636208698
211915.45700482481663.5429951751834
221614.68981844774211.31018155225788
231715.80753116194971.19246883805034
241715.21802876470811.78197123529191
251615.05193570022430.9480642997757
261513.52309521709971.47690478290032
271415.9702727996972-1.9702727996972
281516.205340483004-1.20534048300401
291215.0239479112767-3.02394791127668
301415.2284143373949-1.22841433739495
311615.69271555464490.307284445355108
321415.8782066080065-1.87820660800654
33714.8564593406076-7.85645934060762
341013.7614067411266-3.76140674112663
351414.7834536454863-0.783453645486254
361616.9027458604194-0.902745860419365
371614.65517210406261.34482789593737
381613.62997728081112.37002271918895
391415.7140309257406-1.71403092574064
402017.66635518196072.33364481803928
411415.0953607091633-1.09536070916332
421415.4025485484696-1.40254854846959
431114.4345657214711-3.4345657214711
441515.5383992351137-0.53839923511368
451615.53646300843940.463536991560557
461415.5390123477301-1.53901234773008
471614.24350348029021.75649651970981
481415.2579445375908-1.25794453759079
491215.536411476808-3.536411476808
501615.07916257771950.92083742228054
51914.0777092244844-5.07770922448437
521414.6481805945081-0.648180594508136
531615.84362768782430.156372312175652
541615.13673366843500.863266331565044
551515.1765314565836-0.17653145658362
561615.30929014775190.690709852248111
571213.834886144174-1.83488614417401
581616.0146349523911-0.0146349523911425
591616.0712877176079-0.0712877176079438
601416.5237297074745-2.52372970747453
611613.14858413578872.85141586421132
621716.26642488060910.733575119390911
631814.66945222485043.33054777514959
641815.60623338350532.39376661649466
651214.7800039170512-2.7800039170512
661615.95375588828340.0462441117166169
671014.2951381926323-4.29513819263234
681412.48998830989281.51001169010716
691815.87970585556892.12029414443111
701816.46869878052451.53130121947546
711615.36323634142560.636763658574411
721615.38020769050950.619792309490548
731614.49690523319501.50309476680498
741315.0971435209546-2.09714352095457
751615.67724379105620.322756208943845
761614.80189074874921.19810925125082
772016.19141246681383.80858753318616
781615.16082863079210.839171369207863
791512.97761221645832.02238778354170
801515.4187091570014-0.418709157001429
811615.64824999216240.351750007837575
821413.98124243007500.018757569924991
831513.06361551693321.93638448306675
841214.7857487802600-2.78574878026002
851716.56019368535920.439806314640777
861615.26807153936870.731928460631289
871513.23866442102681.76133557897321
881313.7938932409074-0.793893240907372
891615.29540760064340.704592399356566
901615.00962867246580.990371327534184
911615.90668375985990.0933162401401393
921616.0765102180542-0.0765102180542046
931415.4254838247883-1.42548382478831
941613.73259615580732.26740384419271
951614.46793287186491.53206712813512
962016.07222041555523.92777958444479
971515.4721975088186-0.472197508818603
981613.94732647603382.05267352396622
991313.9811759440564-0.981175944056362
1001715.76431352387671.23568647612331
1011614.46319859390521.53680140609482
1021212.8878102245442-0.887810224544209
1031614.55884269786051.44115730213954
1041615.00340528467450.996594715325516
1051715.14072311766821.85927688233178
1061312.70536734918150.294632650818494
1071215.5685371317235-3.56853713172354
1081815.55616910729392.44383089270608
1091413.61614139775050.383858602249492
1101414.1918537242208-0.191853724220805
1111313.4772974918772-0.477297491877212
1121615.29476232769820.705237672301835
1131312.45789498850710.542105011492933
1141614.68318184255481.31681815744520
1151314.7804561320193-1.78045613201928
1161615.71869810954290.281301890457062
1171514.22670715994970.773292840050268
1181615.14824221672880.851757783271154
1191514.52677698220370.473223017796286
1201715.35888413148681.64111586851321
1211515.8911544822112-0.891154482211226
1221213.3572191455099-1.35721914550986
1231614.26173380588871.73826619411127
1241014.1383684300645-4.13836843006447
1251614.49030403236031.50969596763972
1261414.4339688656289-0.433968865628915
1271516.0553317082176-1.05533170821760
1281314.1411487810345-1.14114878103455
1291514.61026075067230.389739249327705
1301113.5018747385434-2.5018747385434
1311213.8421448683037-1.84214486830369
132814.0448976812577-6.04489768125772
1331615.92692874982850.0730712501715455
1341514.72380160825040.276198391749633
1351715.31990740651061.68009259348944
1361614.63591549038211.36408450961787
1371014.6684993842031-4.66849938420314
1381813.40700310066884.59299689933119
1391313.8367595921559-0.836759592155873
1401514.14581071739010.854189282609896
1411614.36260976668131.63739023331866
1421614.49726573153461.50273426846543
1431413.32124601972430.678753980275703
1441013.1811306844677-3.18113068446768
1451716.20364578869910.79635421130093
1461314.4082905442218-1.40829054422184
1471515.7366503936585-0.736650393658493
1481615.24753746335310.752462536646864
1491214.9459862233475-2.94598622334754
1501313.3100629366699-0.310062936669949


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.8270912939007090.3458174121985820.172908706099291
110.7253852992249280.5492294015501440.274614700775072
120.6066839932936180.7866320134127640.393316006706382
130.485598427655860.971196855311720.51440157234414
140.6145043521216690.7709912957566620.385495647878331
150.5150255174583580.9699489650832840.484974482541642
160.4301931654251650.860386330850330.569806834574835
170.4390160371245010.8780320742490030.560983962875499
180.4448193094032980.8896386188065960.555180690596702
190.3601667834157600.7203335668315210.63983321658424
200.348424736755920.696849473511840.65157526324408
210.3956057695875580.7912115391751160.604394230412442
220.3966897430246560.7933794860493120.603310256975344
230.3305315557500730.6610631115001460.669468444249927
240.2707680068402350.541536013680470.729231993159765
250.2184426955911330.4368853911822660.781557304408867
260.2067900721952080.4135801443904160.793209927804792
270.1770314694381270.3540629388762540.822968530561873
280.2423951751362330.4847903502724670.757604824863767
290.3277510916335480.6555021832670970.672248908366452
300.2730952047301980.5461904094603960.726904795269802
310.2491135018421750.4982270036843510.750886498157825
320.2082756521075260.4165513042150520.791724347892474
330.8809448845648030.2381102308703940.119055115435197
340.9239284858374440.1521430283251110.0760715141625556
350.9074754132347870.1850491735304260.0925245867652132
360.9083952242702640.1832095514594730.0916047757297365
370.8992153580595910.2015692838808180.100784641940409
380.9228796825322720.1542406349354560.0771203174677282
390.9088487536086010.1823024927827980.091151246391399
400.9532925830337590.09341483393248230.0467074169662412
410.941411318699930.1171773626001420.0585886813000709
420.9293434256258050.1413131487483890.0706565743741946
430.942775199414440.1144496011711180.0572248005855591
440.9268476860139580.1463046279720830.0731523139860417
450.9146293881853570.1707412236292850.0853706118146425
460.899257006246620.2014859875067610.100742993753380
470.8962070941186580.2075858117626830.103792905881342
480.8771821346433250.2456357307133490.122817865356675
490.9056143074056670.1887713851886650.0943856925943326
500.8933439261201460.2133121477597070.106656073879854
510.9548723425043120.09025531499137520.0451276574956876
520.9474718693143720.1050562613712570.0525281306856285
530.9393013779546950.1213972440906090.0606986220453047
540.9382052399382450.1235895201235100.0617947600617552
550.9277234122148330.1445531755703340.0722765877851668
560.9171997883236130.1656004233527730.0828002116763867
570.9119410394673780.1761179210652440.0880589605326222
580.897073797138540.205852405722920.10292620286146
590.8783976650666920.2432046698666170.121602334933308
600.8955588313487270.2088823373025470.104441168651273
610.9093009539495140.1813980921009720.0906990460504862
620.8909306549836110.2181386900327770.109069345016389
630.922721890554160.1545562188916790.0772781094458394
640.92945851094940.1410829781012000.0705414890505998
650.9485688401211860.1028623197576270.0514311598788136
660.9367955256003470.1264089487993050.0632044743996527
670.9759639019719860.04807219605602880.0240360980280144
680.972737184707490.05452563058502030.0272628152925101
690.9737098308642360.05258033827152880.0262901691357644
700.9709543353936920.05809132921261580.0290456646063079
710.96303265840460.0739346831907990.0369673415953995
720.9535506754384930.0928986491230140.046449324561507
730.9444703978933260.1110592042133470.0555296021066737
740.9545736248491720.09085275030165680.0454263751508284
750.9433957904246380.1132084191507230.0566042095753616
760.9315334871788360.1369330256423290.0684665128211644
770.9543314435815460.09133711283690850.0456685564184543
780.941782296435330.1164354071293400.0582177035646701
790.9350186947150640.1299626105698730.0649813052849365
800.92214769094980.1557046181004000.0778523090501999
810.9028733097194450.1942533805611090.0971266902805546
820.8810140158869970.2379719682260060.118985984113003
830.8715315463475290.2569369073049420.128468453652471
840.9121924686155480.1756150627689040.087807531384452
850.8953017141543440.2093965716913130.104698285845657
860.8716577490870280.2566845018259450.128342250912972
870.8532216200413440.2935567599173120.146778379958656
880.8384491746016230.3231016507967540.161550825398377
890.8113555652150080.3772888695699840.188644434784992
900.7773094048171570.4453811903656870.222690595182843
910.7462032659115030.5075934681769940.253796734088497
920.7126586099364850.5746827801270290.287341390063515
930.7464184952374520.5071630095250950.253581504762548
940.7403083726959650.5193832546080710.259691627304036
950.7056537263794410.5886925472411180.294346273620559
960.7551749160740840.4896501678518330.244825083925916
970.7221184146119420.5557631707761150.277881585388058
980.7171228363464460.5657543273071090.282877163653554
990.7031833633458780.5936332733082440.296816636654122
1000.662655651877060.6746886962458790.337344348122940
1010.6314849148124650.737030170375070.368515085187535
1020.5979109996042160.8041780007915670.402089000395784
1030.5526455158442470.8947089683115060.447354484155753
1040.5211055309782280.9577889380435440.478894469021772
1050.5073172063601010.9853655872797980.492682793639899
1060.4531801410845020.9063602821690050.546819858915498
1070.616831659510220.766336680979560.38316834048978
1080.6041066880743410.7917866238513190.395893311925659
1090.5810417932963970.8379164134072050.418958206703603
1100.5286177948129570.9427644103740850.471382205187043
1110.4758010555244230.9516021110488460.524198944475577
1120.4197119582059830.8394239164119650.580288041794017
1130.3775905183514420.7551810367028840.622409481648558
1140.355696699311870.711393398623740.64430330068813
1150.3497842356049280.6995684712098570.650215764395072
1160.2963318850326860.5926637700653730.703668114967314
1170.2742890575804110.5485781151608220.725710942419589
1180.2757499863900630.5514999727801270.724250013609937
1190.2263657239483340.4527314478966680.773634276051666
1200.1984088520074820.3968177040149650.801591147992518
1210.1633963092836530.3267926185673070.836603690716347
1220.1458924625697050.2917849251394090.854107537430295
1230.1340244939845680.2680489879691360.865975506015432
1240.1930978077405080.3861956154810160.806902192259492
1250.1577735387976030.3155470775952070.842226461202397
1260.1288301587298590.2576603174597170.871169841270142
1270.09822701668975360.1964540333795070.901772983310246
1280.08098241002659780.1619648200531960.919017589973402
1290.05654128332379160.1130825666475830.943458716676208
1300.0573073257549680.1146146515099360.942692674245032
1310.04893891414192110.09787782828384230.951061085858079
1320.5745003706643370.8509992586713260.425499629335663
1330.4896654804006570.9793309608013150.510334519599343
1340.3970619758812170.7941239517624340.602938024118783
1350.3418441852011370.6836883704022730.658155814798863
1360.25303230363740.50606460727480.7469676963626
1370.701751455701720.5964970885965610.298248544298281
1380.6388576418807240.7222847162385520.361142358119276
1390.5388900640802390.9222198718395210.461109935919761
1400.3782396876326520.7564793752653040.621760312367348


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level10.00763358778625954OK
10% type I error level110.083969465648855OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/10kts11290473590.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/10kts11290473590.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/161va1290473590.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/161va1290473590.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/261va1290473590.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/261va1290473590.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/361va1290473590.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/361va1290473590.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/791tg1290473590.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290474391r9zo53yn8td0xk8/791tg1290473590.ps (open in new window)


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


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


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