Home » date » 2010 » Dec » 01 »

workshop 4

*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 15:30:25 +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/t1291217364624ite3ah6zxdqi.htm/, Retrieved Wed, 01 Dec 2010 16:29: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/t1291217364624ite3ah6zxdqi.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 «
5 6 5 7 3 2 6 2 3 3 6 6 6 5 3 6 4 4 5 2 6 2 6 3 3 5 7 3 4 4 5 6 5 4 4 6 5 3 5 2 6 6 5 5 3 5 7 4 5 3 5 7 1 6 1 5 4 6 5 1 6 1 6 2 3 5 6 6 5 3 5 4 4 4 3 6 5 6 6 3 6 5 5 5 3 4 6 3 6 2 5 4 5 5 3 5 6 4 2 2 5 3 5 3 3 6 3 6 5 2 5 5 3 6 2 7 5 4 5 3 6 5 5 4 2 6 5 4 5 4 6 5 5 5 1 6 2 6 5 1 4 6 7 5 2 5 7 2 6 2 6 2 4 6 4 4 3 6 6 3 5 6 5 6 3 5 5 5 4 3 5 7 5 4 3 7 5 6 3 3 7 6 6 5 4 6 5 1 6 4 7 3 4 4 3 6 7 2 6 1 5 5 3 3 3 6 5 4 2 3 4 6 5 5 3 6 2 4 5 3 5 3 3 6 0 6 6 4 4 3 6 7 6 3 1 5 5 4 3 4 6 4 5 4 4 5 6 4 5 3 5 7 5 4 1 5 2 6 3 2 6 2 6 4 3 6 2 4 4 1 5 5 4 4 2 7 2 6 3 3 6 5 4 6 3 5 6 2 5 4 5 2 6 5 3 6 4 5 6 4 5 6 6 6 2 5 4 6 4 2 6 3 5 5 4 6 3 5 4 3 3 3 5 6 2 5 6 5 5 3 5 6 3 5 3 6 5 4 5 2 5 3 1 5 3 5 3 5 2 3 4 2 2 5 3 5 3 6 5 3 5 3 5 5 2 2 5 2 2 3 6 3 6 6 2 6 5 5 4 3 6 2 6 4 3 6 5 3 6 3 5 6 4 6 3 5 6 4 4 3 6 5 4 2 3 5 2 4 4 2 5 6 5 5 3 6 7 2 7 3 3 5 3 7 3 6 5 5 5 4 3 2 6 5 2 5 5 5 5 3 5 6 6 4 4 6 5 3 6 3 5 5 4 5 4 6 4 4 4 2 6 5 3 6 1 6 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'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
handgebruik[t] = + 4.14821985603947 -0.0935744572405169ontmoeting[t] + 0.181694835293119extravert[t] + 0.0616746589819732blozen[t] + 0.149405325426724populariteit[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)4.148219856039470.6033546.875300
ontmoeting-0.09357445724051690.055498-1.68610.0938420.046921
extravert0.1816948352931190.062652.90010.0042870.002144
blozen0.06167465898197320.0723460.85250.3952920.197646
populariteit0.1494053254267240.1015451.47130.1432870.071644


