Home » date » 2010 » Dec » 16 »

Multiple Regression Analysis with Interaction

*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, 16 Dec 2010 14:56:54 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49.htm/, Retrieved Thu, 16 Dec 2010 15:57:11 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49.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 «
0 13 26 0 9 0 15 0 25 0 25 0 0 16 20 0 9 0 15 0 25 0 24 0 0 19 21 0 9 0 14 0 19 0 21 0 1 15 31 31 14 14 10 10 18 18 23 23 0 14 21 0 8 0 10 0 18 0 17 0 0 13 18 0 8 0 12 0 22 0 19 0 0 19 26 0 11 0 18 0 29 0 18 0 0 15 22 0 10 0 12 0 26 0 27 0 0 14 22 0 9 0 14 0 25 0 23 0 0 15 29 0 15 0 18 0 23 0 23 0 1 16 15 15 14 14 9 9 23 23 29 29 0 16 16 0 11 0 11 0 23 0 21 0 1 16 24 24 14 14 11 11 24 24 26 26 0 17 17 0 6 0 17 0 30 0 25 0 1 15 19 19 20 20 8 8 19 19 25 25 1 15 22 22 9 9 16 16 24 24 23 23 0 20 31 0 10 0 21 0 32 0 26 0 1 18 28 28 8 8 24 24 30 30 20 20 0 16 38 0 11 0 21 0 29 0 29 0 1 16 26 26 14 14 14 14 17 17 24 24 0 19 25 0 11 0 7 0 25 0 23 0 0 16 25 0 16 0 18 0 26 0 24 0 1 17 29 29 14 14 18 18 26 26 30 30 0 17 28 0 11 0 13 0 25 0 22 0 1 16 15 15 11 11 11 11 23 23 22 22 0 15 18 0 12 0 13 0 21 0 13 0 1 14 21 21 9 9 13 13 19 19 24 24 0 15 25 0 7 0 18 0 35 0 17 0 1 12 23 23 13 13 14 14 19 19 24 24 0 14 23 0 10 0 12 0 20 0 21 0 0 16 19 0 9 0 9 0 21 0 23 0 1 14 18 18 9 9 12 12 21 21 24 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 time8 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Learning[t] = + 13.5078628117885 -5.18203521944939Gender[t] -0.0012444168094538Concern[t] + 0.000772116482002167Concern_G[t] -0.216792193652821Doubts[t] -0.0504114143255668Doubts_G[t] + 0.0604243877511438Expectations[t] + 0.0863311703675794Expectations_G[t] + 0.0249723220996845Standards[t] + 0.0146764424024256Standards_G[t] + 0.11992279614248Organization[t] + 0.177189346574434Organization_G[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)13.50786281178851.6337888.267800
Gender-5.182035219449392.889215-1.79360.0751020.037551
Concern-0.00124441680945380.045505-0.02730.9782230.489112
Concern_G0.0007721164820021670.0723920.01070.9915060.495753
Doubts-0.2167921936528210.087006-2.49170.0139160.006958
Doubts_G-0.05041141432556680.138545-0.36390.7165260.358263
Expectations0.06042438775114380.0685050.8820.379310.189655
Expectations_G0.08633117036757940.1079570.79970.4252910.212645
Standards0.02497232209968450.0565380.44170.6594140.329707
Standards_G0.01467644240242560.0969570.15140.8799080.439954
Organization0.119922796142480.0566052.11860.0359440.017972
Organization_G0.1771893465744340.1043561.69790.0918080.045904


