Home » date » 2010 » Nov » 30 »

ws 8b

*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, 30 Nov 2010 10:50: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/Nov/30/t1291114182lynqj1vuqelvg67.htm/, Retrieved Tue, 30 Nov 2010 11:49:42 +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/Nov/30/t1291114182lynqj1vuqelvg67.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 «
2938 2909 3141 2427 3059 2918 2901 2823 2798 2892 2967 2397 3458 3024 3100 2904 3056 2771 2897 2772 2857 3020 2648 2364 3194 3013 2560 3074 2746 2846 3184 2354 3080 2963 2430 2296 2416 2647 2789 2685 2666 2882 2953 2127 2563 3061 2809 2861 2781 2555 3206 2570 2410 3195 2736 2743 2934 2668 2907 2866 2983 2878 3225 2515 3193 2663 2908 2896 2853 3028 3053 2455 3401 2969 3243 2849 3296 3121 3194 3023 2984 3525 3116 2383 3294 2882 2820 2583 2803 2767 2945 2716 2644 2956 2598 2171 2994 2645 2724 2550 2707 2679 2878 2307 2496 2637 2436 2426 2607 2533 2888 2520 2229 2804 2661 2547 2509 2465 2629 2706 2666 2432 2836 2888 2566 2802 2611 2683 2675 2434 2693 2619 2903 2550 2900 2456 2912 2883 2464 2655 2447 2592 2698 2274 2901 2397 3004 2614 2882 2671 2761 2806 2414 2673 2748 2112 2903 2633 2684 2861 2504 2708 2961 2535 2688 2699 2469 2585 2582 2480 2709 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'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Echtscheidingen[t] = + 2639.47380952381 + 440.710292658731M1[t] + 210.821478174603M2[t] + 431.332663690476M3[t] + 173.577182539683M4[t] + 260.221701388889M5[t] + 334.199553571429M6[t] + 378.577405753968M7[t] + 145.221924603175M8[t] + 228.466443452381M9[t] + 339.510962301587M10[t] + 238.822147817460M11[t] -1.71118551587302t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2639.4738095238164.87555740.685200
M1440.71029265873180.9898825.441500
M2210.82147817460380.9767232.60350.0100590.00503
M3431.33266369047680.9648165.327400
M4173.57718253968380.9541612.14410.0334680.016734
M5260.22170138888980.9447583.21480.0015670.000784
M6334.19955357142980.9366084.12925.7e-052.9e-05
M7378.57740575396880.9297124.67796e-063e-06
M8145.22192460317580.9240691.79450.0745350.037267
M9228.46644345238180.9196792.82340.005330.002665
M10339.51096230158780.9165444.19584.4e-052.2e-05
M11238.82214781746080.9146622.95150.0036170.001809
t-1.711185515873020.318569-5.371500


