Home » date » 2010 » Nov » 24 »

Workshop 7 Linear Trend

*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, 24 Nov 2010 01:12:17 +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/24/t1290561056c6tb2x4fr8pe7s8.htm/, Retrieved Wed, 24 Nov 2010 02:11:07 +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/24/t1290561056c6tb2x4fr8pe7s8.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 «
14 12 53 18 11 86 11 14 66 12 12 67 16 21 76 18 12 78 14 22 53 14 11 80 15 10 74 15 13 76 17 10 79 19 8 54 10 15 67 16 14 54 18 10 87 14 14 58 14 14 75 17 11 88 14 10 64 16 13 57 18 7 66 11 14 68 14 12 54 12 14 56 17 11 86 9 9 80 16 11 76 14 15 69 15 14 78 11 13 67 16 9 80 13 15 54 17 10 71 15 11 84 14 13 74 16 8 71 9 20 63 15 12 71 17 10 76 13 10 69 15 9 74 16 14 75 16 8 54 12 14 52 12 11 69 11 13 68 15 9 65 15 11 75 17 15 74 13 11 75 16 10 72 14 14 67 11 18 63 12 14 62 12 11 63 15 12 76 16 13 74 15 9 67 12 10 73 12 15 70 8 20 53 13 12 77 11 12 77 14 14 52 15 13 54 10 11 80 11 17 66 12 12 73 15 13 63 15 14 69 14 13 67 16 15 54 15 13 81 15 10 69 13 11 84 12 19 80 17 13 70 13 17 69 15 13 77 13 9 54 15 11 79 16 10 30 15 9 71 16 12 73 15 12 72 14 13 77 15 13 75 14 12 69 13 15 54 7 22 70 17 13 73 13 15 54 15 13 77 14 15 82 13 10 80 16 11 80 12 16 69 14 11 78 17 11 81 15 10 76 17 10 76 12 16 73 16 12 85 11 11 66 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time10 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Belonging[t] = + 62.5511357635815 + 0.925603289655825Happiness[t] -0.635347076551754Depression[t] + 0.0414054045932947t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)62.55113576358158.561797.305800
Happiness0.9256032896558250.4051432.28460.0236650.011833
Depression-0.6353470765517540.300117-2.1170.0358260.017913
t0.04140540459329470.0170812.42410.0164740.008237


