Home » date » 2010 » Nov » 24 »

WS 7 multiple model

*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 23:53:07 +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/24/t1290556474l4hehj5lt81y5eu.htm/, Retrieved Wed, 24 Nov 2010 00:54:34 +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/24/t1290556474l4hehj5lt81y5eu.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 1 3 2 2 1 1 1 4 4 1 1 2 4 4 2 2 4 4 3 2 1 1 3 2 2 2 4 2 2 2 1 3 3 3 1 1 1 4 3 1 1 1 2 2 2 3 3 3 2 2 5 3 3 1 3 3 3 3 1 1 1 4 3 1 1 2 3 1 1 1 2 2 2 2 2 5 5 3 2 1 2 2 2 1 5 2 3 1 2 1 2 3 3 1 1 2 3 2 2 1 3 3 3 1 2 3 4 4 2 2 3 3 3 2 1 1 1 2 1 1 1 3 2 2 2 4 2 2 1 1 1 4 3 1 1 3 4 3 1 3 2 4 1 2 1 1 1 2 2 1 2 3 3 2 1 1 1 1 1 1 2 4 1 2 1 1 2 2 1 1 1 3 1 1 1 1 3 2 2 1 1 2 2 1 1 3 4 3 2 5 3 1 1 1 1 1 2 3 2 2 3 3 3 1 1 1 3 3 2 1 2 5 3 1 1 3 3 3 1 2 2 4 4 2 1 1 3 3 1 1 1 4 3 1 1 1 2 1 1 1 1 3 2 2 1 1 2 2 1 1 3 3 3 2 2 2 2 1 2 1 2 3 3 1 1 2 4 2 1 3 4 1 1 1 1 3 1 1 2 2 3 1 1 1 2 3 4 4 2 1 1 2 3 2 1 3 2 1 1 1 1 3 4 1 1 1 5 5 2 1 1 3 3 1 1 1 3 2 2 2 3 3 1 2 2 3 3 3 1 1 1 3 3 1 1 1 4 3 1 1 2 4 1 1 1 2 4 3 2 1 1 3 2 1 3 4 4 2 2 1 3 1 1 1 1 2 3 3 1 1 1 3 1 1 1 1 3 2 2 2 3 5 2 2 1 2 4 2 1 1 1 3 3 1 3 3 5 4 1 4 3 4 4 1 1 1 4 1 1 1 2 4 2 1 1 1 4 3 2 2 2 3 2 1 1 2 3 3 1 2 2 4 3 1 1 1 3 3 2 2 2 1 2 1 1 1 4 2 1 1 1 4 3 2 1 3 3 1 2 1 2 3 3 2 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 time6 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
gender[t] = + 0.70174011232469 + 0.386108714128475diet[t] -0.020748127759265gewicht[t] -0.104801665118860`bier/wijn`[t] + 0.210110400648029andere[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.701740112324690.2997552.3410.0205030.010252
diet0.3861087141284750.0570886.763300
gewicht-0.0207481277592650.06057-0.34250.7324020.366201
`bier/wijn`-0.1048016651188600.065979-1.58840.1142330.057117
andere0.2101104006480290.103512.02990.0440820.022041


Multiple Linear Regression - Regression Statistics
Multiple R0.500475175165715
R-squared0.250475400957153
Adjusted R-squared0.231132830659273
F-TEST (value)12.9494372826246
F-TEST (DF numerator)4
F-TEST (DF denominator)155
p-value4.0344911855783e-09
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.761263121255809
Sum Squared Residuals89.8258386665411


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
111.23622191423371-0.236221914233707
211.48833564081058-0.488335640810575
311.46758751305131-0.467587513051311
421.602089571013230.397910428986773
521.172916504633380.827083495366623
621.601582500602920.398417499397081
721.341530649762880.658469350237123
811.27822524016255-0.278225240162547
911.27771816975224-0.277718169752238
1021.90363767737180.0963623226282013
1122.46574470498072-0.46574470498072
1231.693527276723771.30647272327623
1310.9005617207075530.0994382792924467
1411.51702189283301-0.517021892833015
1511.64307875612145-0.643078756121448
1622.63435885011022-0.63435885011022
1711.43296835547342-0.432968355473419
1851.727132293481043.27286770651896
1911.30741856259529-0.307418562595294
2011.62233062836218-0.622330628362183
2111.69352727672377-0.693527276723769
2221.778087884493670.221912115506327
2321.90363767737180.0963623226282013
2411.06760776910421-0.0676077691042088
2511.23622191423371-0.236221914233708
2622.20518578373037-0.205185783730370
2710.9005617207075530.0994382792924467
2811.67277914896450-0.672779148964504
2931.706384165721781.29361583427822
3011.27771816975224-0.277718169752238
3111.51752896324332-0.517528963243323
3211.17240943422307-0.172409434223069
3311.70638416572178-0.706384165721779
3411.04685964134494-0.0468596413449438
3511.13091317870454-0.130913178704539
3611.23622191423371-0.236221914233708
3711.04685964134494-0.0468596413449438
3811.88288954961253-0.882889549612534
3951.944626862480023.05537313751998
4011.15216837687411-0.152168376874113
4121.693527276723770.306472723276231
4211.13142024911485-0.131420249114848
4311.26592230707676-0.265922307076764
4411.69352727672377-0.693527276723769
4521.391979170365200.608020829634802
4610.9213098484668180.0786901515331817
4710.9005617207075530.0994382792924467
4811.15166130646380-0.151661306463804
4911.23622191423371-0.236221914233708
5011.04685964134494-0.0468596413449438
5111.9036376773718-0.903637677371799
5221.747880421240310.252119578759691
5311.30741856259529-0.307418562595294
5411.39147209995489-0.391472099954889
5532.330735576608500.669264423391504
5612.15473726312805-1.15473726312805
5721.944626862480020.0553731375199797
5821.778087884493670.221912115506327
5911.15216837687411-0.152168376874113
6011.92387873472076-0.923878734720755
6110.8165081833479580.183491816652042
6210.8803206633585970.119679336641403
6310.9213098484668180.0786901515331817
6411.23622191423371-0.236221914233708
6522.11324100760952-0.113241007609520
6621.693527276723770.306472723276231
6710.9213098484668180.0786901515331817
6810.9005617207075530.0994382792924467
6911.49627376507375-0.49627376507375
7011.49678083548406-0.496780835484058
7111.02611151358568-0.0261115135856788
7232.373799928859870.62620007114013
7311.94462686248002-0.94462686248002
7411.30741856259529-0.307418562595294
7511.13091317870454-0.130913178704539
7611.23622191423371-0.236221914233708
7721.966943086972130.0330569130278709
7811.39147209995489-0.391472099954889
7910.9213098484668180.0786901515331817
8031.547229356086381.45277064391362
8141.567977483845642.43202251615436
8211.11016505094527-0.110165050945274
8311.39147209995489-0.391472099954889
8411.11067212135558-0.110672121355583
8521.412220227714150.587779772285846
8611.30741856259529-0.307418562595294
8721.286670434836030.713329565163971
8811.13142024911485-0.131420249114848
8921.453716483232680.546283516767316
9011.00536338582641-0.00536338582641377
9111.11067212135558-0.110672121355583
9212.11324100760952-1.11324100760952
9311.51752896324332-0.517528963243323
9421.819077069601890.180922930398105
9511.77758081408336-0.777580814083365
9642.436044312137661.56395568786234
9710.9213098484668180.0786901515331817
9812.03813973533371-1.03813973533371
9911.00536338582641-0.00536338582641377
10041.320275451593302.67972454840670
10111.69352727672377-0.693527276723769
10211.88238247920223-0.882382479202225
10311.56797748384564-0.567977483845644
10442.373799928859871.62620007114013
10511.51752896324332-0.517528963243323
10610.9213098484668180.0786901515331817
10721.412220227714150.587779772285846
10810.7750119278294280.224988072170572
10921.286670434836030.713329565163971
11031.90363767737181.09636232262820
11142.716844290736971.28315570926303
11211.39197917036520-0.391979170365198
11310.9213098484668180.0786901515331817
11411.25697004199297-0.256970041992973
11511.18186876971717-0.181868769717168
11621.777580814083360.222419185916635
11710.8798135929482880.120186407051712
11811.77758081408336-0.777580814083365
11910.7957600555886930.204239944411307
12011.02611151358568-0.0261115135856788
12111.11016505094527-0.110165050945274
12210.9005617207075530.0994382792924467
12311.67277914896450-0.672779148964504
12441.861634351442962.13836564855704
12511.13142024911485-0.131420249114848
12611.56797748384564-0.567977483845644
12721.391979170365200.608020829634802
12831.90363767737181.09636232262820
12911.51752896324332-0.517528963243323
13011.49678083548406-0.496780835484058
13132.655106977869480.344893022130515
13222.05888786309298-0.0588878630929797
13310.8798135929482880.120186407051712
13411.11016505094527-0.110165050945274
13511.98769121473139-0.987691214731394
13611.83982519736116-0.83982519736116
13711.18186876971717-0.181868769717168
13811.00536338582641-0.00536338582641377
13911.00587045623672-0.00587045623672217
14012.05888786309298-1.05888786309298
14111.77758081408336-0.777580814083365
14231.882889549612531.11711045038747
14312.11324100760952-1.11324100760952
14421.693527276723770.306472723276231
14511.56797748384564-0.567977483845644
14611.39147209995489-0.391472099954889
14711.29952732383404-0.299527323834039
14821.768628548999570.231371451000426
14911.32027545159330-0.320275451593304
15011.30741856259529-0.307418562595294
15110.7957600555886930.204239944411307
15212.2684911933307-1.2684911933307
15310.9005617207075530.0994382792924467
15410.9213098484668180.0786901515331817
15511.11067212135558-0.110672121355583
15611.9036376773718-0.903637677371799
15731.181868769717171.81813123028283
15811.00536338582641-0.00536338582641377
15911.00536338582641-0.00536338582641377
16011.56797748384564-0.567977483845644


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.3728504723277640.7457009446555270.627149527672236
90.2303894979570800.4607789959141590.76961050204292
100.1267775411036820.2535550822073640.873222458896318
110.07497694290100320.1499538858020060.925023057098997
120.06605459477309240.1321091895461850.933945405226908
130.2409500423582020.4819000847164050.759049957641798
140.2104911092946060.4209822185892130.789508890705394
150.1613153106457820.3226306212915650.838684689354218
160.1252213778310620.2504427556621250.874778622168938
170.1007812831275130.2015625662550260.899218716872487
180.971908628028970.05618274394206040.0280913719710302
190.9590610911032840.0818778177934330.0409389088967165
200.9622808100970080.07543837980598470.0377191899029923
210.9521448314400030.09571033711999390.0478551685599969
220.9373840722649180.1252318554701640.0626159277350821
230.9141533316869280.1716933366261440.0858466683130722
240.8844609020931250.2310781958137510.115539097906875
250.867385276907540.2652294461849180.132614723092459
260.8296769775981880.3406460448036240.170323022401812
270.7856804168546810.4286391662906380.214319583145319
280.7655051588820.4689896822360010.234494841118000
290.7634280891194560.4731438217610880.236571910880544
300.7225996965072830.5548006069854340.277400303492717
310.6921304465282550.615739106943490.307869553471745
320.6447134357353890.7105731285292230.355286564264611
330.7230826708494320.5538346583011370.276917329150568
340.6720821448283310.6558357103433380.327917855171669
350.6297031981262380.7405936037475240.370296801873762
360.5879396408972330.8241207182055350.412060359102767
370.5319260225833080.9361479548333850.468073977416692
380.545881626423780.908236747152440.45411837357622
390.9625100157414640.0749799685170720.037489984258536
400.9504553618565410.0990892762869180.049544638143459
410.9399423467563260.1201153064873490.0600576532436744
420.923024990968730.1539500180625390.0769750090312697
430.903583690749180.1928326185016400.0964163092508202
440.8939068578339830.2121862843320330.106093142166017
450.9018787135119650.1962425729760690.0981212864880347
460.8809896670608210.2380206658783580.119010332939179
470.8575800594060340.2848398811879330.142419940593966
480.834921869359920.3301562612801590.165078130640079
490.8072179924280340.3855640151439320.192782007571966
500.7713294389770940.4573411220458120.228670561022906
510.7848032076079450.4303935847841090.215196792392055
520.75067697767440.4986460446512010.249323022325600
530.7131854753398790.5736290493202420.286814524660121
540.6812133535455540.6375732929088930.318786646454446
550.6575525566688530.6848948866622940.342447443331147
560.7498192756700880.5003614486598230.250180724329912
570.7120313350959690.5759373298080620.287968664904031
580.6801354629237820.6397290741524350.319864537076218
590.6374165404068550.725166919186290.362583459593145
600.6657058293016730.6685883413966530.334294170698327
610.6296792066437150.740641586712570.370320793356285
620.5907648763634190.8184702472731620.409235123636581
630.5449295056356750.910140988728650.455070494364325
640.5039124356593410.9921751286813190.496087564340659
650.4590921651391510.9181843302783030.540907834860849
660.4223601308803530.8447202617607050.577639869119647
670.3774662330701490.7549324661402980.622533766929851
680.3343956570088370.6687913140176730.665604342991163
690.3118439582230430.6236879164460870.688156041776957
700.2885560234405750.577112046881150.711443976559425
710.2499537752599340.4999075505198670.750046224740066
720.2371124548025850.474224909605170.762887545197415
730.2561225950625610.5122451901251210.74387740493744
740.2248985311662150.4497970623324290.775101468833785
750.1928811595096180.3857623190192370.807118840490382
760.1661932841268710.3323865682537410.83380671587313
770.1387891134525250.277578226905050.861210886547475
780.1200788923782770.2401577847565550.879921107621723
790.09884024296627510.1976804859325500.901159757033725
800.1668328698885870.3336657397771730.833167130111413
810.5282720029207760.9434559941584490.471727997079224
820.4831150278261950.966230055652390.516884972173805
830.4492008182979140.8984016365958280.550799181702086
840.405669608448190.811339216896380.59433039155181
850.3851230970908020.7702461941816030.614876902909198
860.3494689930671820.6989379861343650.650531006932818
870.3434705772226250.686941154445250.656529422777375
880.3054390273625280.6108780547250560.694560972637472
890.2818972681108330.5637945362216660.718102731889167
900.2439020513545660.4878041027091320.756097948645434
910.2107740105843600.4215480211687190.78922598941564
920.2571269866816730.5142539733633460.742873013318327
930.2440679660903900.4881359321807810.75593203390961
940.2103708220095350.4207416440190710.789629177990465
950.2083482373093560.4166964746187130.791651762690644
960.3120443088327480.6240886176654960.687955691167252
970.2719404247882630.5438808495765250.728059575211737
980.3003760992324910.6007521984649810.69962390076751
990.2604141063199350.5208282126398690.739585893680065
1000.7368223288482880.5263553423034240.263177671151712
1010.7273353240432660.5453293519134670.272664675956734
1020.7374788847241560.5250422305516870.262521115275844
1030.7206622381725760.5586755236548480.279337761827424
1040.8516675984668350.296664803066330.148332401533165
1050.8343517771814220.3312964456371570.165648222818578
1060.8015138004815170.3969723990369650.198486199518483
1070.7888134303187960.4223731393624070.211186569681204
1080.7531315745770660.4937368508458680.246868425422934
1090.7495975414913480.5008049170173040.250402458508652
1100.8000106360252060.3999787279495890.199989363974795
1110.9112657451221220.1774685097557560.0887342548778778
1120.8977578118116660.2044843763766690.102242188188334
1130.8731579016588070.2536841966823850.126842098341193
1140.8443220209263870.3113559581472250.155677979073613
1150.813391217854840.3732175642903210.186608782145161
1160.7878851364659840.4242297270680320.212114863534016
1170.7471864926057580.5056270147884850.252813507394242
1180.733428426912940.5331431461741210.266571573087060
1190.6877075282327020.6245849435345960.312292471767298
1200.6385890229977260.7228219540045490.361410977002274
1210.5855383881461570.8289232237076850.414461611853843
1220.5305441845375980.9389116309248040.469455815462402
1230.5079216550196150.984156689960770.492078344980385
1240.9418691187382340.1162617625235320.0581308812617658
1250.9273306767510710.1453386464978580.072669323248929
1260.9195036254974420.1609927490051170.0804963745025584
1270.9005629975998890.1988740048002220.099437002400111
1280.9476354069249990.1047291861500030.0523645930750014
1290.938858685525240.1222826289495210.0611413144747605
1300.9299500384407040.1400999231185930.0700499615592965
1310.94990138057770.1001972388445980.0500986194222991
1320.9458709177584320.1082581644831360.0541290822415681
1330.9238999502280050.1522000995439910.0761000497719954
1340.8978903396632060.2042193206735880.102109660336794
1350.882541250271420.2349174994571590.117458749728580
1360.8645656596465320.2708686807069350.135434340353468
1370.8289028266998280.3421943466003450.171097173300172
1380.776554295935830.4468914081283390.223445704064170
1390.7554680231242350.489063953751530.244531976875765
1400.7238347088741790.5523305822516420.276165291125821
1410.662117467656620.675765064686760.33788253234338
1420.8796318950889030.2407362098221940.120368104911097
1430.843054788816850.3138904223662990.156945211183150
1440.8259933404297010.3480133191405980.174006659570299
1450.770202021117790.4595959577644190.229797978882209
1460.6877304934679280.6245390130641430.312269506532072
1470.6015244829443910.7969510341112180.398475517055609
1480.6642297776147810.6715404447704380.335770222385219
1490.5752388591399750.849522281720050.424761140860025
1500.4462842977491420.8925685954982830.553715702250858
1510.3909636094825030.7819272189650070.609036390517497
1520.2881736134390500.5763472268780990.71182638656095


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 level60.0413793103448276OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/10al0t1290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/10al0t1290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/14k3z1290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/14k3z1290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/24k3z1290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/24k3z1290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/3ec221290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/3ec221290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/4ec221290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/4ec221290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/5ec221290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/5ec221290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/67l151290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/67l151290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/7iu181290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/7iu181290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/8iu181290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/8iu181290556376.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/9iu181290556376.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290556474l4hehj5lt81y5eu/9iu181290556376.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