Multiple Linear Regression - Regression Statistics
Multiple R0.584418415674032
R-squared0.341544884578946
Adjusted R-squared0.29423074454869
F-TEST (value)7.21866411099392
F-TEST (DF numerator)12
F-TEST (DF denominator)167
p-value1.48240975050840e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation221.592211432607
Sum Squared Residuals8200219.0639881


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
129383078.47291666666-140.472916666662
229092846.8729166666762.1270833333328
331413065.6729166666775.3270833333329
424272806.20625-379.20625
530592891.13958333333167.860416666666
629182963.40625-45.4062500000003
729013006.07291666667-105.072916666667
828232771.0062551.99375
927982852.53958333333-54.5395833333332
1028922961.87291666667-69.872916666667
1129672859.47291666667107.527083333333
1223972618.93958333333-221.939583333333
1334583057.93869047619400.061309523809
1430242826.33869047619197.661309523809
1531003045.1386904761954.8613095238095
1629042785.67202380952118.327976190476
1730562870.60535714286185.394642857143
1827712942.87202380952-171.872023809524
1928972985.53869047619-88.5386904761906
2027722750.4720238095221.5279761904761
2128572832.0053571428624.9946428571428
2230202941.3386904761978.6613095238096
2326482838.93869047619-190.938690476191
2423642598.40535714286-234.405357142857
2531943037.40446428571156.595535714285
2630132805.80446428571207.195535714286
2725603024.60446428571-464.604464285714
2830742765.13779761905308.862202380952
2927462850.07113095238-104.071130952381
3028462922.33779761905-76.3377976190476
3131842965.00446428571218.995535714286
3223542729.93779761905-375.937797619048
3330802811.47113095238268.528869047619
3429632920.8044642857142.1955357142857
3524302818.40446428571-388.404464285714
3622962577.87113095238-281.871130952381
3724163016.87023809524-600.870238095238
3826472785.27023809524-138.270238095238
3927893004.07023809524-215.070238095238
4026852744.60357142857-59.6035714285714
4126662829.53690476190-163.536904761905
4228822901.80357142857-19.8035714285715
4329532944.470238095248.52976190476186
4421272709.40357142857-582.403571428572
4525632790.93690476190-227.936904761905
4630612900.27023809524160.729761904762
4728092797.8702380952411.1297619047618
4828612557.33690476190303.663095238095
4927812996.33601190476-215.336011904762
5025552764.73601190476-209.736011904762
5132062983.53601190476222.463988095238
5225702724.06934523810-154.069345238095
5324102809.00267857143-399.002678571429
5431952881.26934523810313.730654761905
5527362923.93601190476-187.936011904762
5627432688.8693452381054.1306547619047
5729342770.40267857143163.597321428571
5826682879.73601190476-211.736011904762
5929072777.33601190476129.663988095238
6028662536.80267857143329.197321428571
6129832975.801785714297.19821428571394
6228782744.20178571429133.798214285714
6332252963.00178571429261.998214285714
6425152703.53511904762-188.535119047619
6531932788.46845238095404.531547619048
6626632860.73511904762-197.735119047619
6729082903.401785714294.59821428571424
6828962668.33511904762227.664880952381
6928532749.86845238095103.131547619048
7030282859.20178571429168.798214285714
7130532756.80178571429296.198214285714
7224552516.26845238095-61.2684523809523
7334012955.26755952381445.73244047619
7429692723.66755952381245.332440476190
7532432942.46755952381300.532440476190
7628492683.00089285714165.999107142857
7732962767.93422619048528.065773809524
7831212840.20089285714280.799107142857
7931942882.86755952381311.132440476190
8030232647.80089285714375.199107142857
8129842729.33422619048254.665773809524
8235252838.66755952381686.33244047619
8331162736.26755952381379.732440476191
8423832495.73422619048-112.734226190476
8532942934.73333333333359.266666666666
8628822703.13333333333178.866666666667
8728202921.93333333333-101.933333333333
8825832662.46666666667-79.4666666666667
8928032747.455.6
9027672819.66666666667-52.6666666666666
9129452862.3333333333382.6666666666667
9227162627.2666666666788.7333333333333
9326442708.8-64.8
9429562818.13333333333137.866666666667
9525982715.73333333333-117.733333333333
9621712475.2-304.2
9729942914.1991071428679.8008928571425
9826452682.59910714286-37.5991071428571
9927242901.39910714286-177.399107142857
10025502641.93244047619-91.9324404761905
10127072726.86577380952-19.8657738095238
10226792799.13244047619-120.132440476190
10328782841.7991071428636.2008928571428
10423072606.73244047619-299.732440476190
10524962688.26577380952-192.265773809524
10626372797.59910714286-160.599107142857
10724362695.19910714286-259.199107142857
10824262454.66577380952-28.6657738095237
10926072893.66488095238-286.664880952381
11025332662.06488095238-129.064880952381
11128882880.864880952387.13511904761912
11225202621.39821428571-101.398214285714
11322292706.33154761905-477.331547619048
11428042778.5982142857125.4017857142858
11526612821.26488095238-160.264880952381
11625472586.19821428571-39.1982142857143
11725092667.73154761905-158.731547619048
11824652777.06488095238-312.064880952381
11926292674.66488095238-45.664880952381
12027062434.13154761905271.868452380952
12126662873.13065476191-207.130654761905
12224322641.53065476190-209.530654761905
12328362860.33065476190-24.3306547619047
12428882600.86398809524287.136011904762
12525662685.79732142857-119.797321428571
12628022758.0639880952443.936011904762
12726112800.73065476190-189.730654761905
12826832565.66398809524117.336011904762
12926752647.1973214285727.8026785714286
13024342756.53065476190-322.530654761905
13126932654.1306547619038.8693452380953
13226192413.59732142857205.402678571429
13329032852.5964285714350.4035714285711
13425502620.99642857143-70.9964285714285
13529002839.7964285714360.2035714285715
13624562580.32976190476-124.329761904762
13729122665.26309523810246.736904761905
13828832737.52976190476145.470238095238
13924642780.19642857143-316.196428571429
14026552545.12976190476109.870238095238
14124472626.66309523810-179.663095238095
14225922735.99642857143-143.996428571428
14326982633.5964285714364.4035714285715
14422742393.06309523810-119.063095238095
14529012832.0622023809568.9377976190474
14623972600.46220238095-203.462202380952
14730042819.26220238095184.737797619048
14826142559.7955357142954.2044642857144
14928822644.72886904762237.271130952381
15026712716.99553571429-45.9955357142857
15127612759.662202380951.33779761904765
15228062524.59553571429281.404464285714
15324142606.12886904762-192.128869047619
15426732715.46220238095-42.4622023809523
15527482613.06220238095134.937797619048
15621122372.52886904762-260.528869047619
15729032811.5279761904891.4720238095235
15826332579.9279761904853.0720238095239
15926842798.72797619048-114.727976190476
16028612539.26130952381321.738690476191
16125042624.19464285714-120.194642857143
16227082696.4613095238111.5386904761906
16329612739.12797619048221.872023809524
16425352504.0613095238130.9386904761905
16526882585.59464285714102.405357142857
16626992694.927976190484.07202380952389
16724692592.52797619048-123.527976190476
16825852351.99464285714233.005357142857
16925822790.99375-208.993750000000
17024802559.39375-79.3937499999999
17127092778.19375-69.1937499999999
17224412518.72708333333-77.7270833333332
17321822603.66041666667-421.660416666667
17425852675.92708333333-90.9270833333333
17528812718.59375162.40625
17624222483.52708333333-61.5270833333333
17726902565.06041666667124.939583333333
17826592674.39375-15.3937499999999
17925352571.99375-36.99375
18026132331.46041666667281.539583333333


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
160.4711131148518550.942226229703710.528886885148145
170.4067222547688370.8134445095376750.593277745231163
180.4278231283390370.8556462566780740.572176871660963
190.3287242253845150.657448450769030.671275774615485
200.2558711978150320.5117423956300640.744128802184968
210.1719404376586870.3438808753173730.828059562341313
220.1097880072533620.2195760145067250.890211992746638
230.1731580254572790.3463160509145570.826841974542721
240.1252610872183090.2505221744366180.874738912781691
250.08744441632395660.1748888326479130.912555583676043
260.05751434803003090.1150286960600620.94248565196997
270.280554027590190.561108055180380.71944597240981
280.3766916002581990.7533832005163990.623308399741801
290.4003016777007720.8006033554015430.599698322299228
300.3298463939030870.6596927878061740.670153606096913
310.3344872060982520.6689744121965040.665512793901748
320.453816902461580.907633804923160.54618309753842
330.4522083286797550.904416657359510.547791671320245
340.3853753570529960.7707507141059920.614624642947004
350.4542929088432790.9085858176865580.545707091156721
360.4136241077149390.8272482154298780.586375892285061
370.7837734885205430.4324530229589140.216226511479457
380.7627394245044480.4745211509911030.237260575495552
390.7288319733993850.5423360532012290.271168026600615
400.6790723740175460.6418552519649070.320927625982454
410.6455722209211960.7088555581576080.354427779078804
420.6134864308226260.7730271383547490.386513569177375
430.5630093032139060.8739813935721870.436990696786094
440.7113640439087180.5772719121825650.288635956091282
450.7015894215645550.596821156870890.298410578435445
460.6954032524243910.6091934951512190.304596747575609
470.6913209156042890.6173581687914230.308679084395711
480.8380222797509060.3239554404981880.161977720249094
490.8240108182570520.3519783634858950.175989181742948
500.8174466528703720.3651066942592570.182553347129628
510.8584531633028270.2830936733943470.141546836697173
520.8396998065406740.3206003869186520.160300193459326
530.8869536776064550.2260926447870890.113046322393544
540.9228192127276090.1543615745447820.077180787272391
550.9165457007159330.1669085985681340.083454299284067
560.9218205779403530.1563588441192950.0781794220596473
570.9125117248147840.1749765503704330.0874882751852163
580.9135135240306440.1729729519387120.0864864759693562
590.9109179496192320.1781641007615360.0890820503807679
600.936736306038940.1265273879221190.0632636939610596
610.9241047238609330.1517905522781340.075895276139067
620.9093118606020050.1813762787959890.0906881393979945
630.914806832708040.1703863345839210.0851931672919604
640.9130915580034330.1738168839931340.0869084419965668
650.9423440009978740.1153119980042520.0576559990021262
660.9435749491049550.1128501017900910.0564250508950455
670.9301226508728070.1397546982543860.0698773491271932
680.9351944151108180.1296111697783630.0648055848891815
690.919505035783160.1609899284336780.0804949642168391
700.9056257547205290.1887484905589430.0943742452794714
710.9111154275224780.1777691449550430.0888845724775216
720.8963710149556760.2072579700886470.103628985044324
730.932239533802040.1355209323959220.0677604661979608
740.9266989356491240.1466021287017530.0733010643508764
750.9282132337154920.1435735325690160.0717867662845078
760.9152390225364060.1695219549271870.0847609774635935
770.9599664367282530.0800671265434950.0400335632717475
780.9597364355333080.08052712893338340.0402635644666917
790.9626659762312230.0746680475375550.0373340237687775
800.9716283010657930.05674339786841440.0283716989342072
810.9722168063943150.05556638721137010.0277831936056850
820.9979844340897370.004031131820526720.00201556591026336
830.9990846127268460.001830774546308450.000915387273154224
840.9989219513366640.002156097326671420.00107804866333571
850.999532153182330.0009356936353386570.000467846817669329
860.9996373415108140.0007253169783727530.000362658489186376
870.9995915309582190.0008169380835627860.000408469041781393
880.999474584111620.001050831776758270.000525415888379134
890.999460354381040.001079291237919760.00053964561895988
900.9992936408345640.001412718330871450.000706359165435723
910.9991625951315180.00167480973696430.00083740486848215
920.9989052571537160.002189485692568510.00109474284628425
930.9987435729449870.002512854110025130.00125642705501256
940.9991986029413530.001602794117293950.000801397058646976
950.9990526052026750.001894789594649640.000947394797324819
960.9994412692509910.001117461498017230.000558730749008617
970.9994312421512430.001137515697513890.000568757848756944
980.999366702494050.001266595011898890.000633297505949446
990.999291939688980.001416120622040260.00070806031102013
1000.9990346877635820.001930624472836110.000965312236418057
1010.9989204073667530.002159185266493790.00107959263324690
1020.9985837726717430.002832454656514090.00141622732825705
1030.998285553400580.003428893198839570.00171444659941978
1040.9988724880279140.002255023944171380.00112751197208569
1050.9987010947090220.002597810581956890.00129890529097844
1060.99853729443730.002925411125398060.00146270556269903
1070.9986368241323120.00272635173537540.0013631758676877
1080.9980252097398970.003949580520206170.00197479026010308
1090.9982687524481190.003462495103763050.00173124755188152
1100.9977174877291710.004565024541657710.00228251227082885
1110.996721232174350.006557535651299550.00327876782564978
1120.995834383790290.008331232419419080.00416561620970954
1130.9987517975170730.002496404965853670.00124820248292684
1140.9981465938843270.003706812231346350.00185340611567317
1150.9976062667861720.004787466427655560.00239373321382778
1160.9967120558562090.006575888287582320.00328794414379116
1170.9958284453950370.008343109209926690.00417155460496334
1180.9962707197745280.007458560450943840.00372928022547192
1190.9946610263266840.01067794734663270.00533897367331633
1200.9950461336191240.009907732761751240.00495386638087562
1210.994667610563630.01066477887273890.00533238943636943
1220.9935937092559230.01281258148815480.0064062907440774
1230.990838971859040.01832205628192030.00916102814096015
1240.9920068545776910.0159862908446180.007993145422309
1250.9893446638097460.02131067238050800.0106553361902540
1260.9850723448983030.02985531020339460.0149276551016973
1270.983894724017740.03221055196452070.0161052759822603
1280.9782174465700730.04356510685985390.0217825534299270
1290.9704753035146750.0590493929706490.0295246964853245
1300.9760551447800820.04788971043983630.0239448552199181
1310.9669624224464860.06607515510702860.0330375775535143
1320.9623640634422830.07527187311543380.0376359365577169
1330.9499413949859020.1001172100281970.0500586050140984
1340.9334828168498730.1330343663002550.0665171831501274
1350.9139282719912830.1721434560174340.0860717280087172
1360.907677459135740.1846450817285200.0923225408642601
1370.9285464106263130.1429071787473740.0714535893736869
1380.9217751881512050.1564496236975900.0782248118487948
1390.959272389518130.08145522096374080.0407276104818704
1400.9443150723183580.1113698553632830.0556849276816416
1410.9390043922528620.1219912154942750.0609956077471376
1420.9265676056231280.1468647887537440.0734323943768718
1430.9015594109474550.1968811781050890.0984405890525447
1440.900439737950070.1991205240998590.0995602620499295
1450.8710074473506430.2579851052987130.128992552649357
1460.865454379937170.2690912401256580.134545620062829
1470.857195099042880.2856098019142410.142804900957120
1480.8206476199219420.3587047601561170.179352380078058
1490.9141194201866180.1717611596267650.0858805798133825
1500.8795307456974540.2409385086050920.120469254302546
1510.8644231128494180.2711537743011630.135576887150582
1520.8791520440808730.2416959118382530.120847955919127
1530.9052083175159660.1895833649680680.094791682484034
1540.867042862602550.2659142747949000.132957137397450
1550.8423028977179440.3153942045641120.157697102282056
1560.9944747323360280.01105053532794420.00552526766397211
1570.9940907241896030.01181855162079360.0059092758103968
1580.9873870068808170.02522598623836580.0126129931191829
1590.9789642572453770.04207148550924660.0210357427546233
1600.994805401253360.01038919749328010.00519459874664007
1610.9994588599008680.001082280198263110.000541140099131556
1620.9988309232038430.002338153592313980.00116907679615699
1630.9959819291826220.008036141634755820.00401807081737791
1640.9962901386817280.007419722636543310.00370986131827166


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level420.281879194630872NOK
5% type I error level570.38255033557047NOK
10% type I error level660.442953020134228NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/10iub41291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/10iub41291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/1m2dv1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/1m2dv1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/2m2dv1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/2m2dv1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/3fbcg1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/3fbcg1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/4fbcg1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/4fbcg1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/5fbcg1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/5fbcg1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/68kuj1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/68kuj1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/78kuj1291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/78kuj1291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/8iub41291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/8iub41291114246.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/9iub41291114246.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/30/t1291114182lynqj1vuqelvg67/9iub41291114246.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = 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