Home » date » 2010 » Dec » 01 »

Workshop 4 - Mini tutorial (1)

*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: Wed, 01 Dec 2010 17:46:18 +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/01/t1291229375yk23pnu6cutl9lp.htm/, Retrieved Wed, 01 Dec 2010 19:49:35 +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/01/t1291229375yk23pnu6cutl9lp.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 «
2 2 4 2 2 2 4 1 4 2 5 4 2 2 2 2 3 2 2 2 4 1 4 2 3 1 4 2 3 3 4 2 3 2 4 1 2 1 2 4 4 4 3 2 4 2 4 3 3 3 3 2 3 2 4 2 4 1 4 1 4 1 4 3 3 2 4 1 3 2 2 2 3 2 4 4 4 2 4 4 2 1 4 3 5 2 3 2 4 4 2 3 2 2 4 2 3 2 2 2 4 2 3 3 4 2 4 3 3 2 3 2 4 3 4 4 4 2 4 2 1 1 4 2 4 4 4 3 5 1 4 5 2 2 4 2 4 2 4 3 3 2 5 1 2 2 4 2 4 2 2 2 5 2 4 4 4 2 4 2 4 2 5 4 4 2 4 3 3 2 2 2 4 2 4 4 2 2 4 2 2 1 4 2 4 2 2 2 2 1 5 2 4 2 4 2 4 1 4 3 1 1 4 1 4 2 4 2 2 2 4 2 1 1 3 1 4 5 5 5 3 2 4 2 2 2 4 2 4 1 4 2 3 1 4 1 2 2 2 2 2 2 4 2 3 1 4 2 2 1 4 4 1 2 4 2 3 1 3 1 2 1 4 2 3 2 2 2 3 1 4 2 3 1 4 1 2 2 4 2 3 1 4 2 2 1 4 2 4 3 4 3 4 3 3 3 4 2 4 2 2 2 4 2 3 1 4 3 4 3 4 2 3 2 4 2 4 2 4 2 2 2 4 2 3 2 2 2 3 1 3 1 4 4 5 3 2 1 3 2 4 1 3 4 2 1 4 2 2 1 4 1 4 4 4 4 3 2 4 3 4 2 4 2 2 1 3 3 2 1 4 2 3 1 4 3 3 3 4 2 5 4 5 5 2 4 4 3 3 3 4 4 4 2 2 2 3 2 3 2 4 3 3 2 3 1 3 3 3 3 4 4 2 2 4 3 3 2 2 2 2 2 3 2 3 2 3 3 2 4 4 2 4 3 4 2 2 1 2 2 4 1 3 2 4 2 4 3 1 1 4 2 5 3 5 4 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
Q1[t] = + 2.23897194643045 + 0.243785460782962Q2[t] -0.122438966674107Q3[t] + 0.347603426744458Q4[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2.238971946430450.3359836.66400
Q20.2437854607829620.0794593.06810.0025430.001272
Q3-0.1224389666741070.086368-1.41760.1583010.07915
Q40.3476034267444580.0797074.3612.4e-051.2e-05


Multiple Linear Regression - Regression Statistics
Multiple R0.479336441707
R-squared0.229763424348329
Adjusted R-squared0.214855619658296
F-TEST (value)15.4122910197471
F-TEST (DF numerator)3
F-TEST (DF denominator)155
p-value7.9837040312114e-09
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.856089324065147
Sum Squared Residuals113.597784270640


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
122.93199385478886-0.93199385478886
222.5843904280444-0.5843904280444
343.504761741603660.495238258396335
423.17687178813707-1.17687178813707
533.17687178813707-0.176871788137071
642.688208394005891.31179160599410
732.688208394005900.311791605994105
833.17577931557182-0.175779315571818
932.58439042804440.415609571955601
1023.62829318084302-1.62829318084302
1143.542003743028890.457996256971113
1243.279597281533310.720402718466686
1333.29821828224593-0.298218282245925
1432.931993854788860.0680061452111432
1542.340604967261441.65939503273856
1643.035811820750350.964188179249647
1732.58439042804440.415609571955601
1833.17687178813707-0.176871788137071
1933.62720070827777-0.627200708277772
2043.627200708277770.372799291722228
2123.03581182075035-1.03581182075035
2253.054432821462961.94556717853704
2344.01204613644745-0.0120461364474518
2422.93199385478886-0.931993854788857
2533.17687178813707-0.176871788137071
2643.402036248207420.597963751792578
2743.279597281533310.720402718466686
2833.05443282146296-0.054432821462964
2943.870986169060730.129013830939266
3042.931993854788861.06800614521114
3112.68820839400589-1.68820839400590
3243.767168203099240.232831796900762
3353.731018674239271.26898132576073
3422.93199385478886-0.931993854788857
3543.279597281533310.720402718466686
3632.461951461370290.538048538629708
3722.93199385478886-0.931993854788857
3843.176871788137070.823128211862929
3953.627200708277771.37279929172223
4042.931993854788861.06800614521114
4143.504761741603660.495238258396335
4243.279597281533310.720402718466686
4333.17687178813707-0.176871788137071
4443.627200708277770.372799291722228
4522.93199385478886-0.931993854788857
4622.68820839400590-0.688208394005895
4743.176871788137070.823128211862929
4822.56576942733179-0.565769427331788
4942.931993854788861.06800614521114
5043.035811820750350.964188179249647
5112.34060496726144-1.34060496726144
5242.931993854788861.06800614521114
5322.93199385478886-0.931993854788857
5412.46304393393554-1.46304393393554
5544.58372155069701-0.583721550697007
5632.931993854788860.0680061452111432
5722.93199385478886-0.931993854788857
5842.688208394005891.31179160599410
5932.340604967261440.659395032738562
6023.17687178813707-1.17687178813707
6122.93199385478886-0.931993854788857
6232.688208394005900.311791605994105
6323.38341524749481-1.38341524749481
6412.93199385478886-1.93199385478886
6532.463043933935540.536956066064455
6622.68820839400590-0.688208394005895
6733.17687178813707-0.176871788137071
6832.688208394005900.311791605994105
6932.340604967261440.659395032738562
7022.93199385478886-0.931993854788857
7132.688208394005900.311791605994105
7222.68820839400590-0.688208394005895
7343.523382742316280.476617257683724
7443.645821708990380.354178291009617
7542.931993854788861.06800614521114
7622.93199385478886-0.931993854788857
7733.03581182075035-0.035811820750353
7843.175779315571820.824220684428182
7932.931993854788860.0680061452111432
8042.931993854788861.06800614521114
8122.93199385478886-0.931993854788857
8233.17687178813707-0.176871788137071
8332.463043933935540.536956066064455
8443.644729236425130.355270763574870
8522.81064736068-0.810647360680002
8643.505854214168920.494145785831082
8722.68820839400590-0.688208394005895
8822.34060496726144-0.340604967261437
8944.11477162984369-0.114771629843695
9033.27959728153331-0.279597281533314
9142.931993854788861.06800614521114
9223.15825078742446-1.15825078742446
9322.68820839400590-0.688208394005895
9433.03581182075035-0.035811820750353
9533.17577931557182-0.175779315571818
9654.339936089914050.660063910085955
9723.76716820309924-1.76716820309924
9833.87098616906073-0.870986169060734
9943.176871788137070.823128211862929
10033.05443282146296-0.054432821462964
10143.298218282245930.701781717754074
10233.15825078742446-0.15825078742446
10333.87098616906073-0.870986169060734
10423.27959728153331-1.27959728153331
10533.17687178813707-0.176871788137071
10623.05443282146296-1.05443282146296
10733.40203624820742-0.402036248207422
10823.41956477635478-1.41956477635478
10943.175779315571820.824220684428182
11022.93308632735411-0.93308632735411
11142.810647360681.18935263932000
11243.279597281533310.720402718466686
11312.68820839400589-1.68820839400590
11453.748547202386631.25145279761337
11522.70682939471851-0.706829394718506
11633.05443282146296-0.054432821462964
11743.627200708277770.372799291722228
11812.81064736068-1.81064736068000
11953.298218282245931.70178171775407
12032.585482900609650.414517099390348
12132.340604967261440.659395032738562
12233.40203624820742-0.402036248207422
12333.52338274231628-0.523382742316276
12422.46195146137029-0.461951461370292
12522.34060496726144-0.340604967261437
12643.402036248207420.597963751792578
12742.463043933935541.53695606606446
12833.05443282146296-0.054432821462964
12933.15825078742446-0.15825078742446
13032.931993854788860.0680061452111432
13143.175779315571820.824220684428182
13233.05443282146296-0.054432821462964
13342.933086327354111.06691367264589
13442.810647360681.18935263932000
13523.17687178813707-1.17687178813707
13643.627200708277770.372799291722228
13722.68820839400590-0.688208394005895
13842.931993854788861.06800614521114
13933.52338274231628-0.523382742316276
14033.41956477635478-0.41956477635478
14122.93199385478886-0.931993854788857
14223.99233266316959-1.99233266316959
14354.480996057300760.519003942699236
14422.34060496726144-0.340604967261437
14543.523382742316280.476617257683724
14632.931993854788860.0680061452111432
14733.50476174160366-0.504761741603665
14833.05443282146296-0.054432821462964
14932.585482900609650.414517099390348
15043.419564776354780.58043522364522
15143.054432821462960.945567178537036
15243.279597281533310.720402718466686
15344.09615062913108-0.096150629131084
15442.810647360681.18935263932000
15554.23721059651780.762789403482198
15633.05443282146296-0.054432821462964
15732.809554888114750.190445111885250
15843.767168203099240.232831796900762
15944.35964956319191-0.359649563191909


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.3747782906900610.7495565813801230.625221709309938
80.4450238719971490.8900477439942990.554976128002851
90.3826978819689560.7653957639379110.617302118031044
100.4582372478319480.9164744956638970.541762752168052
110.5293852497232250.941229500553550.470614750276775
120.4850341549151910.9700683098303830.514965845084809
130.3825232770012510.7650465540025020.617476722998749
140.2916756729946940.5833513459893870.708324327005306
150.4173729977545670.8347459955091340.582627002245433
160.3976490372304170.7952980744608340.602350962769583
170.3192656007741920.6385312015483850.680734399225808
180.2734156960249390.5468313920498770.726584303975061
190.2369130722292730.4738261444585450.763086927770727
200.1988802032919970.3977604065839950.801119796708003
210.2794190625874150.558838125174830.720580937412585
220.6187713624783650.762457275043270.381228637521635
230.5824053587685090.8351892824629830.417594641231491
240.6424898018105880.7150203963788230.357510198189412
250.5801436731572770.8397126536854460.419856326842723
260.565086395649390.869827208701220.43491360435061
270.533369536575180.9332609268496390.466630463424820
280.4696970430231220.9393940860462440.530302956976878
290.4083309274747810.8166618549495630.591669072525219
300.4026976359376680.8053952718753370.597302364062332
310.6300596478138110.7398807043723780.369940352186189
320.5744860506141730.8510278987716550.425513949385827
330.646297076096010.707405847807980.35370292390399
340.6778923324751990.6442153350496020.322107667524801
350.648489292312820.703021415374360.35151070768718
360.6022700405623420.7954599188753160.397729959437658
370.6305550246865050.7388899506269910.369444975313495
380.648731187615080.702537624769840.35126881238492
390.6948747742223830.6102504515552350.305125225777617
400.7015795355131530.5968409289736940.298420464486847
410.6617897992411090.6764204015177820.338210200758891
420.634196295805670.731607408388660.36580370419433
430.5848763465327350.8302473069345290.415123653467265
440.5386197332403570.9227605335192860.461380266759643
450.568306807518650.86338638496270.43169319248135
460.5574853875123560.8850292249752880.442514612487644
470.5658625408311140.8682749183377730.434137459168886
480.548943408586680.902113182826640.45105659141332
490.5639134006992320.8721731986015350.436086599300768
500.5694687783942270.8610624432115460.430531221605773
510.6335321232454730.7329357535090540.366467876754527
520.649046842755340.7019063144893210.350953157244661
530.6656991715370220.6686016569259570.334300828462978
540.7225322058817260.5549355882365480.277467794118274
550.7478351373847850.504329725230430.252164862615215
560.7078625792923570.5842748414152870.292137420707643
570.7167869197840250.566426160431950.283213080215975
580.7659549777253350.4680900445493290.234045022274665
590.7505534169302390.4988931661395220.249446583069761
600.7786330009287340.4427339981425330.221366999071266
610.7862730223389750.427453955322050.213726977661025
620.755574265118130.4888514697637390.244425734881869
630.8140214928922140.3719570142155720.185978507107786
640.9128312192205780.1743375615588440.0871687807794218
650.9020821864170570.1958356271658860.097917813582943
660.8936618730478220.2126762539043570.106338126952178
670.8723114553707150.2553770892585710.127688544629285
680.8504500296711530.2990999406576940.149549970328847
690.8397202059084890.3205595881830220.160279794091511
700.8439415218660120.3121169562679760.156058478133988
710.8192964465186410.3614071069627180.180703553481359
720.806516067143660.386967865712680.19348393285634
730.783002459319020.4339950813619600.216997540680980
740.7530310693502870.4939378612994260.246968930649713
750.7721583709558650.455683258088270.227841629044135
760.7774637832665860.4450724334668280.222536216733414
770.7420835665784560.5158328668430870.257916433421544
780.7365939334662750.5268121330674490.263406066533725
790.6979242179846310.6041515640307380.302075782015369
800.7204548215125020.5590903569749960.279545178487498
810.725908252620610.548183494758780.27409174737939
820.6894230951685750.621153809662850.310576904831425
830.6659680464553040.6680639070893920.334031953544696
840.6320161516657580.7359676966684850.367983848334242
850.6248450635786910.7503098728426180.375154936421309
860.5969605608726020.8060788782547960.403039439127398
870.5768469036340230.8463061927319540.423153096365977
880.5367113227220320.9265773545559360.463288677277968
890.493199885585390.986399771170780.506800114414609
900.4513617084006190.9027234168012380.548638291599381
910.4783152048936070.9566304097872150.521684795106393
920.513174115036450.9736517699271010.486825884963551
930.4933090900924350.986618180184870.506690909907565
940.4465349424933330.8930698849866660.553465057506667
950.4026337054462270.8052674108924540.597366294553773
960.3957380373284780.7914760746569570.604261962671522
970.5439809134673170.9120381730653670.456019086532683
980.5404711904764330.9190576190471350.459528809523567
990.5311528703927160.9376942592145680.468847129607284
1000.4840742161780350.968148432356070.515925783821965
1010.4642736197371350.928547239474270.535726380262865
1020.4183853402121270.8367706804242530.581614659787873
1030.4159000859010550.831800171802110.584099914098945
1040.4711932879414120.9423865758828240.528806712058588
1050.4285021845440980.8570043690881970.571497815455902
1060.4594193313518060.9188386627036120.540580668648194
1070.4262213408917630.8524426817835250.573778659108237
1080.516547337245620.966905325508760.48345266275438
1090.5069591454456850.986081709108630.493040854554315
1100.5430073763912550.9139852472174910.456992623608745
1110.5742690736591070.8514618526817860.425730926340893
1120.5595755113022450.880848977395510.440424488697755
1130.7026878961066230.5946242077867550.297312103893378
1140.774312895556690.4513742088866210.225687104443310
1150.7841295346493450.4317409307013090.215870465350655
1160.747628234703470.5047435305930590.252371765296530
1170.7198443242450860.5603113515098280.280155675754914
1180.8979609069555420.2040781860889160.102039093044458
1190.948296491258160.1034070174836800.0517035087418399
1200.9346759998432930.1306480003134140.0653240001567069
1210.923530627758510.1529387444829790.0764693722414893
1220.914220013265330.1715599734693390.0857799867346696
1230.898670817352360.2026583652952790.101329182647640
1240.8764687803684650.2470624392630690.123531219631535
1250.8590957193181410.2818085613637180.140904280681859
1260.8327575300259080.3344849399481840.167242469974092
1270.8757792402886120.2484415194227760.124220759711388
1280.8456269169947320.3087461660105360.154373083005268
1290.8168304690115070.3663390619769850.183169530988493
1300.7713210925960350.457357814807930.228678907403965
1310.7753157740791420.4493684518417150.224684225920858
1320.7300549604168820.5398900791662370.269945039583118
1330.7050021229882440.5899957540235110.294997877011756
1340.7248965816248810.5502068367502370.275103418375119
1350.8691067620912540.2617864758174910.130893237908746
1360.836914198861010.3261716022779810.163085801138991
1370.8368994628532130.3262010742935740.163100537146787
1380.8671816412510440.2656367174979130.132818358748956
1390.8371701222765160.3256597554469680.162829877723484
1400.7931316775260340.4137366449479330.206868322473966
1410.8310122430179610.3379755139640770.168987756982039
1420.9860358122486610.02792837550267740.0139641877513387
1430.975771401089150.04845719782170050.0242285989108502
1440.9788930228216350.04221395435672970.0211069771783648
1450.964063271209470.07187345758105830.0359367287905291
1460.943159654556350.1136806908873010.0568403454436506
1470.9414618025190.1170763949619990.0585381974809996
1480.927942491855950.1441150162880990.0720575081440496
1490.8929447933034780.2141104133930430.107055206696522
1500.8285397924275580.3429204151448840.171460207572442
1510.7424714318301970.5150571363396060.257528568169803
1520.6050762379902540.7898475240194920.394923762009746


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level30.0205479452054795OK
10% type I error level40.0273972602739726OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/105ty81291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/105ty81291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/1ya1w1291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/1ya1w1291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/2ya1w1291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/2ya1w1291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/391ii1291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/391ii1291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/491ii1291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/491ii1291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/591ii1291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/591ii1291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/6ks031291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/6ks031291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/7d1z51291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/7d1z51291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/8d1z51291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/8d1z51291225568.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/9d1z51291225568.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291229375yk23pnu6cutl9lp/9d1z51291225568.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