Multiple Linear Regression - Regression Statistics
Multiple R0.498534553974114
R-squared0.248536701506169
Adjusted R-squared0.18775658177505
F-TEST (value)4.08911174584148
F-TEST (DF numerator)11
F-TEST (DF denominator)136
p-value3.43259806045992e-05
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.90452270012216
Sum Squared Residuals493.300113278163


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11316.0531220041886-3.05312200418857
21615.94066570890280.0593342910971947
31915.36939458331673.63060541668334
41513.58514839520491.41485160479509
51414.8398257192953-0.839825719295306
61315.3041426259097-2.30414262590966
71915.06124049553773.93875950446226
81515.9248522289048-0.924852228904775
91415.7578296913903-1.75782969139028
101514.64011851861240.359881481387614
111615.42686632113740.573133678862553
121614.86064840520361.1393515947964
131614.86443907077921.1355609292208
141716.96040872243280.039591277567177
151512.32795628496252.6720437150375
161516.0438430737689-1.04384307376891
172016.48738310383563.51261689616439
181816.82881350359431.17118649640571
191616.546731414645-0.546731414645001
201614.43199550753191.56800449246813
211914.89754133939834.10245866060173
221614.62314375463891.37685624536109
231717.1571125758449-0.157112575844878
241715.13643161933431.86356838066571
251614.44220326229171.55779673770834
261513.7528891400951.24711085990505
271415.7029170199466-1.70291701994656
281515.9595648234141-0.9595648234141
291214.7799135454968-2.77991354549683
301415.0542371026423-1.05423710264234
311615.35955171466420.640448285335816
321415.6368758918144-1.63687589181441
331012.8146808555192-2.81468085551924
341414.1653442799207-0.165344279920668
351616.3919005879631-0.391900587963088
361614.26832558403561.73167441596444
371613.17210113708652.82789886291348
381415.411477804569-1.411477804569
392018.84233556590751.15766443409246
401414.8520369388871-0.852036938887054
411415.1508572331343-1.15085723313427
421114.6214740981898-3.62147409818977
431515.705479346406-0.70547934640602
441615.62871042138740.371289578612649
451414.9763482467373-0.97634824673731
461614.43422910246771.56577089753228
471414.8728994176262-0.872899417626203
481215.1297153084676-3.1297153084676
491615.09189110313550.908108896864501
50911.9158537785387-2.91585377853869
511414.5857001682823-0.585700168282283
521615.60152220204320.398477797956813
531615.17985092556260.820149074437405
541514.62612086982990.373879130170114
551615.02226681471750.977733185282478
561213.2984595523681-1.29845955236812
571616.6765614542336-0.67656145423362
581616.0722750336477-0.07227503364772
591416.2646917060952-2.2646917060952
601613.23254164041312.76745835958686
611716.83616719922210.163832800777918
621814.82611567071863.1738843292814
631816.10613989390311.89386010609686
641214.7437248893534-2.7437248893534
651616.0534066283651-0.0534066283651058
661014.4966156603232-4.49661566032317
671413.2924523601040.707547639896045
681815.61492168248672.38507831751334
691816.6684364545121.33156354548796
701615.63395723447870.366042765521279
711615.60209876038790.397901239612105
721614.78391266943371.2160873305663
731314.3384345626706-1.33843456267063
741614.39289364709291.60710635290705
751614.94738978895771.05261021104232
762016.3809844615193.61901553848102
771615.31042723219480.68957276780518
781510.92907815682494.07092184317509
791515.4802570407779-0.48025704077787
801615.8058942650040.194105734996024
811414.3509339906632-0.350933990663188
821513.80471185461611.19528814538389
831215.1105861331594-3.11058613315945
841716.16172665276350.838273347236485
851615.38530656673510.614693433264925
861513.68659995862811.31340004137194
871314.6140518772852-1.61405187728519
881615.88490055093980.115099449060164
891615.4099993042670.590000695733015
901616.1124909255941-0.112490925594077
911615.79083280191930.209167198080687
921415.2020660515986-1.20206605159858
931614.44861708450891.5513829154911
941615.34234705930780.657652940692245
952016.21788229030683.78211770969323
961516.104040623777-1.10404062377701
971614.41579730186491.58420269813505
981313.452612607659-0.452612607659024
991715.89742992606811.10257007393194
1001614.28964308217771.71035691782226
1011213.6167381287677-1.61673812876773
1021615.16677653076210.83322346923789
1031615.29170066349840.708299336501571
1041715.44821191878871.55178808121129
1051313.0159927941607-0.0159927941606898
1061215.8202118554908-3.82021185549084
1071816.16411444846121.83588555153881
1081414.2201676952428-0.220167695242777
1091414.7562455420886-0.756245542088608
1101314.265187487489-1.26518748748898
1111615.48999188611720.510008113882762
1121313.3297013635071-0.32970136350707
1131615.30453975368330.695460246316715
1141315.1193876849296-2.11938768492958
1151615.88002870133180.119971298668177
1161514.90331105650.0966889434999663
1171615.45939892879410.540601071205911
1181514.85028545661580.149714543384221
1191715.78664108154811.21335891845187
1201515.9176792750186-0.917679275018601
1211214.1741137132631-2.17411371326315
1221614.2074394014311.79256059856898
1231014.5235130169568-4.52351301695684
1241614.84931696124941.15068303875062
1251414.3192684973494-0.319268497349389
1261516.2180117772926-1.2180117772926
1271314.3070819105776-1.30708191057757
1281515.5381897230794-0.538189723079434
1291114.1941775385563-3.19417753855626
1301214.468898638148-2.46889863814797
1311616.0331207011334-0.0331207011333533
1321515.597652741249-0.597652741248951
1331715.42245828784091.57754171215911
1341615.64842524284810.351574757151937
1351015.1378886559636-5.13788865596359
1361814.28884500122493.7111549987751
1371314.2309861584759-1.23098615847592
1381514.63923461352140.360765386478589
1391614.44220326229171.55779673770834
1401615.15370335708470.846296642915302
1411413.97979104568830.0202089543116723
1421013.7355128058378-3.73551280583782
1431716.16172665276350.838273347236485
1441314.7976131981177-1.79761319811766
1451515.9176792750186-0.917679275018601
1461615.94169750589240.0583024941075791
1471215.5051601924463-3.50516019244631
1481314.0706346238246-1.07063462382465


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
150.9407643513492730.1184712973014550.0592356486507273
160.8851601025947550.229679794810490.114839897405245
170.9152931597228740.1694136805542530.0847068402771263
180.860128523539870.279742952920260.13987147646013
190.7906279124493790.4187441751012420.209372087550621
200.7184007949205810.5631984101588370.281599205079419
210.912291954131270.175416091737460.0877080458687298
220.8783361821441980.2433276357116050.121663817855802
230.8456179276296650.308764144740670.154382072370335
240.7978657754312790.4042684491374430.202134224568721
250.7456660697283640.5086678605432710.254333930271636
260.7130775970899560.5738448058200890.286922402910044
270.6637702638965490.6724594722069010.336229736103451
280.7494943230687780.5010113538624430.250505676931222
290.8036610655447390.3926778689105220.196338934455261
300.7692130961085830.4615738077828350.230786903891417
310.7191808567961170.5616382864077650.280819143203883
320.6697436251160650.660512749767870.330256374883935
330.800351362461480.3992972750770390.199648637538519
340.7508151147602070.4983697704795850.249184885239793
350.7224101911201970.5551796177596060.277589808879803
360.7139485051413040.5721029897173930.286051494858696
370.7082655903514110.5834688192971770.291734409648589
380.7057258749118980.5885482501762050.294274125088102
390.7413264750224660.5173470499550680.258673524977534
400.6974342920407890.6051314159184220.302565707959211
410.6939471427130550.6121057145738890.306052857286945
420.8162063293758930.3675873412482140.183793670624107
430.7766864821554840.4466270356890330.223313517844516
440.737707960119450.52458407976110.26229203988055
450.6943511637965770.6112976724068450.305648836203423
460.663269169054420.673461661891160.33673083094558
470.6159871391394130.7680257217211730.384012860860587
480.6902044917309650.6195910165380690.309795508269035
490.6452984296744140.7094031406511720.354701570325586
500.6876809391339930.6246381217320140.312319060866007
510.6420452372456770.7159095255086460.357954762754323
520.5962911847901320.8074176304197350.403708815209868
530.5726929301042540.8546141397914920.427307069895746
540.5368283933184270.9263432133631460.463171606681573
550.4916993405113850.983398681022770.508300659488615
560.4537585113410.9075170226820.546241488659
570.4125786826356960.8251573652713910.587421317364304
580.3636734873994640.7273469747989280.636326512600536
590.3992433079453470.7984866158906940.600756692054653
600.4312522679952830.8625045359905670.568747732004717
610.4003223058341530.8006446116683060.599677694165847
620.4863653449989920.9727306899979840.513634655001008
630.493084041609970.986168083219940.50691595839003
640.5684884382762660.8630231234474680.431511561723734
650.5201307967734430.9597384064531130.479869203226557
660.7604924167648960.4790151664702090.239507583235104
670.7290387502114910.5419224995770180.270961249788509
680.7615386112542670.4769227774914660.238461388745733
690.7496712048445660.5006575903108680.250328795155434
700.7101654682352530.5796690635294950.289834531764747
710.6671128752850650.6657742494298690.332887124714935
720.636514347525530.726971304948940.36348565247447
730.626550937817930.7468981243641390.373449062182069
740.6373033121726010.7253933756547970.362696687827399
750.6034010163384920.7931979673230160.396598983661508
760.7303792548884670.5392414902230670.269620745111533
770.6930710400616280.6138579198767440.306928959938372
780.8131422584709680.3737154830580640.186857741529032
790.7790281851051770.4419436297896470.220971814894823
800.7396861596876740.5206276806246510.260313840312326
810.7150858491907430.5698283016185140.284914150809257
820.6912283459072340.6175433081855320.308771654092766
830.770627451690240.4587450966195190.229372548309759
840.7403154255836880.5193691488326230.259684574416312
850.703901784720570.5921964305588610.296098215279431
860.6969415555529190.6061168888941620.303058444447081
870.686325325168370.6273493496632590.313674674831629
880.6385570528678660.7228858942642670.361442947132134
890.5925747828954070.8148504342091870.407425217104593
900.5431728259465770.9136543481068470.456827174053423
910.5058298808024840.9883402383950320.494170119197516
920.5091253795134110.9817492409731780.490874620486589
930.5085967105418370.9828065789163250.491403289458163
940.4594946079250280.9189892158500570.540505392074972
950.6164881730449770.7670236539100450.383511826955023
960.5762190198294090.8475619603411820.423780980170591
970.5907950582389220.8184098835221560.409204941761078
980.5376237404606480.9247525190787050.462376259539353
990.5085033539648990.9829932920702030.491496646035101
1000.4858289446806290.9716578893612590.514171055319371
1010.460991903767940.921983807535880.53900809623206
1020.4237590841758020.8475181683516030.576240915824198
1030.3953027616701890.7906055233403770.604697238329811
1040.4103904649766360.8207809299532710.589609535023364
1050.3746930273952620.7493860547905240.625306972604738
1060.5439905034190650.9120189931618690.456009496580935
1070.5146157280935970.9707685438128050.485384271906403
1080.5164231690895850.967153661820830.483576830910415
1090.4596620253705990.9193240507411980.540337974629401
1100.4114715539215060.8229431078430110.588528446078494
1110.3565996793483630.7131993586967260.643400320651637
1120.3254563220737870.6509126441475750.674543677926213
1130.2843093277068580.5686186554137160.715690672293142
1140.2760740407609820.5521480815219650.723925959239018
1150.2235618148612450.447123629722490.776438185138755
1160.1930407815260910.3860815630521820.80695921847391
1170.1977944015737670.3955888031475350.802205598426233
1180.1741683949790820.3483367899581640.825831605020918
1190.1575342005360580.3150684010721150.842465799463942
1200.1235853895279610.2471707790559230.876414610472039
1210.1120347016948660.2240694033897310.887965298305134
1220.11626594729180.2325318945835990.8837340527082
1230.1603524912044470.3207049824088940.839647508795553
1240.1176321638718190.2352643277436380.882367836128181
1250.08348284942641750.1669656988528350.916517150573583
1260.05655653195147790.1131130639029560.943443468048522
1270.03625929448988750.0725185889797750.963740705510112
1280.02141853308120320.04283706616240640.978581466918797
1290.01698086110778990.03396172221557980.98301913889221
1300.0125191587821990.02503831756439810.9874808412178
1310.006022242338101340.01204448467620270.993977757661899
1320.002575650771219350.00515130154243870.99742434922878
1330.002026571214627970.004053142429255940.997973428785372


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level20.0168067226890756NOK
5% type I error level60.0504201680672269NOK
10% type I error level70.0588235294117647OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/10xbka1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/10xbka1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/1qs5g1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/1qs5g1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/2qs5g1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/2qs5g1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/3jj4j1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/3jj4j1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/4jj4j1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/4jj4j1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/5jj4j1292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/5jj4j1292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/6ct341292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/6ct341292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/752l71292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/752l71292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/852l71292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/852l71292511402.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/952l71292511402.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/16/t1292511428opihn8hirgzir49/952l71292511402.ps (open in new window)


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