Multiple Linear Regression - Regression Statistics
Multiple R0.314528747220300
R-squared0.0989283328279716
Adjusted R-squared0.0750588846909643
F-TEST (value)4.14455886286673
F-TEST (DF numerator)4
F-TEST (DF denominator)151
p-value0.00325211903668698
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.06408114994983
Sum Squared Residuals170.972572745462


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
155.37518587821598-0.375185878215982
224.58340273640871-2.58340273640871
365.433531395545130.566468604454869
465.10788531401320.892114685986802
565.684479906543250.315520093456752
654.882603098870.117396901129995
755.33956722669676-0.33956722669676
864.832616021479561.16738397852044
965.251836560252010.748163439747991
1054.976567267718370.0234327322816268
1154.194346769967540.80565323003246
1255.32186965917271-0.321869659172713
1365.716379704801790.283620295198209
1455.43353139554513-0.433531395545128
1555.19561598045795-0.195615980457949
1665.588780511767620.411219488232382
1765.345411017492530.654588982507475
1844.80071622322102-0.800716223221019
1955.43898547473304-0.438985474733042
2054.735712422586250.264287577413754
2155.40921061400961-0.409210614009612
2265.564849441839950.435150558160047
2354.894290680461540.105709319538464
2475.163716182199411.83628381780059
2565.134331033083830.865668966916172
2665.313121507626130.68687849237387
2765.046600366639080.953399633360923
2865.509018573653750.490981426346254
2945.46582090541152-1.46582090541152
3054.525446930687380.474553069312617
3165.655519538329650.344480461670347
3245.77592942624865-1.77592942624865
3355.31351121923398-0.313511219233982
3455.28373635851055-0.283736358510552
3555.09658744402952-0.0965874440295194
3675.40375653482171.59624346517830
3775.582936720971851.41706327902815
3864.829711660728741.17028833927126
3975.289190437698471.71080956230153
4064.376041605260661.62395839473934
4154.858672028942340.14132797105766
4264.978692205253491.02130779474651
4345.25183656025201-1.25183656025201
4465.444439553920960.555560446079045
4554.782628944089120.21737105591088
4665.008467065976920.991532934023083
4764.917796969487221.08220303051278
4855.18977218966218-0.189772189662184
4965.526716141177790.473283858822207
5055.07014172495889-0.0701417249588896
5154.797776793176070.202223206823929
5255.53507458111652-0.535074581116523
5365.746154565525220.253845434474779
5465.083954244085530.916045755914466
5554.952636197790710.0473638022092915
5675.684479906543251.31552009345675
5765.225390841181380.77460915881862
5854.856157379799370.143842620200625
5955.80782922450719-0.807829224507194
6065.650065459141740.349934540858261
6155.34580072910038-0.345800729100378
6255.40960032561746-0.409600325617464
6365.681965257400280.318034742599718
6465.470885272991580.529114727008415
6535.44482926552881-2.44482926552881
6655.25183656025201-0.251836560252009
6754.888446889665770.111553110334230
6865.014310856772680.985689143227318
6954.805780590801080.194219409198920
7055.34753595502764-0.347535955027639
7145.08104988333472-1.08104988333472
7255.71425476726668-0.714254767266678
7355.38315460654683-0.383154606546834
7424.61530253466725-2.61530253466725
7565.626524100821930.373475899178073
7665.283736358510550.716263641489448
7765.746154565525220.253845434474779
7865.043696005888260.95630399411174
7955.13181638394086-0.131816383940863
8055.00846706597692-0.00846706597691644
8164.978692205253491.02130779474651
8255.23335956951226-0.233359569512258
8355.25183656025201-0.251836560252009
8464.736526915096081.26347308490392
8535.10537066487023-2.10537066487023
8665.494816342919250.50518365708075
8735.65842389908047-2.65842389908047
8855.34541101749253-0.345411017492525
8955.52126206198988-0.52126206198988
9065.043696005888260.95630399411174
9155.31312150762613-0.31312150762613
9265.046210655031230.953789344968775
9364.744885355034811.25511464496519
9465.195615980457950.80438401954205
9555.13978511227174-0.139785112271741
9634.80032651161317-1.80032651161317
9745.62280524756127-1.62280524756127
9875.412150044054561.58784995594544
9965.438985474733040.561014525266958
10065.532559931973560.467440068026442
10155.4070856764745-0.407085676474499
10245.04660036663908-1.04660036663908
10365.53217022036570.467829779634294
10464.800326511613171.19967348838683
10565.626134389214070.373865610785925
10654.739041564239050.260958435760954
10765.807829224507190.192170775492806
10865.839729022765740.160270977234263
10924.42776390857836-2.42776390857836
11065.989524059800310.0104759401996865
11155.55861593943634-0.558615939436336
11255.52710585278564-0.527105852785645
11335.62068031002616-2.62068031002616
11445.83176029443486-1.83176029443486
11564.739041564239051.26095843576095
11655.5967492400985-0.596749240098497
11765.58332643257970.416673567420295
11845.47339992213455-1.47339992213455
11965.160387040546610.839612959453394
12045.32147994756486-1.32147994756486
12135.14601861467536-2.14601861467536
12265.345411017492530.654588982507475
12355.25144684864416-0.251446848644157
12475.257290639439921.74270936056008
12565.714254767266680.285745232733322
12665.957234549933920.0427654500660817
12755.00846706597692-0.00846706597691644
12855.65509475742767-0.65509475742767
12924.95012154864774-2.95012154864774
13054.920736399532170.0792636004678346
13134.86996989892602-1.86996989892602
13265.014310856772680.985689143227318
13355.21954705038561-0.219547050385614
13454.982021346906290.0179786530937135
13554.98747542609420.0125245739058002
13625.07053143656674-3.07053143656674
13755.16038704054661-0.160387040546606
13855.19561598045795-0.195615980457949
13965.650455170749590.349544829250409
14065.558615939436340.441384060563664
14154.714331071095680.285668928904323
14255.34541101749253-0.345411017492525
14355.22206169952858-0.222061699528579
14465.626134389214070.373865610785925
14565.594234590955530.405765409044469
14665.502785071250130.497214928749872
14765.070141724958890.92985827504111
14865.615226230838250.384773769161752
14975.652190396676851.34780960332315
15065.441500123876010.558499876123993
15165.07559580414680.924404195853197
15265.014700568380530.985299431619466
15375.807829224507191.19217077549281
15414.64256274624771-3.64256274624771
15565.684479906543250.315520093456752
15655.29503422849423-0.295034228494231


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.8417344565447360.3165310869105270.158265543455264
90.7489827806328020.5020344387343960.251017219367198
100.6259431478958370.7481137042083270.374056852104163
110.5109617799712960.9780764400574080.489038220028704
120.565839201102630.868321597794740.43416079889737
130.4664580161120080.9329160322240150.533541983887992
140.3789364490506030.7578728981012050.621063550949397
150.2986647465697030.5973294931394070.701335253430297
160.2238378169056610.4476756338113220.776162183094339
170.1701356891334550.340271378266910.829864310866545
180.1935612161109840.3871224322219690.806438783889016
190.1705038990385280.3410077980770560.829496100961472
200.1421690738402700.2843381476805410.85783092615973
210.1055998338640110.2111996677280210.89440016613599
220.07368359473105740.1473671894621150.926316405268943
230.04983265658508080.09966531317016170.95016734341492
240.1236073294226160.2472146588452330.876392670577384
250.1059792461623040.2119584923246070.894020753837697
260.09071474493622140.1814294898724430.909285255063779
270.07250404367928480.1450080873585700.927495956320715
280.0533974578602120.1067949157204240.946602542139788
290.09286327319753440.1857265463950690.907136726802466
300.06970110858695880.1394022171739180.930298891413041
310.05288146965562690.1057629393112540.947118530344373
320.1352167191834970.2704334383669950.864783280816503
330.1064778744886400.2129557489772810.89352212551136
340.08176997221993870.1635399444398770.918230027780061
350.06111688545027750.1222337709005550.938883114549723
360.1008326560300600.2016653120601210.89916734396994
370.1319234063606290.2638468127212570.868076593639372
380.1286200311030840.2572400622061670.871379968896916
390.1616922020451710.3233844040903420.838307797954829
400.1885673281379650.3771346562759300.811432671862035
410.1541991883138670.3083983766277350.845800811686133
420.1442966575508880.2885933151017750.855703342449112
430.1650992570810450.330198514162090.834900742918955
440.1358042067700440.2716084135400880.864195793229956
450.1140423658700330.2280847317400670.885957634129967
460.1062580757102210.2125161514204410.89374192428978
470.1067734124245340.2135468248490680.893226587575466
480.08757391634709570.1751478326941910.912426083652904
490.07059991453176730.1411998290635350.929400085468233
500.05545695788493650.1109139157698730.944543042115064
510.04344702972053820.08689405944107640.956552970279462
520.03847549293614650.07695098587229310.961524507063853
530.02899923652609930.05799847305219850.9710007634739
540.02480694131086350.04961388262172690.975193058689137
550.01890505166806080.03781010333612170.98109494833194
560.02092823235021950.0418564647004390.97907176764978
570.01751146706923920.03502293413847850.98248853293076
580.01293261447513320.02586522895026650.987067385524867
590.01261864034555720.02523728069111430.987381359654443
600.00930226223868350.0186045244773670.990697737761316
610.006873013300875110.01374602660175020.993126986699125
620.005322659271590530.01064531854318110.99467734072841
630.003747472329772350.007494944659544690.996252527670228
640.002731025993154860.005462051986309720.997268974006845
650.0171208919697310.0342417839394620.982879108030269
660.01289264464870520.02578528929741040.987107355351295
670.009581641284269240.01916328256853850.99041835871573
680.009103774375662130.01820754875132430.990896225624338
690.006906806858227750.01381361371645550.993093193141772
700.005545424415420130.01109084883084030.99445457558458
710.0069164211877710.0138328423755420.993083578812229
720.005792991848136740.01158598369627350.994207008151863
730.004331638633649880.008663277267299750.99566836136635
740.02912217324608520.05824434649217050.970877826753915
750.02284137492533490.04568274985066980.977158625074665
760.01963514725370210.03927029450740420.980364852746298
770.01485741714172000.02971483428344010.98514258285828
780.01389644286679790.02779288573359570.986103557133202
790.01041679991988900.02083359983977790.98958320008011
800.007663612297223040.01532722459444610.992336387702777
810.007715095014757970.01543019002951590.992284904985242
820.005685495209693980.01137099041938800.994314504790306
830.004170104547300630.008340209094601270.9958298954527
840.004994437070805070.009988874141610140.995005562929195
850.01346703499591740.02693406999183470.986532965004083
860.01066055686493730.02132111372987460.989339443135063
870.04695878011400010.09391756022800020.953041219886
880.03738996337266110.07477992674532220.962610036627339
890.03037301603321060.06074603206642120.96962698396679
900.02941342426459540.05882684852919070.970586575735405
910.02283168324650680.04566336649301350.977168316753493
920.02241522133496540.04483044266993080.977584778665035
930.02834296584961870.05668593169923740.971657034150381
940.02602942093883810.05205884187767620.973970579061162
950.01987651290941790.03975302581883580.980123487090582
960.03101547728083310.06203095456166610.968984522719167
970.04389126631019880.08778253262039770.95610873368980
980.0579703925570930.1159407851141860.942029607442907
990.04921722490713940.09843444981427870.95078277509286
1000.0402171313011020.0804342626022040.959782868698898
1010.03161883734519350.0632376746903870.968381162654806
1020.02906163964753590.05812327929507190.970938360352464
1030.02291786941982850.0458357388396570.977082130580172
1040.02958089400155780.05916178800311550.970419105998442
1050.02309444705527690.04618889411055380.976905552944723
1060.01990953383138780.03981906766277560.980090466168612
1070.01476885054469880.02953770108939760.985231149455301
1080.01079146438041300.02158292876082590.989208535619587
1090.02947486963819910.05894973927639820.970525130361801
1100.02194722194389640.04389444388779270.978052778056104
1110.01830828907251410.03661657814502810.981691710927486
1120.01412673568984610.02825347137969220.985873264310154
1130.05517206955049180.1103441391009840.944827930449508
1140.1002882560049300.2005765120098600.89971174399507
1150.1596513666012880.3193027332025770.840348633398712
1160.1411216982189690.2822433964379380.858878301781031
1170.1157764951063270.2315529902126530.884223504893673
1180.1641535267766620.3283070535533250.835846473223337
1190.1481136174462170.2962272348924340.851886382553783
1200.1639017479365840.3278034958731680.836098252063416
1210.2576088817133670.5152177634267340.742391118286633
1220.2335877111027780.4671754222055550.766412288897222
1230.1922520395234630.3845040790469250.807747960476538
1240.2893843016209020.5787686032418040.710615698379098
1250.2427656962302590.4855313924605180.757234303769741
1260.2146367472310990.4292734944621970.785363252768901
1270.1844363870299270.3688727740598550.815563612970073
1280.2774441163093230.5548882326186460.722555883690677
1290.4693597661775930.9387195323551860.530640233822407
1300.4266265327419090.8532530654838170.573373467258091
1310.585170639295630.829658721408740.41482936070437
1320.6131557509795140.7736884980409720.386844249020486
1330.5692232357729710.8615535284540590.430776764227029
1340.532088325656110.9358233486877790.467911674343889
1350.4664719922045080.9329439844090150.533528007795492
1360.850220041082290.2995599178354190.149779958917709
1370.8033942508048850.393211498390230.196605749195115
1380.7409293144679370.5181413710641270.259070685532063
1390.6696966729218840.6606066541562320.330303327078116
1400.5883124747763940.8233750504472110.411687525223606
1410.5587211439883030.8825577120233950.441278856011697
1420.4775413021000290.9550826042000580.522458697899971
1430.3868688894291020.7737377788582030.613131110570898
1440.2936407603236860.5872815206473720.706359239676314
1450.2056593308664450.4113186617328910.794340669133555
1460.1326885105778560.2653770211557110.867311489422144
1470.1781705863895220.3563411727790450.821829413610478
1480.1026174412516030.2052348825032050.897382558748397


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level50.0354609929078014NOK
5% type I error level430.304964539007092NOK
10% type I error level620.439716312056738NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/10qlhm1291217414.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/10qlhm1291217414.ps (open in new window)


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


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


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/3cb2v1291217414.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/3cb2v1291217414.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/4nkjy1291217414.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/4nkjy1291217414.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/5nkjy1291217414.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/01/t1291217364624ite3ah6zxdqi/5nkjy1291217414.ps (open in new window)


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


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


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


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