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 16:40:54 +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/t12919992718in0u94hflxlyyb.htm/, Retrieved Fri, 10 Dec 2010 17:41:11 +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/t12919992718in0u94hflxlyyb.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 26 21 21 23 17 23 4 1 20 16 15 24 17 20 4 1 19 19 18 22 18 20 6 2 19 18 11 20 21 21 8 1 20 16 8 24 20 24 8 1 25 23 19 27 28 22 4 2 25 17 4 28 19 23 4 1 22 12 20 27 22 20 8 1 26 19 16 24 16 25 5 1 22 16 14 23 18 23 4 2 17 19 10 24 25 27 4 2 22 20 13 27 17 27 4 1 19 13 14 27 14 22 4 1 24 20 8 28 11 24 4 1 26 27 23 27 27 25 4 2 21 17 11 23 20 22 8 1 13 8 9 24 22 28 4 2 26 25 24 28 22 28 4 2 20 26 5 27 21 27 4 1 22 13 15 25 23 25 8 2 14 19 5 19 17 16 4 1 21 15 19 24 24 28 7 1 7 5 6 20 14 21 4 2 23 16 13 28 17 24 4 1 17 14 11 26 23 27 5 1 25 24 17 23 24 14 4 1 25 24 17 23 24 14 4 1 19 9 5 20 8 27 4 2 20 19 9 11 22 20 4 1 23 19 15 24 23 21 4 2 22 25 17 25 25 22 4 1 22 19 17 23 21 21 4 1 21 18 20 18 24 12 15 2 15 15 12 20 15 20 10 2 20 12 7 20 22 24 4 2 22 21 16 24 21 19 8 1 18 12 7 23 25 28 4 2 20 15 14 25 16 23 4 2 28 28 24 28 28 27 4 1 22 25 15 26 23 22 4 1 18 19 15 26 21 27 7 1 23 20 10 23 21 26 4 1 20 24 14 22 26 22 6 2 25 26 18 24 22 21 5 2 26 25 12 21 21 19 4 1 1 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time15 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
AM[t] = + 12.4988741565566 -0.441931117230605G[t] -0.185414422148506IM1[t] -0.138080158199122IM2[t] + 0.195649644221861IM3[t] -0.182548514840863EM1[t] + 0.083052060156604EM2[t] + 0.000807027024654495EM3[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)12.49887415655661.7559837.117900
G-0.4419311172306050.400716-1.10290.2718110.135905
IM1-0.1854144221485060.073716-2.51530.012920.00646
IM2-0.1380801581991220.066287-2.08310.0388980.019449
IM30.1956496442218610.0486624.02069.1e-054.5e-05
EM1-0.1825485148408630.071556-2.55110.0117130.005856
EM20.0830520601566040.0556281.4930.1374870.068744
EM30.0008070270246544950.057360.01410.9887930.494396