Multiple Linear Regression - Regression Statistics
Multiple R0.365747082062413
R-squared0.133770928037170
Adjusted R-squared0.117323540594837
F-TEST (value)8.13326301859167
F-TEST (DF numerator)3
F-TEST (DF denominator)158
p-value4.53014548817965e-05
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation10.0746625058079
Sum Squared Residuals16036.8142877371


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
15367.9268223047357-14.9268223047357
28672.305987944503713.6940120554963
36663.9621290918512.03787090814907
46766.19983193920350.800168060796447
57664.225526813454411.7744731865457
67871.83626248632516.16373751367492
75361.8217839667775-8.82178396677753
88068.852007213440111.1479927865599
97470.4543629842413.545637015759
107668.5897271591797.41027284082097
117972.38838037273926.61161962726076
125475.5516865097477-21.5516865097477
136762.81523277157634.18476722842372
145469.0456049906563-15.0456049906563
158773.479605280768213.5203947192318
165867.2772092205312-9.27720922053122
177567.31861462512457.68138537487549
188872.042871128340615.9571288716595
196469.9428137405181-5.94281374051812
205769.9293844947678-12.9293844947678
216675.6340789379833-9.63407893798327
226864.74883177912353.25116822087649
235468.8377412057878-14.8377412057878
245665.7572458779659-9.75724587796593
258672.332708960493613.6672910395064
268066.239982200943813.7600177990562
277671.48991648002444.51008351997563
286967.1387269990991.86127300090100
297868.74108276989999.25891723010012
306765.71542209242161.28457790757837
318072.92623225150117.07376774849894
325466.3787453278164-12.3787453278164
337173.2992992737917-2.29929927379172
348470.854151022521613.1458489774784
357468.69925898435565.30074101564443
367173.7686063510193-2.76860635101929
376359.70662380940083.29337619059924
387170.3844255643430.615574435656963
397673.54773170135152.45226829864851
406969.8867239473215-0.886723947321485
417472.41468300777821.58531699222182
427570.20495631926854.79504368073147
435474.0584441831724-20.0584441831724
445266.5853539698318-14.5853539698318
456968.53280060408040.467199395919621
466866.37790856591431.62209143408566
476572.663115435338-7.66311543533795
487571.43382668682773.56617331317226
497470.78505036452573.21494963547433
507569.66543091670275.33456908329732
517273.1189932668152-1.11899326681520
526768.7678037858898-1.76780378588983
536363.4910110153086-0.491011015308632
546266.9994080157648-4.99940801576477
556368.9468546500133-5.94685465001333
567671.12972284702234.87027715297766
577471.46138446471972.53861553528029
586773.1185748858642-6.11857488586419
597369.74782334493833.25217665506174
607066.61249336677283.38750663322722
615359.774750229984-6.774750229984
627769.52694869527057.47305130472954
637767.71714752055219.2828524794479
645269.2646686410094-17.2646686410094
655470.8670244118102-16.8670244118102
668067.551107521227912.4488924787721
676664.70603375616651.29396624383349
687368.84977783317444.1502221668256
696371.0326460301834-8.03264603018342
706970.438704358225-1.43870435822496
716770.1898535497142-3.18985354971418
725470.8117713805156-16.8117713805156
738171.19826764855669.8017323514434
746973.1457142828052-4.14571428280516
758470.70056603153513.2994339684650
768064.733591534058515.2664084659415
777073.2150958462414-3.21509584624143
786967.01269978600441.98730021399560
797771.44670007611645.55329992388364
805472.178287207605-18.1782872076050
817972.80020503840656.19979496159354
823074.4025608092073-44.4025608092073
837174.1537100006966-3.15371000069656
847373.2146774652904-0.214677465290417
857272.3304795802279-0.330479580227887
867770.81093461861366.1890653813864
877571.77794331286273.22205668713728
886971.529092504352-2.52909250435195
895468.7388533896342-14.7388533896342
907058.779209520430211.2207904795698
917373.7947715105475-0.794771510547551
925468.863069603414-14.8630696034140
937772.02637574042254.97362425957751
948269.871483702256512.1285162977435
958072.16402119995277.8359788000473
968074.34688939696175.65311060303829
976967.5091462601731.49085373982707
987872.57849362683665.42150637316335
998175.39670890039745.60329109960258
1007674.22225480223081.77774519776918
1017676.1148667861358-0.114866786135760
1027367.71617328313945.2838267168606
1038574.00138015256310.9986198474370
1046670.0501161854289-4.05011618542894
1057970.61719936588688.38280063411324
1066863.19894380288984.80105619711015
1077674.8023488474881.19765115251205
1087170.74141557966670.258584420333352
1095466.7901516125326-12.7901516125326
1104661.11343332816-15.1134333281601
1118272.136325946559.86367405344996
1127467.83997111596836.16002888403172
1138872.273971406080215.7260285939198
1143870.6995917941223-32.6995917941223
1157676.3494515869942-0.349451586994203
1168675.810344565379410.1896554346206
1175471.459155084454-17.459155084454
1187072.135907565599-2.13590756559903
1196974.7187012763993-5.71870127639934
1209070.948024221682119.0519757783179
1215469.1382230469638-15.1382230469638
1227671.66618210742054.33381789257954
1238974.539232031324814.4607679686752
1247676.4866786655734-0.486678665573397
1257374.6220428405114-1.62204284051143
1267972.8122416657936.18775833420693
1279078.46210145866511.5378985413351
1287477.2328127101547-3.23281271015472
1298178.4900776175082.50992238249209
1307273.5583757103744-1.55837571037439
1317173.0192686887596-2.01926868875955
1326663.64013724576382.35986275423625
1337775.58863315380951.41136684619046
1346572.453303175644-7.45330317564406
1357474.4007498098926-0.400749809892622
1368274.09706435103827.90293564896177
1375463.7923296183866-9.79232961838661
1386372.3286685809132-9.32866858091317
1395468.3225699634355-14.3225699634355
1406475.2431239094109-11.2431239094108
1416972.7979756581407-3.79797565814074
1425475.9612817951492-21.9612817951492
1438474.38690218319139.6130978168087
1448673.847795161576412.1522048384236
1457774.81480385582562.18519614417443
1468976.417159626626412.5828403733736
1477675.8232179546680.176782045332018
1486070.6012598344304-10.6012598344304
1497572.8389626817832.16103731821697
1507365.02078160499487.97921839500519
1518575.98883957304129.01116042695884
1527970.07669972590828.9233002740918
1537177.977691611883-6.97769161188301
1547272.4106426281977-0.410642628197746
1556965.22780862796133.77219137203871
1567869.60697426772968.39302573227036
1575471.5544209019782-17.5544209019782
1586973.156776672779-4.15677667277907
1598179.73223975530681.26776024469325
1608475.49071957506868.5092804249314
1618468.888398001040315.1116019989597
1626971.1261008483929-2.12610084839291


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.8024433797260210.3951132405479580.197556620273979
80.7033007516472510.5933984967054980.296699248352749
90.6134899153578810.7730201692842380.386510084642119
100.4882290159453170.9764580318906350.511770984054682
110.3970353948029890.7940707896059770.602964605197011
120.8808225881991030.2383548236017940.119177411800897
130.8334817910932880.3330364178134250.166518208906712
140.8582273724224620.2835452551550750.141772627577538
150.8971655564351360.2056688871297290.102834443564864
160.8763037429462260.2473925141075480.123696257053774
170.86310817628730.2737836474254000.136891823712700
180.893287105440780.2134257891184410.106712894559221
190.8712970967977060.2574058064045880.128702903202294
200.883600213604240.2327995727915190.116399786395760
210.8661365716403350.2677268567193310.133863428359665
220.8383723689426210.3232552621147570.161627631057379
230.8462492371929240.3075015256141520.153750762807076
240.8151912321053910.3696175357892170.184808767894609
250.8730137651617250.253972469676550.126986234838275
260.9063894831207410.1872210337585180.0936105168792588
270.8852559250711090.2294881498577820.114744074928891
280.85462334340180.2907533131964000.145376656598200
290.8456628948713250.308674210257350.154337105128675
300.8074989018873990.3850021962252030.192501098112601
310.7793154656095140.4413690687809730.220684534390486
320.7969647911721180.4060704176557640.203035208827882
330.7557834493221460.4884331013557080.244216550677854
340.7776593302788030.4446813394423930.222340669721197
350.7428002149917390.5143995700165220.257199785008261
360.7040095056564410.5919809886871180.295990494343559
370.6590569437496760.6818861125006470.340943056250324
380.6078661427961600.7842677144076790.392133857203839
390.5567536109920370.8864927780159260.443246389007963
400.5054160773288990.9891678453422010.494583922671101
410.4529433712129640.9058867424259280.547056628787036
420.4104836393640090.8209672787280180.589516360635991
430.5644910114228970.8710179771542060.435508988577103
440.6052838276639620.7894323446720760.394716172336038
450.5560414015176540.8879171969646910.443958598482345
460.5084062118674660.9831875762650680.491593788132534
470.4766422965008980.9532845930017950.523357703499102
480.4383084685797770.8766169371595530.561691531420223
490.3978315857555510.7956631715111010.602168414244449
500.3682600853031060.7365201706062120.631739914696894
510.3219539245161780.6439078490323570.678046075483822
520.2788268940143550.557653788028710.721173105985645
530.2385705761197910.4771411522395810.761429423880209
540.2074135983134840.4148271966269670.792586401686516
550.1808609221192650.361721844238530.819139077880735
560.1612649874552460.3225299749104930.838735012544754
570.1363887947017910.2727775894035830.863611205298209
580.1171354042253410.2342708084506820.88286459577466
590.09936827122331820.1987365424466360.900631728776682
600.08313791288286460.1662758257657290.916862087117135
610.07181609952081430.1436321990416290.928183900479186
620.06762215238921360.1352443047784270.932377847610786
630.06828341371537510.1365668274307500.931716586284625
640.09913521822980160.1982704364596030.900864781770198
650.1295674824545440.2591349649090890.870432517545455
660.1508532622176740.3017065244353490.849146737782326
670.1268281315668060.2536562631336110.873171868433194
680.1102634985468170.2205269970936340.889736501453183
690.09757087824633240.1951417564926650.902429121753668
700.07910220083872030.1582044016774410.92089779916128
710.06364306294753520.1272861258950700.936356937052465
720.08224682975728930.1644936595145790.91775317024271
730.08994202237744420.1798840447548880.910057977622556
740.07362580226877880.1472516045375580.926374197731221
750.09422194788908440.1884438957781690.905778052110916
760.1323318370514490.2646636741028980.867668162948551
770.1102010969230000.2204021938460000.889798903077
780.09178540291643820.1835708058328760.908214597083562
790.08178288463929380.1635657692785880.918217115360706
800.1174190687448220.2348381374896430.882580931255178
810.1077857927902940.2155715855805890.892214207209706
820.7602188984849370.4795622030301270.239781101515063
830.727861241752850.5442775164943010.272138758247151
840.6924430865159340.6151138269681320.307556913484066
850.6539162952585840.6921674094828320.346083704741416
860.6327113898683690.7345772202632620.367288610131631
870.5971210464886710.8057579070226570.402878953511329
880.5549896399725160.8900207200549680.445010360027484
890.6005479786391250.798904042721750.399452021360875
900.6221965334220490.7556069331559020.377803466577951
910.5829956678992790.8340086642014410.417004332100721
920.631381018234940.7372379635301210.368618981765061
930.6018388654593680.7963222690812650.398161134540632
940.6251809272779110.7496381454441780.374819072722089
950.6119949160053160.7760101679893680.388005083994684
960.5834448666475810.8331102667048380.416555133352419
970.5395759860178410.9208480279643190.460424013982159
980.5092164749331970.9815670501336060.490783525066803
990.4780664564747990.9561329129495980.521933543525201
1000.43382668040410.86765336080820.5661733195959
1010.3896215128406650.779243025681330.610378487159335
1020.3618632008104260.7237264016208530.638136799189574
1030.3712731431648010.7425462863296020.628726856835199
1040.3305962666439710.6611925332879430.669403733356029
1050.3221089103599290.6442178207198580.677891089640071
1060.3084249747122690.6168499494245380.69157502528773
1070.2688343196943550.537668639388710.731165680305645
1080.2322825313976080.4645650627952160.767717468602392
1090.2352331350171280.4704662700342570.764766864982872
1100.2566403531182960.5132807062365920.743359646881704
1110.2600124914523820.5200249829047640.739987508547618
1120.2475000509324710.4950001018649420.752499949067529
1130.3394703724299480.6789407448598960.660529627570052
1140.7397038347774330.5205923304451340.260296165222567
1150.6984686137229720.6030627725540560.301531386277028
1160.7057345568148490.5885308863703020.294265443185151
1170.7835501065421420.4328997869157160.216449893457858
1180.7443291901831520.5113416196336950.255670809816848
1190.7091693071760970.5816613856478060.290830692823903
1200.821070927467930.3578581450641390.178929072532069
1210.8543053343815230.2913893312369540.145694665618477
1220.8274935273875980.3450129452248050.172506472612402
1230.8741505812614650.251698837477070.125849418738535
1240.8433810244261160.3132379511477680.156618975573884
1250.8066509764826380.3866980470347230.193349023517362
1260.802268202457160.3954635950856790.197731797542839
1270.8463708892342560.3072582215314870.153629110765744
1280.8091405017931480.3817189964137050.190859498206852
1290.771879622631160.4562407547376810.228120377368840
1300.7253170442323620.5493659115352760.274682955767638
1310.6806593230580170.6386813538839650.319340676941983
1320.6526598781063780.6946802437872430.347340121893622
1330.6239945005282430.7520109989435140.376005499471757
1340.5769696879098470.8460606241803070.423030312090153
1350.5233303802135420.9533392395729160.476669619786458
1360.5347515468615620.9304969062768760.465248453138438
1370.5219257760826150.956148447834770.478074223917385
1380.4850893625846280.9701787251692560.514910637415372
1390.5348928345568010.9302143308863970.465107165443199
1400.534715568880030.930568862239940.46528443111997
1410.4691142324576090.9382284649152180.530885767542391
1420.7853157539880750.4293684920238500.214684246011925
1430.7308294855794930.5383410288410130.269170514420506
1440.7238292352515030.5523415294969930.276170764748497
1450.6497016253526850.700596749294630.350298374647315
1460.6845164090364490.6309671819271020.315483590963551
1470.5992997366105470.8014005267789060.400700263389453
1480.6302944575731920.7394110848536160.369705542426808
1490.534190199015720.931619601968560.46580980098428
1500.4394035811490580.8788071622981160.560596418850942
1510.4282538734069060.8565077468138120.571746126593094
1520.4214114523832390.8428229047664770.578588547616761
1530.3045199567814880.6090399135629750.695480043218512
1540.2018870944254430.4037741888508860.798112905574557
1550.1212999360064690.2425998720129380.878700063993531


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 level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/101n791290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/101n791290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/1v4ax1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/1v4ax1290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/2v4ax1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/2v4ax1290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/35vr01290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/35vr01290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/45vr01290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/45vr01290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/55vr01290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/55vr01290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/63qfr1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/63qfr1290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/7rwqo1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/7rwqo1290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/8rwqo1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/8rwqo1290561126.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/9rwqo1290561126.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290561056c6tb2x4fr8pe7s8/9rwqo1290561126.ps (open in new window)


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