Home » date » 2010 » Nov » 23 »

Workshop 7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 15:17:38 +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/t1290525397oskzt0o6hfmkfrr.htm/, Retrieved Tue, 23 Nov 2010 16:16:52 +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/t1290525397oskzt0o6hfmkfrr.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 «
4 2 5 4 3 4 2 4 3 2 5 4 4 2 2 3 2 4 2 2 4 3 2 2 2 3 4 5 2 2 4 3 5 3 2 3 3 4 2 1 2 3 3 1 2 4 2 4 2 2 2 4 4 2 2 2 3 3 2 2 1 3 3 2 2 4 4 4 2 2 4 4 5 1 1 2 3 4 2 2 2 3 2 2 1 3 3 4 3 2 3 4 4 4 2 3 2 4 4 2 4 5 4 4 4 3 4 4 4 2 2 2 4 4 4 2 3 5 2 2 4 4 4 2 2 4 4 4 4 2 3 3 4 2 2 4 4 4 3 2 2 4 4 2 2 4 1 4 4 2 4 4 4 3 3 5 5 2 4 2 5 2 4 2 2 4 4 4 2 2 4 3 5 4 3 4 2 5 5 4 2 4 4 2 1 4 5 3 4 2 4 4 4 4 3 4 4 5 5 3 3 4 4 3 2 2 3 4 2 2 3 4 5 3 2 4 2 4 2 2 3 2 5 1 2 2 4 4 2 2 4 2 4 4 4 4 4 4 4 4 3 4 3 4 2 4 1 4 4 3 3 4 4 2 2 4 2 4 2 2 2 1 2 1 1 4 4 3 4 3 4 3 5 2 4 4 2 4 4 2 4 4 4 2 2 3 3 5 2 1 1 2 3 1 2 3 2 5 2 2 3 3 4 2 2 4 2 5 2 2 2 1 4 2 2 3 3 4 1 1 5 2 5 5 2 4 3 4 3 3 4 3 4 2 2 3 3 5 1 1 4 2 4 2 2 2 3 3 4 4 3 2 4 2 2 4 4 5 5 3 3 4 5 4 4 4 4 5 3 2 4 2 4 2 4 3 3 4 2 1 3 4 5 2 2 2 3 5 2 2 4 4 4 4 4 3 2 5 2 3 2 3 3 2 2 2 3 4 4 2 3 4 4 4 2 2 2 4 2 3 2 4 4 2 2 4 2 4 3 2 4 2 5 2 1 4 4 4 4 2 2 3 4 2 2 2 4 4 4 4 4 2 5 1 1 2 2 3 2 2 3 3 3 3 2 3 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time24 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
YT[t] = + 1.29605226452594 + 0.0689248642585393X1[t] + 0.252916716305925X2[t] + 0.363828375948588X3[t] -0.118420136069921X4[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.296052264525940.4319793.00030.0031530.001577
X10.06892486425853930.0736190.93620.3506340.175317
X20.2529167163059250.08263.06190.0026010.001301
X30.3638283759485880.0724445.02221e-061e-06
X4-0.1184201360699210.089782-1.3190.1891630.094582


Multiple Linear Regression - Regression Statistics
Multiple R0.456901675014126
R-squared0.208759140630714
Adjusted R-squared0.187937012752575
F-TEST (value)10.0258312624181
F-TEST (DF numerator)4
F-TEST (DF denominator)152
p-value3.15112685944641e-07
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.866596311038476
Sum Squared Residuals114.150353278435


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
143.798538670157230.201461329842773
243.300213713972640.699786286027362
353.074235066541131.92576493345887
432.936385338024050.0636146619759458
542.499476769670741.50052323032926
633.32715178284706-0.327151782847056
743.62205529453710.377944705462896
833.12373033835251-0.123730338352512
922.38856511002808-0.388565110028079
1042.936385338024051.06361466197595
1123.07423506654113-1.07423506654113
1222.75239348597667-0.752393485976667
1312.75239348597667-1.75239348597667
1443.074235066541130.925764933458869
1543.081743542968390.918256457031611
1623.00531020228259-1.00531020228259
1722.61789690574066-0.617896905740663
1833.36913857823118-0.369138578231179
1933.80189181843831-0.801891818438307
2033.66404208992123-0.664042089921228
2143.633976410557000.366023589442996
2233.80189181843831-0.801891818438307
2323.42720181778139-1.42720181778139
2423.25822691858852-1.25822691858852
2543.074235066541130.925764933458869
2643.801891818438310.198108181561693
2733.00531020228259-0.00531020228259128
2843.438063442489720.561936557510281
2923.07423506654113-1.07423506654113
3043.595117225662690.404882774337312
3143.31964330641980.680356693580202
3253.3649832500851.63501674991500
3352.936385338024052.06361466197595
3443.074235066541130.925764933458869
3543.867463534415770.132536465584229
3644.0439469100359-0.0439469100358984
3723.19265520261105-1.19265520261105
3843.617899966390920.382100033609078
3943.683471682368390.316528317631614
4044.3002167746229-0.300216774622899
4133.43806344248972-0.438063442489719
4223.00531020228259-1.00531020228259
4333.69098015879564-0.690980158795644
4442.936385338024051.06361466197595
4532.825473678381390.174526321618612
4623.07423506654113-1.07423506654113
4743.427201817781390.572798182218614
4843.565051546298460.434948453701535
4933.54897510213238-0.548975102132382
5043.476697089592770.523302910407233
5133.07423506654113-0.0742350665411309
5242.936385338024051.06361466197595
5322.11621880127500-0.116218801274996
5443.430554966062460.569445033937539
5543.021386646448670.978613353551326
5643.664042089921230.335957910078772
5743.074235066541130.925764933458869
5833.37664705465844-0.376647054658437
5912.31964024576954-1.31964024576954
6033.18930205432998-0.189302054329976
6133.00531020228259-0.00531020228259128
6243.189302054329980.810697945670024
6322.86746047376551-0.867460473765512
6432.759901962403920.240098037596076
6554.280787182175740.719212817824259
6643.250718442161260.749281557838742
6743.005310202282590.99468979771741
6833.01281867870985-0.0128186787098493
6942.936385338024051.06361466197595
7023.243209965734-1.243209965734
7132.936385338024050.0636146619759482
7244.3002167746229-0.300216774622899
7333.81796826260439-0.81796826260439
7443.690980158795640.309019841204356
7542.699545065884211.30045493411579
7633.12373033835251-0.123730338352512
7733.32715178284706-0.327151782847056
7823.25822691858852-1.25822691858852
7943.565051546298460.434948453701535
8033.07088191826006-0.0708819182600554
8122.75239348597667-0.752393485976667
8223.73296695417977-1.73296695417977
8333.80189181843831-0.801891818438307
8422.81796520195413-0.81796520195413
8523.07423506654113-1.07423506654113
8643.300213713972640.69978628602736
8743.30772219039990.692277809600103
8843.801891818438310.198108181561693
8923.00531020228259-1.00531020228259
9023.56505154629846-1.56505154629846
9142.943893814451311.05610618554869
9222.68346862171813-0.683468621718127
9333.11622186192525-0.116221861925255
9433.25822691858852-0.258226918588516
9553.886893126862931.11310687313707
9632.699545065884210.300454934115790
9743.250718442161260.749281557838742
9833.07423506654113-0.0742350665411309
9922.88689006621267-0.88689006621267
10043.074235066541130.925764933458869
10133.12373033835251-0.123730338352512
10233.00531020228259-0.00531020228259128
10332.936385338024050.0636146619759482
10443.62205529453710.377944705462896
10512.19371163327236-1.19371163327236
10633.00531020228259-0.00531020228259128
10723.03978852123946-1.03978852123946
10833.3196433064198-0.319643306419798
10923.18930205432998-1.18930205432998
11022.57591011035654-0.575910110356539
11122.83739479440129-0.837394794401289
11242.614543757459591.38545624254041
11354.234645058645430.765354941354565
11452.690977098145382.30902290185462
11533.00531020228259-0.00531020228259128
11642.568401633929281.43159836607072
11742.108710324847741.89128967515226
11833.02473979472975-0.0247397947297494
11922.87081362204659-0.870813622046588
12043.978375194058430.0216248059415657
12122.75239348597667-0.752393485976667
12232.633973349906750.366026650093254
12323.3077221903999-1.30772219039990
12422.93638533802405-0.936385338024052
12522.70289821416528-0.702898214165285
12643.192655202611050.807344797388948
12743.369138578231180.630861421768821
12843.005310202282590.99468979771741
12943.614546818109850.385453181890154
13033.54897510213238-0.548975102132382
13123.00531020228259-1.00531020228259
13243.801891818438310.198108181561693
13333.80189181843831-0.801891818438307
13422.93638533802405-0.936385338024052
13543.801891818438310.198108181561693
13632.928876861596790.0711231384032061
13733.07423506654113-0.0742350665411309
13833.00531020228259-0.00531020228259128
13932.744885009549410.255114990450591
14033.15820865730938-0.158208657309378
14143.664042089921230.335957910078772
14253.847231762103511.15276823789649
14323.05480547409397-1.05480547409397
14443.132298306091340.867701693908663
14533.72545847775251-0.72545847775251
14632.381056633600820.61894336639918
14712.49947676967074-1.49947676967074
14823.07423506654113-1.07423506654113
14942.821318350235211.17868164976479
15042.837394794401291.16260520559871
15154.047300058316970.952699941683026
15222.81380987380795-0.813809873807948
15343.396076647105600.603923352894405
15433.00531020228259-0.00531020228259128
15523.36913857823118-1.36913857823118
15643.31964330641980.680356693580202
15722.46605794202544-0.466057942025443


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.4722296176606850.944459235321370.527770382339315
90.4172436076145470.8344872152290930.582756392385453
100.5815136204449510.8369727591100970.418486379555049
110.7734984992513510.4530030014972980.226501500748649
120.8399073860076920.3201852279846150.160092613992308
130.9585673737704670.08286525245906540.0414326262295327
140.953679335029140.09264132994172170.0463206649708608
150.9447368771599660.1105262456800670.0552631228400336
160.9500541099489240.09989178010215160.0499458900510758
170.937640459578180.1247190808436380.0623595404218189
180.9165927445097120.1668145109805770.0834072554902883
190.89671407025460.2065718594907980.103285929745399
200.8680596721727460.2638806556545090.131940327827254
210.8327059125751180.3345881748497640.167294087424882
220.7953580608131850.4092838783736300.204641939186815
230.8396606803482030.3206786393035940.160339319651797
240.8868690222486610.2262619555026780.113130977751339
250.8809990363652170.2380019272695650.119000963634783
260.8530517236516790.2938965526966430.146948276348321
270.812691236521850.3746175269563010.187308763478151
280.7849274191599220.4301451616801560.215072580840078
290.813795564193610.3724088716127800.186204435806390
300.7990037405133660.4019925189732680.200996259486634
310.7862680219323280.4274639561353450.213731978067672
320.8478407093884670.3043185812230650.152159290611533
330.9532372388003190.09352552239936240.0467627611996812
340.9502236077193920.09955278456121640.0497763922806082
350.9350280020508010.1299439958983980.0649719979491991
360.9166627425875250.1666745148249510.0833372574124753
370.9348527227014190.1302945545971620.065147277298581
380.9177114090815310.1645771818369380.0822885909184688
390.8968714680160460.2062570639679080.103128531983954
400.8733890699595930.2532218600808140.126610930040407
410.8521763972699450.2956472054601090.147823602730055
420.8598521084392390.2802957831215230.140147891560762
430.8443157184716630.3113685630566740.155684281528337
440.8565778868733510.2868442262532980.143422113126649
450.826734744696390.3465305106072190.173265255303610
460.8421921679089720.3156156641820550.157807832091028
470.8188314518958150.362337096208370.181168548104185
480.7883265267635310.4233469464729370.211673473236469
490.7659994274143060.4680011451713870.234000572585693
500.7366663446842640.5266673106314710.263333655315736
510.6943854157007250.6112291685985510.305614584299276
520.7063250014188970.5873499971622060.293674998581103
530.6691647750036650.6616704499926690.330835224996335
540.6364854291097330.7270291417805330.363514570890266
550.6273151387668550.7453697224662890.372684861233145
560.5896551068537090.8206897862925820.410344893146291
570.5902476209382510.8195047581234980.409752379061749
580.546650655654430.906698688691140.45334934434557
590.6306153031257990.7387693937484020.369384696874201
600.5856567692315920.8286864615368160.414343230768408
610.5381185831823340.9237628336353320.461881416817666
620.5328273371656510.9343453256686980.467172662834349
630.5323456315416490.9353087369167030.467654368458351
640.4895595812019660.9791191624039320.510440418798034
650.4823489498982360.9646978997964710.517651050101764
660.4647519868166710.9295039736333410.535248013183329
670.475478251391850.95095650278370.52452174860815
680.4286587977832530.8573175955665050.571341202216747
690.4491082184699970.8982164369399950.550891781530003
700.5124172357258190.9751655285483610.487582764274181
710.4660861997247190.9321723994494390.533913800275281
720.4251352701485570.8502705402971150.574864729851443
730.4213549857971590.8427099715943180.578645014202841
740.3820351790590190.7640703581180370.617964820940981
750.4310999418992740.8621998837985480.568900058100726
760.3861946627909850.772389325581970.613805337209015
770.3483381811560950.696676362312190.651661818843905
780.3928492166100690.7856984332201380.607150783389931
790.3592820931069640.7185641862139270.640717906893036
800.3186275884439370.6372551768878740.681372411556063
810.3110964704011630.6221929408023250.688903529598837
820.4297237020094060.8594474040188120.570276297990594
830.4207126249773460.8414252499546920.579287375022654
840.4174348772200910.8348697544401820.582565122779909
850.4431550214636740.8863100429273470.556844978536326
860.4287067423565880.8574134847131760.571293257643412
870.4149690650368040.8299381300736070.585030934963196
880.3725989959088070.7451979918176140.627401004091193
890.3861072203833830.7722144407667660.613892779616617
900.4867031476280420.9734062952560830.513296852371959
910.5168017459129690.9663965081740620.483198254087031
920.4946232522518180.9892465045036350.505376747748182
930.4481507347913540.8963014695827080.551849265208646
940.4045036021556720.8090072043113450.595496397844328
950.428687045783850.85737409156770.57131295421615
960.3947200441594870.7894400883189740.605279955840513
970.3879263702325820.7758527404651630.612073629767419
980.3429540557826980.6859081115653960.657045944217302
990.3376524062572290.6753048125144590.662347593742771
1000.3405008573429960.6810017146859920.659499142657004
1010.2976115089872240.5952230179744490.702388491012776
1020.2566845034047640.5133690068095280.743315496595236
1030.2202188229650770.4404376459301550.779781177034923
1040.1952064046867300.3904128093734610.80479359531327
1050.2191536986535810.4383073973071630.780846301346419
1060.1843094192616860.3686188385233710.815690580738314
1070.2036925996815980.4073851993631960.796307400318402
1080.1732357251466310.3464714502932630.826764274853369
1090.1875169051976430.3750338103952860.812483094802357
1100.1704654488744490.3409308977488990.82953455112555
1110.1660053222098690.3320106444197380.833994677790131
1120.2222080578895400.4444161157790810.77779194211046
1130.2076836804999270.4153673609998550.792316319500073
1140.5668591735613060.8662816528773880.433140826438694
1150.5163180697519830.9673638604960350.483681930248017
1160.5873185810755170.8253628378489660.412681418924483
1170.879088047951620.2418239040967610.120911952048381
1180.8577063905596690.2845872188806620.142293609440331
1190.8365533935095020.3268932129809970.163446606490498
1200.8005420861198690.3989158277602630.199457913880131
1210.7723749144637990.4552501710724020.227625085536201
1220.7454239300488090.5091521399023830.254576069951191
1230.7499593393385050.500081321322990.250040660661495
1240.7246897756342670.5506204487314660.275310224365733
1250.7158959048010930.5682081903978130.284104095198907
1260.7222723999956350.5554552000087310.277727600004365
1270.7105272006754840.5789455986490320.289472799324516
1280.7807181419839570.4385637160320860.219281858016043
1290.7347161396905580.5305677206188830.265283860309442
1300.7158742598061470.5682514803877070.284125740193853
1310.6979811237213640.6040377525572720.302018876278636
1320.6353724771634320.7292550456731350.364627522836568
1330.678460024344350.64307995131130.32153997565565
1340.6308751702925350.738249659414930.369124829707465
1350.5638491095253870.8723017809492270.436150890474613
1360.5060108429226590.9879783141546810.493989157077341
1370.4311525146849840.8623050293699680.568847485315016
1380.3618461047888530.7236922095777060.638153895211147
1390.3079120555086690.6158241110173370.692087944491331
1400.2582399237077950.516479847415590.741760076292205
1410.2509930827849630.5019861655699250.749006917215037
1420.2607728065395060.5215456130790130.739227193460494
1430.1991847630475460.3983695260950910.800815236952454
1440.1731594432958150.3463188865916290.826840556704185
1450.1257388797654760.2514777595309520.874261120234524
1460.2027311996591770.4054623993183530.797268800340823
1470.1418615859295780.2837231718591550.858138414070422
1480.1866465598064570.3732931196129150.813353440193542
1490.3670527223575740.7341054447151490.632947277642426


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 level50.0352112676056338OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/10mkpn1290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/10mkpn1290525433.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/1x1st1290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/1x1st1290525433.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/2qs9w1290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/2qs9w1290525433.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/3qs9w1290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/3qs9w1290525433.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/61j9h1290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/61j9h1290525433.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/7bb821290525433.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290525397oskzt0o6hfmkfrr/7bb821290525433.ps (open in new window)


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


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


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by