Multiple Linear Regression - Regression Statistics
Multiple R0.489720104489983
R-squared0.23982578074168
Adjusted R-squared0.205272407139029
F-TEST (value)6.94073416678714
F-TEST (DF numerator)7
F-TEST (DF denominator)154
p-value3.49570361768414e-07
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.34105723547157
Sum Squared Residuals844.004542882085


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
145.67695807283194-1.67695807283193
246.12097793547255-2.12097793547255
366.9272499055276-0.927249905527603
485.868911674119282.13108832588072
585.003814714487952.99618528551205
645.37748446547298-1.37748446547298
741.900079604883542.09992039511646
887.148332701341760.851667298658239
954.710883647172680.289116352827322
1045.8225211030251-1.82252110302510
1145.5128670594062-1.5128670594062
1243.822601697354710.177398302645285
1345.72979551705347-1.72979551705347
1442.232173792324551.76782620767545
1545.34171700833279-1.34171700833279
1685.006272410366852.99372758963315
1747.77133880775415-3.77133880775415
1844.77620811717237-0.776208117172371
1942.131960679308521.86803932069148
2086.484188546994931.51581145300507
2145.33031090042269-1.33031090042269
2277.44406288570407-0.444062885704072
2348.771245271515-4.771245271515
2444.00453831208787-0.00453831208786888
2556.30964746185934-1.30964746185934
2645.23963462136993-1.23963462136993
2745.23963462136993-1.23963462136993
2845.30483172992289-1.30483172992289
2946.87929947202764-2.87929947202764
3045.64961358239394-1.64961358239394
3144.94027785905784-0.940277859057837
3246.24277168751383-2.24277168751383
33158.307850711979276.69214928802073
34106.721340093568253.27865990643175
3545.81485276550862-1.81485276550862
3685.144868040772952.85513195922705
3746.33235147108208-2.33235147108208
3845.3582978382957-1.3582978382957
3944.48864413219296-0.488644132192964
4044.64225705269065-0.642257052690649
4176.050326705289470.949673294710535
4244.55376473273644-0.553764732736442
4365.934866650798180.065133349201817
4454.374189385981460.625810614018543
4543.615936687017580.384063312982421
46167.242947041299078.75705295870093
4755.56274255402683-0.562742554026828
48125.290788903206736.70921109679327
4966.20349782699895-0.20349782699895
5097.592874565227331.40712543477267
5197.082906004606451.91709399539355
5246.65390485968321-2.65390485968321
5355.96485434536672-0.96485434536672
5446.66621437839058-2.66621437839058
5545.65864780137634-1.65864780137634
5655.65935022319656-0.65935022319656
5745.76105102414779-1.76105102414779
5843.834515280358040.165484719641961
5945.16427660757093-1.16427660757093
6057.98328923790498-2.98328923790498
6145.46029298462823-1.46029298462824
6266.91465313012529-0.914653130125286
6345.04484313969089-1.04484313969089
6444.02427249926857-0.0242724992685656
65187.6607546984323810.3392453015676
6643.386239824405600.613760175594404
6766.17818719124655-0.178187191246545
6845.33503213281464-1.33503213281464
6946.50825710546325-2.50825710546325
7056.63071581127478-1.63071581127478
7145.33204741816375-1.33204741816375
7244.95272136304416-0.952721363044156
7355.10442451953804-0.104424519538036
74106.707153586931033.29284641306897
7556.21398867955508-1.21398867955508
7688.1759233156236-0.175923315623595
7788.19236771015125-0.192367710151250
7855.08110361765834-0.0811036176583432
7945.05003984475139-1.05003984475139
8045.91431934416135-1.91431934416135
8142.367580547806741.63241945219326
8256.62895445417955-1.62895445417955
8345.0866077514322-1.0866077514322
8445.21603421000194-1.21603421000194
8586.93848515798071.0615148420193
8645.50634011730237-1.50634011730237
8755.07846171857777-0.0784617185777747
88147.610456066550546.38954393344946
8986.125719018625891.87428098137411
9085.923973803330152.07602619666985
9147.84711143795842-3.84711143795842
9244.14134820762883-0.141348207628825
9365.676227702879880.323772297120118
9445.95603910732897-1.95603910732897
9576.321059717180340.678940282819657
9675.599519357446271.40048064255373
9744.64454724179112-0.644547241791122
9866.60336015987926-0.603360159879262
9945.7930760902168-1.79307609021680
10074.87429816711012.1257018328899
10145.7917785366493-1.79177853664930
10243.273996796988670.72600320301133
10386.711270914592611.28872908540739
10445.96823057502311-1.96823057502311
10545.65559874662117-1.65559874662117
106107.139968605162062.86003139483794
10786.799875292212171.20012470778783
10866.45554336087752-0.455543360877523
10944.70878364854452-0.708783648544517
11045.63703701072413-1.63703701072413
11144.02419554742627-0.0241955474262719
11254.886417799596540.113582200403463
11346.70995107093478-2.70995107093478
11466.3326944811654-0.332694481165405
11545.19887859350065-1.19887859350065
11655.98394956717018-0.98394956717018
11777.6595020266622-0.659502026662194
11885.940135966935742.05986403306426
11954.520084308029690.479915691970305
12087.806114796276620.193885203723384
121107.551850057918912.44814994208109
12286.876469741769361.12353025823064
12355.85158595629847-0.851585956298474
124128.51583529435923.48416470564079
12541.994216532046342.00578346795366
12654.683772373041810.316227626958187
12746.5285233371888-2.52852333718880
12865.390750911599360.609249088400642
12946.85623497499053-2.85623497499053
13045.32951311736035-1.32951311736035
13177.26406235006322-0.264062350063223
13276.2913169439420.708683056057996
133106.925192294412333.07480770558767
13445.7440495153258-1.7440495153258
13555.88312843473695-0.883128434736946
13685.65253124921862.3474687507814
137115.295418485684475.70458151431553
13876.076387148362690.923612851637312
13944.90458522192834-0.904585221928338
14086.673137187169651.32686281283035
14166.33550975171926-0.335509751719256
14276.427588444917060.57241155508294
14357.64453058875027-2.64453058875027
14446.12701170487861-2.12701170487861
14585.303245024984352.69675497501565
14646.00125121754969-2.00125121754969
14785.56690392722242.4330960727776
14863.658700210331872.34129978966813
14945.69311296301741-1.69311296301741
15096.139285798015452.86071420198455
15155.47041741820395-0.470417418203952
15265.20925990440770.790740095592295
15345.37004610455364-1.37004610455364
15443.73637712119850.263622878801498
15543.908993087011980.0910069129880203
15656.47633105093158-1.47633105093158
15767.3945195585339-1.39451955853390
158168.805583579182067.19441642081794
15965.676227702879880.323772297120118
16066.96123334077925-0.961233340779253
16146.52950713668606-2.52950713668606
16246.88164485267556-2.88164485267556


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.4986875545513510.9973751091027030.501312445448649
120.4553903007373470.9107806014746950.544609699262653
130.3270318692412580.6540637384825160.672968130758742
140.2745888696801240.5491777393602480.725411130319876
150.1940352417331460.3880704834662920.805964758266854
160.1761285232411230.3522570464822460.823871476758877
170.1430675558448480.2861351116896960.856932444155152
180.09856220395960270.1971244079192050.901437796040397
190.06538537017751920.1307707403550380.93461462982248
200.07519912241899960.1503982448379990.924800877581
210.07509152768302870.1501830553660570.924908472316971
220.05282967623961170.1056593524792230.947170323760388
230.04360914864833870.08721829729667740.956390851351661
240.03051069651688460.06102139303376910.969489303483115
250.01915227842270650.03830455684541310.980847721577293
260.01685238531115910.03370477062231830.98314761468884
270.01175762395665170.02351524791330340.988242376043348
280.01154028953588220.02308057907176430.988459710464118
290.01638636742604060.03277273485208110.98361363257396
300.01246903766752270.02493807533504550.987530962332477
310.008009009243868250.01601801848773650.991990990756132
320.005644989223305980.01128997844661200.994355010776694
330.3363769426847890.6727538853695780.663623057315211
340.4417518318257250.883503663651450.558248168174275
350.4501038470792620.9002076941585250.549896152920738
360.4321302587138360.8642605174276710.567869741286164
370.3928808839341860.7857617678683720.607119116065814
380.3808377046758970.7616754093517930.619162295324103
390.3302283136695840.6604566273391690.669771686330416
400.2800647193691980.5601294387383960.719935280630802
410.2988550731334860.5977101462669720.701144926866514
420.2540414518447220.5080829036894430.745958548155278
430.2200704469785220.4401408939570430.779929553021478
440.182903221879610.365806443759220.81709677812039
450.1536825695963950.3073651391927890.846317430403605
460.8543696276852490.2912607446295020.145630372314751
470.8288036275291450.342392744941710.171196372470855
480.954958643555920.09008271288816170.0450413564440808
490.9421313436609990.1157373126780030.0578686563390014
500.933281777006570.1334364459868610.0667182229934304
510.9311900526812340.1376198946375320.068809947318766
520.9326671768350770.1346656463298450.0673328231649226
530.9167558097042470.1664883805915070.0832441902957535
540.922495703898630.1550085922027420.0775042961013708
550.915781271741650.1684374565166990.0842187282583493
560.8962217150947150.2075565698105700.103778284905285
570.8842878566274070.2314242867451870.115712143372593
580.8587340833458940.2825318333082120.141265916654106
590.8361111749679010.3277776500641980.163888825032099
600.8483551014103880.3032897971792250.151644898589613
610.8270901654548670.3458196690902650.172909834545133
620.7976384540090230.4047230919819550.202361545990977
630.7688272984314290.4623454031371420.231172701568571
640.7348483126141320.5303033747717370.265151687385868
650.9973337547959490.005332490408102360.00266624520405118
660.996261055019420.007477889961161730.00373894498058087
670.9947298085369670.01054038292606510.00527019146303254
680.9934334327067670.0131331345864660.006566567293233
690.9936777386359380.01264452272812340.00632226136406172
700.9926171503754860.01476569924902720.00738284962451362
710.9910465371778730.01790692564425370.00895346282212685
720.9884708208682340.02305835826353140.0115291791317657
730.9844973742665560.03100525146688860.0155026257334443
740.9888881158344220.02222376833115550.0111118841655777
750.9863024601204140.02739507975917270.0136975398795864
760.9816234678991180.03675306420176310.0183765321008816
770.9756488294261020.0487023411477960.024351170573898
780.9681961540207540.06360769195849110.0318038459792455
790.9616743850948620.07665122981027650.0383256149051382
800.958560363613960.08287927277208140.0414396363860407
810.9584556399607520.08308872007849660.0415443600392483
820.9531337065221910.0937325869556180.046866293477809
830.9435202235445810.1129595529108370.0564797764554187
840.93248925953110.13502148093780.0675107404689
850.9194369340030950.1611261319938090.0805630659969045
860.9095077183145170.1809845633709650.0904922816854827
870.8910707772609450.217858445478110.108929222739055
880.977832634076120.04433473184776160.0221673659238808
890.9737332426685470.05253351466290580.0262667573314529
900.9707563317866360.0584873364267290.0292436682133645
910.978397873824050.04320425235190050.0216021261759502
920.9715662201173730.05686755976525340.0284337798826267
930.9630518623591680.07389627528166380.0369481376408319
940.9601411918213830.07971761635723440.0398588081786172
950.9497332700665440.1005334598669120.0502667299334558
960.9399661844201470.1200676311597060.0600338155798528
970.9248931611280270.1502136777439470.0751068388719734
980.9074667556053330.1850664887893330.0925332443946666
990.8973923007675860.2052153984648270.102607699232414
1000.8923740534036030.2152518931927950.107625946596397
1010.8849203407308550.230159318538290.115079659269145
1020.8651782192810120.2696435614379760.134821780718988
1030.8435058794294060.3129882411411870.156494120570594
1040.8407144514369810.3185710971260370.159285548563019
1050.8231289088416880.3537421823166230.176871091158312
1060.8356168674483120.3287662651033770.164383132551688
1070.814932300417650.3701353991647010.185067699582351
1080.7802104842958740.4395790314082510.219789515704126
1090.750693483566530.4986130328669410.249306516433471
1100.737340203143930.525319593712140.26265979685607
1110.695586189829980.608827620340040.30441381017002
1120.648978844557180.7020423108856390.351021155442819
1130.6575975454859120.6848049090281770.342402454514088
1140.6116841349996510.7766317300006980.388315865000349
1150.5921880008969860.8156239982060280.407811999103014
1160.5471874493180710.9056251013638580.452812550681929
1170.5084656829936690.9830686340126630.491534317006331
1180.4785979732645110.9571959465290210.521402026735489
1190.4327701663333890.8655403326667780.567229833666611
1200.3819671678490360.7639343356980720.618032832150964
1210.3700529134039920.7401058268079850.629947086596008
1220.3229794231108780.6459588462217550.677020576889122
1230.2874648204766940.5749296409533870.712535179523306
1240.4100677926920960.8201355853841930.589932207307904
1250.3750931203574390.7501862407148780.624906879642561
1260.3207055540655890.6414111081311780.679294445934411
1270.3394686551966050.6789373103932110.660531344803395
1280.2878689977210440.5757379954420880.712131002278956
1290.2880050957480250.576010191496050.711994904251975
1300.2479517319449910.4959034638899820.752048268055009
1310.2012978722869410.4025957445738810.79870212771306
1320.1610742231547370.3221484463094740.838925776845263
1330.2465272329503040.4930544659006070.753472767049696
1340.2067280974360800.4134561948721610.79327190256392
1350.2130475847923860.4260951695847720.786952415207614
1360.286628130645930.573256261291860.71337186935407
1370.5308950466561350.938209906687730.469104953343865
1380.467856699618410.935713399236820.53214330038159
1390.5063231515896630.9873536968206740.493676848410337
1400.430266152224920.860532304449840.56973384777508
1410.4343675770778240.8687351541556480.565632422922176
1420.3611545559669910.7223091119339820.638845444033009
1430.4907823356071360.9815646712142730.509217664392864
1440.4253844382179630.8507688764359270.574615561782037
1450.3570844938757620.7141689877515240.642915506124238
1460.2829017085575620.5658034171151230.717098291442438
1470.2391120629874400.4782241259748790.76088793701256
1480.5704107519326440.8591784961347120.429589248067356
1490.4530888008406440.9061776016812890.546911199159356
1500.6879687627977180.6240624744045650.312031237202282
1510.5708474653599010.8583050692801990.429152534640099


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level20.0141843971631206NOK
5% type I error level230.163120567375887NOK
10% type I error level360.25531914893617NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/109rd91291999235.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/109rd91291999235.ps (open in new window)


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/658ek1291999235.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/658ek1291999235.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/758ek1291999235.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/758ek1291999235.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/8gid51291999235.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/8gid51291999235.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/9gid51291999235.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t12919992718in0u94hflxlyyb/9gid51291999235.ps (open in new window)


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