Home » date » 2010 » Dec » 14 »

Multiple Regression 10

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 14 Dec 2010 20:36:58 +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/14/t1292358910278970gys2bq8x4.htm/, Retrieved Tue, 14 Dec 2010 21:35:13 +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/14/t1292358910278970gys2bq8x4.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 1 22 15 16 17 10 1 2 22 23 24 42 9 1 2 22 26 22 39 30 1 2 23 19 21 22 18 1 2 21 19 23 20 16 1 2 21 16 23 31 20 1 1 24 23 21 42 20 2 1 22 22 20 30 18 1 2 21 19 22 33 21 1 2 23 24 20 29 20 1 1 20 19 12 31 20 2 1 23 25 23 39 20 1 1 20 23 23 44 29 1 2 21 31 30 40 14 2 1 22 29 22 42 25 2 2 22 18 21 28 19 2 2 21 17 21 29 19 1 1 20 22 15 35 25 1 1 21 21 22 26 25 1 2 21 24 24 42 19 1 1 20 22 23 26 19 1 1 21 16 15 30 18 1 2 23 22 24 28 24 1 1 23 21 24 24 18 2 1 21 25 21 26 26 1 1 22 22 21 39 26 2 1 20 24 18 33 24 2 1 23 21 20 50 29 2 1 21 25 19 40 26 1 1 21 29 29 49 28 2 1 23 19 20 31 18 2 1 23 29 23 37 19 2 2 22 25 24 29 21 1 1 21 19 27 37 13 1 1 0 27 28 16 19 1 2 21 25 24 28 26 1 2 21 23 29 29 17 1 1 22 24 24 31 19 2 2 22 23 22 34 28 1 2 22 25 25 30 15 1 1 22 26 24 31 16 1 1 23 23 14 44 18 2 1 0 22 22 35 25 1 2 22 32 24 47 15 1 2 21 22 24 39 24 1 1 23 18 24 34 24 2 1 21 19 24 15 14 2 2 32 23 22 26 19 2 2 32 24 22 25 20 2 1 21 19 21 30 27 1 1 20 16 21 25 20 1 1 21 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 time7 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
PS[t] = + 6.5867952337856 -0.878020762828454Roken[t] -1.3024665063434Geslacht[t] + 0.0879722811529304Leeftijd[t] + 0.401296015151827O[t] + 0.130024469727997CMD[t] + 0.169296265598382PEC[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.58679523378563.1407852.09720.0377130.018857
Roken-0.8780207628284540.58383-1.50390.1347830.067391
Geslacht-1.30246650634340.609028-2.13860.0341440.017072
Leeftijd0.08797228115293040.0857011.02650.3063620.153181
O0.4012960151518270.0799765.01772e-061e-06
CMD0.1300244697279970.0422593.07690.0025020.001251
PEC0.1692962655983820.0581052.91360.0041390.00207


Multiple Linear Regression - Regression Statistics
Multiple R0.534702007831309
R-squared0.285906237178833
Adjusted R-squared0.256357529751751
F-TEST (value)9.6757612116998
F-TEST (DF numerator)6
F-TEST (DF denominator)145
p-value5.97857463535689e-09
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.5800265148466
Sum Squared Residuals1858.40552781568


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11515.7877922709388-0.787792270938764
22321.655030126241.34496987376001
32624.01758626431841.98241373568164
41919.4622913577629-0.462291357762933
51919.490297355108-0.490297355107969
61621.5977515845095-5.59775158450947
72323.791812071016-0.791812071015971
82220.43766456279711.5623354372029
91921.625800774412-2.62580077441201
102420.30975916190393.69024083809615
111918.39798964302980.602010356970163
122523.23833764815421.76166235184575
132326.0262303065493-3.02623030654934
143124.56126632453396.43873367546606
152923.98562408902545.01437591097461
161819.4457413977479-1.44574139774791
171719.487793586323-2.48779358632298
182220.96845689538921.03154310461078
192122.695281055053-1.69528105505296
202423.26002050107090.73997949892912
212221.99282719546160.00717280453843304
221619.2212329687135-3.22123296871349
232222.4621038151767-0.462103815176689
242122.2286948490178-1.22869484901781
252521.58526054267113.41473945732894
262224.2415716931164-2.24157169311641
272420.86497897296193.13502102703813
282124.9883851600922-3.98838516009217
292522.60301108855942.39698891144063
302929.0028047616548-0.00280476165483319
311920.655661313678-1.65566131367803
322922.80899244309996.19100755690013
332521.11824644412823.88175355587184
341924.1004751106395-5.10047511063948
352720.93961695088216.06038304911788
362522.62475178406762.37524821593241
372323.2375899391693-0.237589939169288
382423.22019012155920.779809878440759
392322.15085062165320.849149378346839
402521.51181009824613.48818990175386
412622.71230132476413.2876986752359
422320.81622409205952.18377590794052
432221.14006261556490.859937384435056
443223.32093006847038.67906993152973
452223.7164284198788-1.7164284198788
461824.5447171398881-6.54471713988807
471919.327324233938-0.327324233937992
482320.46671128497312.53328871502695
492420.50598308084343.49401691915657
501922.2746546871814-3.27465468718143
511621.2295069610283-5.2295069610283
522323.2041563279971-0.204156327997115
531720.1408329462216-3.14083294622163
541723.024638582614-6.02463858261398
552822.04029234782975.95970765217031
562421.49115880286612.50884119713385
572119.18379828195631.81620171804371
581419.8254930673672-5.8254930673672
592122.1305199181195-1.13051991811953
602023.3928832060952-3.39288320609515
612523.53351385555811.46648614444186
622021.758940103356-1.75894010335598
631722.6317269381337-5.63172693813372
642627.3214874520953-1.32148745209528
651720.5164901142594-3.51649011425943
661720.8737980699247-3.87379806992467
672422.62017747480721.37982252519276
683025.37101310551394.62898689448607
692522.40382852394532.59617147605475
701521.790197578471-6.79019757847097
712522.96758226918332.03241773081669
721825.5699234228905-7.56992342289053
732023.0677204398956-3.06772043989557
743227.69317456752024.30682543247979
751415.0959826315886-1.09598263158855
762020.3422511945641-0.342251194564103
772523.54911975661251.45088024338749
782524.71057339399140.289426606008589
792522.50736428896422.49263571103581
803522.146132860055312.8538671399447
812924.1655742873494.83442571265101
822525.8814100477762-0.881410047776233
832122.6201774748072-1.62017747480724
842121.2736331370505-0.273633137050487
852425.6690172748622-1.66901727486218
862622.0667964779423.93320352205802
872424.1987267141688-0.198726714168755
882024.9549707593868-4.95497075938679
892424.2490706227881-0.249070622788071
901819.1104003443211-1.1104003443211
911719.1417029008237-2.14170290082371
922222.8699470918869-0.869947091886888
932224.1574241234088-2.15742412340876
942220.90218022835691.09781977164312
952425.4701691767594-1.47016917675935
963224.05747963847297.94252036152708
971920.5529383248676-1.55293832486762
982121.4789497207493-0.478949720749304
992323.7549074253766-0.754907425376594
1002621.35542743119214.64457256880795
1011823.0795016295047-5.07950162950466
1021919.5797669430609-0.579766943060935
1032224.5765478486784-2.57654784867839
1042720.57438241062026.4256175893798
1052120.95493885644690.0450611435531078
1062021.4534421563874-1.45344215638739
1072124.1106031644278-3.11060316442777
1082024.776673696884-4.776673696884
1092922.18177363025696.81822636974314
1103023.68504025363036.31495974636969
1112323.1565001614552-0.15650016145517
1122919.77250954677819.22749045322193
1131922.6820303257981-3.68203032579812
1142624.72339890234111.2766010976589
1152221.33351303574340.666486964256646
1162626.2698303211394-0.269830321139417
1172725.20738303715621.79261696284381
1181922.5497362940165-3.54973629401647
1192423.34167895202760.658321047972382
1202621.12913458358474.8708654164153
1212219.73022315147172.26977684852833
1222324.7830704652235-1.78307046522347
1232522.87980367380682.1201963261932
1241923.6649475418916-4.66494754189157
1252022.4456472811581-2.44564728115814
1262523.69012806514431.3098719348557
1271419.122372548104-5.12237254810401
1282018.75601278672631.24398721327374
1292725.53804952154271.46195047845731
1302122.9821585015312-1.98215850153116
1312121.2947998235142-0.294799823514223
1321419.3077908812097-5.30779088120966
1332124.5187816830184-3.51878168301841
1342321.9161207128341.08387928716601
1351820.8043062838964-2.80430628389641
1362021.7989217514557-1.79892175145568
1371922.2076156611301-3.20761566113006
1381520.456567023009-5.45656702300905
1392321.73824906239021.26175093760978
1402625.61390537120610.386094628793907
1412123.3127367119725-2.31273671197253
1421316.1424490270512-3.14244902705121
1432421.04149676894312.95850323105694
1441718.2144582077956-1.21445820779565
1452124.4858383673783-3.48583836737829
1462825.97017511930182.02982488069825
1472222.0836230618767-0.0836230618766936
1482519.44286074526335.55713925473672
1491820.8929452247211-2.89294522472114
1502724.78991244770742.21008755229263
1512523.64293022246371.35706977753635
1522121.9006150715596-0.900615071559567


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.4323565507207640.8647131014415270.567643449279236
110.400250264633140.800500529266280.59974973536686
120.272652823880510.545305647761020.72734717611949
130.1860516696718250.372103339343650.813948330328175
140.5421684247527010.9156631504945980.457831575247299
150.505331261216780.989337477566440.49466873878322
160.4953708150007220.9907416300014440.504629184999278
170.4454401513969050.890880302793810.554559848603095
180.3887336635859130.7774673271718250.611266336414087
190.3068823659235370.6137647318470750.693117634076463
200.233868234600550.4677364692010990.76613176539945
210.1760810902534130.3521621805068260.823918909746587
220.1566928661617070.3133857323234140.843307133838293
230.1124475462748930.2248950925497850.887552453725107
240.08285616447364780.1657123289472960.917143835526352
250.08928396247219710.1785679249443940.910716037527803
260.07731657059747680.1546331411949540.922683429402523
270.0660563187031210.1321126374062420.933943681296879
280.1119145193760950.2238290387521910.888085480623905
290.08968284369514550.1793656873902910.910317156304854
300.06684737187662570.1336947437532510.933152628123374
310.05509486085402670.1101897217080530.944905139145973
320.08390518373895580.1678103674779120.916094816261044
330.07498048271549790.1499609654309960.925019517284502
340.1241222047307370.2482444094614750.875877795269263
350.1177833989011760.2355667978023520.882216601098824
360.1013346701878860.2026693403757710.898665329812114
370.07840698293381580.1568139658676320.921593017066184
380.06173462987179050.1234692597435810.93826537012821
390.04706020242372690.09412040484745380.952939797576273
400.04742624894546950.0948524978909390.95257375105453
410.04911300730793320.09822601461586650.950886992692067
420.04812785021748370.09625570043496750.951872149782516
430.05414567924604460.1082913584920890.945854320753955
440.1480827548625380.2961655097250770.851917245137461
450.131225732466770.262451464933540.86877426753323
460.201948238120140.4038964762402790.79805176187986
470.1682627673683260.3365255347366520.831737232631674
480.1491781130321680.2983562260643370.850821886967831
490.141313002411360.282626004822720.85868699758864
500.1373479833319850.274695966663970.862652016668015
510.1578296258823560.3156592517647120.842170374117644
520.1308173531703460.2616347063406920.869182646829654
530.1231722176730590.2463444353461180.876827782326941
540.1627581528744640.3255163057489280.837241847125536
550.192887083778650.3857741675572990.80711291622135
560.1708634812018040.3417269624036080.829136518798196
570.1657682556040880.3315365112081750.834231744395912
580.2007836975016690.4015673950033390.799216302498331
590.1743151530089650.348630306017930.825684846991035
600.1788118011856420.3576236023712840.821188198814358
610.1608688352170060.3217376704340120.839131164782994
620.1578267469268030.3156534938536050.842173253073197
630.2024232794046880.4048465588093770.797576720595312
640.1748649833979510.3497299667959020.825135016602049
650.180452819334590.360905638669180.81954718066541
660.2761426972744430.5522853945488860.723857302725557
670.2439221121311260.4878442242622510.756077887868874
680.2878023154194130.5756046308388260.712197684580587
690.2702878427012270.5405756854024530.729712157298773
700.3709894490344870.7419788980689740.629010550965513
710.3450293999208850.690058799841770.654970600079115
720.4833918815142330.9667837630284660.516608118485767
730.467807965876080.935615931752160.53219203412392
740.5129185014915880.9741629970168240.487081498508412
750.47368575216190.94737150432380.5263142478381
760.4292641211075020.8585282422150030.570735878892498
770.3935146713426520.7870293426853030.606485328657348
780.3671814061710890.7343628123421780.632818593828911
790.3498679225909380.6997358451818760.650132077409062
800.8627714859834760.2744570280330490.137228514016524
810.9000511603137470.1998976793725070.0999488396862534
820.8778910577076690.2442178845846620.122108942292331
830.8560359543443680.2879280913112640.143964045655632
840.828329695345460.3433406093090790.171670304654539
850.8009905493612060.3980189012775880.199009450638794
860.805865019484170.3882699610316620.194134980515831
870.7723659940154750.455268011969050.227634005984525
880.794084430544320.4118311389113610.20591556945568
890.7575092467994240.4849815064011520.242490753200576
900.7250034133025630.5499931733948740.274996586697437
910.7070116687404760.5859766625190490.292988331259524
920.6692851296410170.6614297407179660.330714870358983
930.6419511386310420.7160977227379160.358048861368958
940.597663867805290.804672264389420.40233613219471
950.5552333309040360.8895333381919280.444766669095964
960.730350851259370.539298297481260.26964914874063
970.6950452143927680.6099095712144650.304954785607232
980.6494063295885020.7011873408229950.350593670411498
990.6015571199861640.7968857600276720.398442880013836
1000.6487829223141350.702434155371730.351217077685865
1010.6649124288392760.6701751423214480.335087571160724
1020.6170878915629880.7658242168740230.382912108437012
1030.6100945816441880.7798108367116230.389905418355812
1040.7384213647905220.5231572704189560.261578635209478
1050.6943051386286390.6113897227427220.305694861371361
1060.6573931100257260.6852137799485470.342606889974274
1070.6238059697383120.7523880605233760.376194030261688
1080.7037021356550180.5925957286899630.296297864344982
1090.8488919042986430.3022161914027130.151108095701357
1100.889299595453510.2214008090929790.11070040454649
1110.8631703077448060.2736593845103890.136829692255194
1120.9660440691899130.06791186162017310.0339559308100866
1130.966638648618350.06672270276329840.0333613513816492
1140.9543765757176850.09124684856463050.0456234242823153
1150.9377822393025360.1244355213949270.0622177606974636
1160.9170608964926140.1658782070147710.0829391035073855
1170.8987490472894240.2025019054211510.101250952710576
1180.8843564477227520.2312871045544950.115643552277248
1190.857526863494670.2849462730106610.142473136505331
1200.9181293421640770.1637413156718460.0818706578359229
1210.9173706281173560.1652587437652880.082629371882644
1220.8951516732066790.2096966535866420.104848326793321
1230.8737237568957880.2525524862084230.126276243104212
1240.8824294605463230.2351410789073540.117570539453677
1250.8607572395955260.2784855208089490.139242760404475
1260.8392485743050460.3215028513899080.160751425694954
1270.852849104183870.2943017916322590.147150895816129
1280.8413275843671740.3173448312656510.158672415632826
1290.7949393280510830.4101213438978340.205060671948917
1300.7360956605111030.5278086789777930.263904339488897
1310.6830115164132360.6339769671735280.316988483586764
1320.7256306148505580.5487387702988840.274369385149442
1330.7852748238978460.4294503522043080.214725176102154
1340.7198058999890740.5603882000218530.280194100010926
1350.763936047235970.4721279055280610.236063952764031
1360.6816872687793930.6366254624412140.318312731220607
1370.6262777742248250.747444451550350.373722225775175
1380.7787404380346080.4425191239307840.221259561965392
1390.7939583629327020.4120832741345950.206041637067298
1400.6802550160950740.6394899678098530.319744983904926
1410.5390455944298510.9219088111402970.460954405570149
1420.9541252719430620.09174945611387520.0458747280569376


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 level80.0601503759398496OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/10j17f1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/10j17f1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/1c0sl1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/1c0sl1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/2c0sl1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/2c0sl1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/3n9r61292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/3n9r61292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/4n9r61292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/4n9r61292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/5n9r61292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/5n9r61292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/6g08r1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/6g08r1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/7g08r1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/7g08r1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/8qapu1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/8qapu1292359006.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/9qapu1292359006.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292358910278970gys2bq8x4/9qapu1292359006.ps (open in new window)


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