Home » date » 2010 » Dec » 02 »

Workshop 7 – Multiple Linear Regression

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Thu, 02 Dec 2010 09:57:21 +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/02/t1291283823kfs6k5mbr5h4oob.htm/, Retrieved Thu, 02 Dec 2010 10:57:14 +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/02/t1291283823kfs6k5mbr5h4oob.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:
Meber of Sports clu (provison & illness)
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 1 1 4 1 1 7 1 1 7 1 2 5 1 2 5 1 1 4 1 2 4 2 1 6 1 2 5 1 1 1 1 2 5 1 1 4 2 2 6 1 2 7 1 2 7 1 1 2 1 1 6 1 1 3 1 2 6 1 2 6 1 1 5 1 2 6 1 2 4 2 2 3 2 2 4 1 2 5 2 2 6 2 1 6 2 1 4 1 2 6 1 1 6 1 2 5 1 2 6 1 2 4 1 1 6 1 2 7 1 1 5 1 1 6 1 2 6 2 1 5 2 2 7 1 2 6 1 1 3 1 1 4 1 2 5 1 2 4 2 1 3 1 2 5 1 2 5 1 1 4 1 1 5 1 2 1 1 2 2 2 2 3 1 1 4 1 1 3 1 1 7 1 1 2 1 1 4 1 1 2 1 2 5 1 2 6 1 2 6 1 2 6 1 1 6 1 2 6 1 2 6 1 1 6 1 1 4 1 1 4 1 2 5 1 1 6 1 1 6 1 1 7 1 1 6 1 2 6 2 1 6 1 2 3 1 2 5 1 2 6 1 2 4 1 1 5 1 2 6 1 2 6 1 1 3 1 2 6 1 2 5 1 1 6 1 1 4 1 2 7 1 2 5 1 2 6 1 1 6 1 2 6 1 1 7 2 2 6 1 1 6 1 1 6 1 2 6 1 2 2 1 1 4 1 2 4 1 2 6 1 1 5 1 1 6 1 1 6 1 1 2 2 2 7 1 1 1 1 1 4 1 1 1 1 1 6 1 2 6 1 1 6 1 2 7 1 1 6 1 2 4 1 2 4 1 1 6 1 1 5 2 2 7 1 2 4 1 1 4 1 2 6 1 2 7 1 2 5 1 2 6 1 1 6 2 2 6 1 2 5 1 2 7 1 2 4 1 1 6 1 1 6 1 2 7 1 2 6 1 2 6 1 2 5 1 1 5 1 2 5 1 2 6 1 2 6 2 1 7 2 1 4 1 2 6 1 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 time10 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Member[t] = + 1.08303758464254 + 0.0762639060674089Provision[t] + 0.069728040161896Illness[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.083037584642540.2018335.36600
Provision0.07626390606740890.0273232.79120.0059170.002958
Illness0.0697280401618960.1172960.59450.5530770.276538


Multiple Linear Regression - Regression Statistics
Multiple R0.222116181409657
R-squared0.0493355980440077
Adjusted R-squared0.0369893071095143
F-TEST (value)3.99598537777629
F-TEST (DF numerator)2
F-TEST (DF denominator)154
p-value0.0203281030586162
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.489341530112215
Sum Squared Residuals36.8760904962548


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
121.534085155141440.465914844858558
211.45782124907406-0.457821249074063
311.68661296727630-0.686612967276297
411.68661296727629-0.686612967276294
521.534085155141480.465914844858524
621.534085155141480.465914844858524
711.45782124907407-0.457821249074067
821.527549289235960.472450710764038
911.61034906120889-0.610349061208885
1021.534085155141480.465914844858524
1111.22902953087184-0.229029530871840
1221.534085155141480.465914844858524
1311.52754928923596-0.527549289235962
1421.610349061208880.389650938791115
1521.686612967276290.313387032723706
1621.686612967276290.313387032723706
1711.30529343693925-0.305293436939249
1811.61034906120889-0.610349061208885
1911.38155734300666-0.381557343006658
2021.610349061208880.389650938791115
2121.610349061208880.389650938791115
2211.53408515514148-0.534085155141476
2321.610349061208880.389650938791115
2421.527549289235960.472450710764038
2521.451285383168550.548714616831447
2621.457821249074070.542178750925933
2721.603813195303370.396186804696629
2821.680077101370780.31992289862922
2911.68007710137078-0.68007710137078
3011.45782124907407-0.457821249074067
3121.610349061208880.389650938791115
3211.61034906120889-0.610349061208885
3321.534085155141480.465914844858524
3421.610349061208880.389650938791115
3521.457821249074070.542178750925933
3611.61034906120889-0.610349061208885
3721.686612967276290.313387032723706
3811.53408515514148-0.534085155141476
3911.61034906120889-0.610349061208885
4021.680077101370780.31992289862922
4111.60381319530337-0.603813195303371
4221.686612967276290.313387032723706
4321.610349061208880.389650938791115
4411.38155734300666-0.381557343006658
4511.45782124907407-0.457821249074067
4621.534085155141480.465914844858524
4721.527549289235960.472450710764038
4811.38155734300666-0.381557343006658
4921.534085155141480.465914844858524
5021.534085155141480.465914844858524
5111.45782124907407-0.457821249074067
5211.53408515514148-0.534085155141476
5321.229029530871840.77097046912816
5421.375021477101140.624978522898856
5521.381557343006660.618442656993342
5611.45782124907407-0.457821249074067
5711.38155734300666-0.381557343006658
5811.68661296727629-0.686612967276294
5911.30529343693925-0.305293436939249
6011.45782124907407-0.457821249074067
6111.30529343693925-0.305293436939249
6221.534085155141480.465914844858524
6321.610349061208880.389650938791115
6421.610349061208880.389650938791115
6521.610349061208880.389650938791115
6611.61034906120889-0.610349061208885
6721.610349061208880.389650938791115
6821.610349061208880.389650938791115
6911.61034906120889-0.610349061208885
7011.45782124907407-0.457821249074067
7111.45782124907407-0.457821249074067
7221.534085155141480.465914844858524
7311.61034906120889-0.610349061208885
7411.61034906120889-0.610349061208885
7511.68661296727629-0.686612967276294
7611.61034906120889-0.610349061208885
7721.680077101370780.31992289862922
7811.61034906120889-0.610349061208885
7921.381557343006660.618442656993342
8021.534085155141480.465914844858524
8121.610349061208880.389650938791115
8221.457821249074070.542178750925933
8311.53408515514148-0.534085155141476
8421.610349061208880.389650938791115
8521.610349061208880.389650938791115
8611.38155734300666-0.381557343006658
8721.610349061208880.389650938791115
8821.534085155141480.465914844858524
8911.61034906120889-0.610349061208885
9011.45782124907407-0.457821249074067
9121.686612967276290.313387032723706
9221.534085155141480.465914844858524
9321.610349061208880.389650938791115
9411.61034906120889-0.610349061208885
9521.610349061208880.389650938791115
9611.75634100743819-0.75634100743819
9721.610349061208880.389650938791115
9811.61034906120889-0.610349061208885
9911.61034906120889-0.610349061208885
10021.610349061208880.389650938791115
10121.305293436939250.694706563060751
10211.45782124907407-0.457821249074067
10321.457821249074070.542178750925933
10421.610349061208880.389650938791115
10511.53408515514148-0.534085155141476
10611.61034906120889-0.610349061208885
10711.61034906120889-0.610349061208885
10811.37502147710114-0.375021477101144
10921.686612967276290.313387032723706
11011.22902953087184-0.229029530871840
11111.45782124907407-0.457821249074067
11211.22902953087184-0.229029530871840
11311.61034906120889-0.610349061208885
11421.610349061208880.389650938791115
11511.61034906120889-0.610349061208885
11621.686612967276290.313387032723706
11711.61034906120889-0.610349061208885
11821.457821249074070.542178750925933
11921.457821249074070.542178750925933
12011.61034906120889-0.610349061208885
12111.60381319530337-0.603813195303371
12221.686612967276290.313387032723706
12321.457821249074070.542178750925933
12411.45782124907407-0.457821249074067
12521.610349061208880.389650938791115
12621.686612967276290.313387032723706
12721.534085155141480.465914844858524
12821.610349061208880.389650938791115
12911.68007710137078-0.68007710137078
13021.610349061208880.389650938791115
13121.534085155141480.465914844858524
13221.686612967276290.313387032723706
13321.457821249074070.542178750925933
13411.61034906120889-0.610349061208885
13511.61034906120889-0.610349061208885
13621.686612967276290.313387032723706
13721.610349061208880.389650938791115
13821.610349061208880.389650938791115
13921.534085155141480.465914844858524
14011.53408515514148-0.534085155141476
14121.534085155141480.465914844858524
14221.610349061208880.389650938791115
14321.680077101370780.31992289862922
14411.75634100743819-0.75634100743819
14511.45782124907407-0.457821249074067
14621.610349061208880.389650938791115
14721.610349061208880.389650938791115
14821.686612967276290.313387032723706
14911.61034906120889-0.610349061208885
15021.686612967276290.313387032723706
15121.527549289235960.472450710764038
15221.610349061208880.389650938791115
15311.45782124907407-0.457821249074067
15411.45782124907407-0.457821249074067
15521.686612967276290.313387032723706
15611.45782124907407-0.457821249074067
15721.756341007438190.243658992561811


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
60.8280743922547460.3438512154905090.171925607745255
70.8526559997238540.2946880005522930.147344000276146
80.7651587392340830.4696825215318340.234841260765917
90.7076411311364730.5847177377270550.292358868863527
100.7135329697309920.5729340605380160.286467030269008
110.7309338040713260.5381323918573490.269066195928674
120.7424694451586220.5150611096827570.257530554841378
130.7928323240356140.4143353519287720.207167675964386
140.7818814304971890.4362371390056220.218118569502811
150.7502128631198460.4995742737603070.249787136880154
160.707357643447560.585284713104880.29264235655244
170.6556147565317640.6887704869364720.344385243468236
180.68233619777790.6353276044441990.317663802222099
190.6375993371834280.7248013256331450.362400662816572
200.6133435126244390.7733129747511220.386656487375561
210.5841224568168260.8317550863663480.415877543183174
220.5851586598644970.8296826802710060.414841340135503
230.5571601941067940.8856796117864130.442839805893206
240.5370721310849120.9258557378301750.462927868915088
250.5190211103022020.9619577793955950.480978889697798
260.5431299597447310.9137400805105370.456870040255269
270.4905552589764570.9811105179529140.509444741023543
280.4349283886295260.8698567772590510.565071611370474
290.5653359050971560.8693281898056880.434664094902844
300.5531190386248520.8937619227502950.446880961375148
310.5288554773387480.9422890453225040.471144522661252
320.5592319310603040.8815361378793920.440768068939696
330.5545488810055860.8909022379888290.445451118994414
340.5306011635894910.9387976728210170.469398836410509
350.5401243528086990.9197512943826030.459875647191301
360.5722364969368740.8555270061262520.427763503063126
370.5374799784456430.9250400431087140.462520021554357
380.5471985349642660.9056029300714680.452801465035734
390.5731739791226730.8536520417546550.426826020877327
400.5331244052931290.9337511894137420.466875594706871
410.578814122575530.8423717548489390.421185877424469
420.5477551306220320.9044897387559370.452244869377968
430.527173535473120.945652929053760.47282646452688
440.5017592935446010.9964814129107970.498240706455399
450.4890207392424660.9780414784849320.510979260757534
460.4857091856372460.9714183712744910.514290814362754
470.4758882977412280.9517765954824550.524111702258772
480.4493416415277250.898683283055450.550658358472275
490.4459684639648240.8919369279296490.554031536035176
500.4411827162240010.8823654324480010.558817283776
510.4309207279954110.8618414559908220.569079272004589
520.4380986401699980.8761972803399960.561901359830002
530.5236441977962640.9527116044074720.476355802203736
540.5488754218781950.902249156243610.451124578121805
550.5748544320401240.8502911359197520.425145567959876
560.5695993944746150.860801211050770.430400605525385
570.5509111752263530.8981776495472940.449088824773647
580.5922911460577120.8154177078845750.407708853942287
590.5633118013066330.8733763973867340.436688198693367
600.5545273042925190.8909453914149620.445472695707481
610.5235176559893880.9529646880212250.476482344010612
620.5216515213643220.9566969572713560.478348478635678
630.5055320057200260.9889359885599470.494467994279974
640.4885760688235690.9771521376471370.511423931176431
650.4709538849674620.9419077699349240.529046115032538
660.4965036606792270.9930073213584540.503496339320773
670.4791859315722250.958371863144450.520814068427775
680.4613878101637270.9227756203274540.538612189836273
690.4872641288860650.974528257772130.512735871113935
700.4794456754224630.9588913508449250.520554324577537
710.4717180251903320.9434360503806650.528281974809668
720.467966863145830.935933726291660.53203313685417
730.4932101540194660.9864203080389320.506789845980534
740.518144226199780.963711547600440.48185577380022
750.562690295803420.874619408393160.43730970419658
760.5877537742321090.8244924515357830.412246225767891
770.5732862250366140.8534275499267730.426713774963386
780.5997889013457780.8004221973084440.400211098654222
790.6301079498166890.7397841003666230.369892050183311
800.6276563832911210.7446872334177580.372343616708879
810.6121462822824260.7757074354351480.387853717717574
820.6248817726275120.7502364547449770.375118227372488
830.6336488547639380.7327022904721240.366351145236062
840.6174960775159620.7650078449680760.382503922484038
850.6007477289500460.7985045420999070.399252271049954
860.5810566268434240.8378867463131530.418943373156576
870.5634561733668850.873087653266230.436543826633115
880.5591948202549610.8816103594900780.440805179745039
890.5881758839635520.8236482320728970.411824116036448
900.5823267736515150.835346452696970.417673226348485
910.5532093145334770.8935813709330460.446790685466523
920.548005523698210.903988952603580.45199447630179
930.5290753650992820.9418492698014370.470924634900718
940.559616785665210.880766428669580.44038321433479
950.5401747038905120.9196505922189750.459825296109488
960.5876648478570160.8246703042859690.412335152142984
970.5682279935716070.8635440128567860.431772006428393
980.5987526067934830.8024947864130340.401247393206517
990.6313487027083170.7373025945833660.368651297291683
1000.6108973298577320.7782053402845350.389102670142268
1010.6724416304092190.6551167391815610.327558369590781
1020.6642112145795920.6715775708408170.335788785420409
1030.6799596971067280.6400806057865440.320040302893272
1040.6605783303911330.6788433392177350.339421669608867
1050.6702193926138040.6595612147723920.329780607386196
1060.7057861024281520.5884277951436960.294213897571848
1070.7435680545447280.5128638909105450.256431945455272
1080.7159819364890920.5680361270218150.284018063510907
1090.6827657528008830.6344684943982340.317234247199117
1100.6404067338173740.7191865323652520.359593266182626
1110.6341225365704090.7317549268591820.365877463429591
1120.5904494433262550.819101113347490.409550556673745
1130.6387937030819780.7224125938360430.361206296918022
1140.6109630075719180.7780739848561640.389036992428082
1150.6637836758306870.6724326483386260.336216324169313
1160.6240741435297010.7518517129405970.375925856470299
1170.6829992932720580.6340014134558840.317000706727942
1180.6908480952387010.6183038095225970.309151904761299
1190.7061685412483660.5876629175032680.293831458751634
1200.7670411585827680.4659176828344650.232958841417232
1210.7638831312849190.4722337374301620.236116868715081
1220.724024067465790.5519518650684210.275975932534210
1230.7442985395965740.5114029208068520.255701460403426
1240.7350246382615030.5299507234769940.264975361738497
1250.7022383021767710.5955233956464580.297761697823229
1260.6550772516154350.689845496769130.344922748384565
1270.642532195381960.7149356092360810.357467804618041
1280.6059358106962820.7881283786074370.394064189303718
1290.6603764462649910.6792471074700180.339623553735009
1300.6242801431334470.7514397137331050.375719856866553
1310.6175853580275670.7648292839448660.382414641972433
1320.5628422074932270.8743155850135460.437157792506773
1330.6167735054492470.7664529891015050.383226494550753
1340.6801790846564310.6396418306871380.319820915343569
1350.7582088487873270.4835823024253460.241791151212673
1360.7011442586330520.5977114827338970.298855741366948
1370.6572103165366220.6855793669267560.342789683463378
1380.6124401882158270.7751196235683450.387559811784173
1390.6217429553183740.7565140893632520.378257044681626
1400.6248560729607950.7502878540784090.375143927039205
1410.6369458578188930.7261082843622140.363054142181107
1420.5973125898218250.805374820356350.402687410178175
1430.5407380616669430.9185238766661130.459261938333057
1440.8991683818965140.2016632362069720.100831618103486
1450.8530378821337460.2939242357325080.146962117866254
1460.8286904792465370.3426190415069260.171309520753463
1470.8133395319227430.3733209361545150.186660468077257
1480.735503332552810.528993334894380.26449666744719
1490.8468310909670190.3063378180659630.153168909032981
1500.7396653284309830.5206693431380340.260334671569017
1510.9581563314270240.08368733714595140.0418436685729757


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 level10.00684931506849315OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/10prrw1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/10prrw1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/1bzbn1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/1bzbn1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/2bzbn1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/2bzbn1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/34qaq1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/34qaq1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/44qaq1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/44qaq1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/54qaq1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/54qaq1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/6wz9t1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/6wz9t1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/7wz9t1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/7wz9t1291283830.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/8prrw1291283830.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291283823kfs6k5mbr5h4oob/8prrw1291283830.ps (open in new window)


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