Home » date » 2010 » Dec » 02 »

WS 4: Toevoeging van een 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: Thu, 02 Dec 2010 17:54:13 +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/02/t1291312377zlinnjxxzag95h1.htm/, Retrieved Thu, 02 Dec 2010 18:53:08 +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/02/t1291312377zlinnjxxzag95h1.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 «
9 13 13 14 13 3 1 1 0 9 12 12 8 13 5 1 0 0 9 15 10 12 16 6 0 0 0 9 12 9 7 12 6 2 0 1 9 10 10 10 11 5 0 1 2 9 12 12 7 12 3 0 0 1 9 15 13 16 18 8 1 1 1 9 9 12 11 11 4 1 0 0 9 12 12 14 14 4 4 0 0 9 11 6 6 9 4 0 0 0 9 11 5 16 14 6 0 2 1 9 11 12 11 12 6 2 0 0 9 15 11 16 11 5 0 2 2 9 7 14 12 12 4 1 1 1 9 11 14 7 13 6 0 1 0 9 11 12 13 11 4 0 0 1 9 10 12 11 12 6 1 1 0 9 14 11 15 16 6 2 0 1 9 10 11 7 9 4 1 0 0 9 6 7 9 11 4 1 0 0 9 11 9 7 13 2 0 1 1 9 15 11 14 15 7 1 2 0 9 11 11 15 10 5 1 2 1 9 12 12 7 11 4 2 0 0 9 14 12 15 13 6 1 0 0 9 15 11 17 16 6 1 1 0 9 9 11 15 15 7 1 1 0 9 13 8 14 14 5 2 2 0 9 13 9 14 14 6 0 0 2 9 16 12 8 14 4 1 1 1 9 13 10 8 8 4 0 1 2 9 12 10 14 13 7 1 1 1 9 14 12 14 15 7 1 2 1 9 11 8 8 13 4 0 2 0 9 9 12 11 11 4 1 1 0 9 16 11 16 15 6 2 2 0 9 12 12 10 15 6 1 1 1 9 10 7 8 9 5 1 1 2 9 13 11 14 13 6 1 0 1 9 16 11 16 16 7 1 3 1 9 14 12 13 13 6 0 1 2 9 15 9 5 11 3 1 0 0 9 5 15 8 12 3 1 0 0 9 8 11 10 12 4 1 0 0 9 11 11 8 12 6 0 1 1 9 16 11 13 14 7 2 0 1 9 1 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 time11 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Popularity[t] = -0.983357375578792 + 0.0893813706555356month[t] + 0.104378264723487FindingFriends[t] + 0.211622867223575KnowingPeople[t] + 0.385193850989470Liked[t] + 0.594410135928509Celebrity[t] + 0.307649945898061bestfriend[t] -0.0324002150208811secondbestfriend[t] + 0.411552931191423thirdbestfriend[t] -0.00181007322403901t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-0.9833573755787926.011657-0.16360.8702920.435146
month0.08938137065553560.6408420.13950.8892670.444634
FindingFriends0.1043782647234870.0985591.0590.2913270.145664
KnowingPeople0.2116228672235750.064053.3040.0011996e-04
Liked0.3851938509894700.0990383.88940.0001527.6e-05
Celebrity0.5944101359285090.1569613.7870.0002220.000111
bestfriend0.3076499458980610.2119911.45120.1488590.074429
secondbestfriend-0.03240021502088110.20236-0.16010.8730140.436507
thirdbestfriend0.4115529311914230.2146121.91770.0571070.028553
t-0.001810073224039010.006864-0.26370.7923890.396194


Multiple Linear Regression - Regression Statistics
Multiple R0.719101919830673
R-squared0.51710757110416
Adjusted R-squared0.487340229596882
F-TEST (value)17.3716410307495
F-TEST (DF numerator)9
F-TEST (DF denominator)146
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.1026328891003
Sum Squared Residuals645.475499683636


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11311.20490267115811.79509732884189
21211.05019761674710.94980238325289
31513.12846422596931.87153577403075
41211.45023897093350.549761029066484
51010.9719246015601-0.97192460156013
6129.361223319074252.63877668092575
71516.9268608320424-1.92686083204242
8910.3094079411661-1.30940794116615
91213.0209978602754-1.02099786027543
10117.543366222382273.45663377761773
111113.0149485846245-2.01494858462453
121112.1838317170145-1.18383171701454
131512.29915926881192.70084073118813
14711.4832734656525-4.48327346565248
151111.2781603020676-0.278160302067564
161110.82207607511430.177923924885652
171011.8347311899754-1.83473118997540
181414.8674128169904-0.867412816990426
19108.5682397001051.43176029989501
2069.3425500044131-3.34255000441309
21118.779320926583292.22067907341672
221514.07376263467850.926237365321513
231111.5803388330651-0.580338833065076
24129.741605246585292.25839475341471
251413.08433613908770.915663860912256
261514.52457487353490.475425126465101
27914.3087353508027-5.30873535080275
281312.48340322421540.516596775784634
291313.4529879522718-0.452987952271807
301611.16945199770554.83054800229448
31138.751625274391044.24837472560896
321213.6248490819480-1.62484908194797
331414.5697830251290-0.569783025128966
34119.607901702815581.39209829718442
35910.2281357490962-1.22813574909621
361614.18490715395861.81509284604136
371213.1540413424309-1.15404134243088
38109.713073900468350.286926099531649
391313.1545469131956-0.154546913195559
401615.22877361825290.771226381747053
411413.11518493451990.884815065480128
42158.07058331810846.9294166818916
4359.71510528588548-4.71510528588548
44810.3134380241432-2.31343802414315
451111.1487052586015-0.148705258601461
461614.21750746621981.78249253378025
471714.24753084317852.75246915682147
4898.02879397139070.9712060286093
49911.3995874334900-2.39958743349003
501314.8178416598702-1.81784165987018
511010.8886453480061-0.888645348006098
52611.9910442211409-5.99104422114089
531211.84951904128590.150480958714054
54810.4331664434410-2.43316644344105
551411.80910639081632.19089360918366
561212.8761180336080-0.876118033608047
571111.1092335643711-0.109233564371141
581614.17475705960221.82524294039776
59810.2776291475077-2.27762914750773
601514.65754471011630.342455289883676
6179.15112059843979-2.15112059843979
621613.94641103452322.05358896547682
631412.91304739004521.08695260995478
641613.6614142093312.338585790669
65910.2507224958308-1.25072249583076
661412.38949858308011.61050141691992
671113.2954002601194-2.29540026011941
681310.42329743640302.57670256359698
691513.01758105458811.98241894541193
7055.82162779891743-0.821627798917435
711512.9383483059032.061651694097
721311.97378755277511.02621244722486
731113.0575037847135-2.05750378471349
741114.1346593713084-3.13465937130841
751212.2462910576543-0.246291057654347
761213.4605564914878-1.46055649148783
771212.8158509750580-0.81585097505803
781212.1256704010635-0.125670401063508
791411.09863701011072.90136298988934
8068.02152943171598-2.02152943171598
8179.46530618764306-2.46530618764306
821412.63028677016221.36971322983782
831414.0434433176965-0.0434433176964516
841010.9996709892448-0.999670989244844
85139.395760077086323.60423992291368
861212.4552688010383-0.455268801038252
8799.09895259471804-0.0989525947180386
881212.3827335866523-0.382733586652303
891615.11263259648510.887367403514898
901010.8271360363588-0.827136036358803
911413.01494141406290.985058585937127
921013.6743590227115-3.67435902271151
931615.01894942685980.98105057314016
941513.32693852593841.67306147406163
951211.49569137969530.504308620304676
96109.296984320537470.703015679462536
97810.2975523598291-2.29755235982907
9888.4817653155485-0.4817653155485
991112.5542135160764-1.55421351607642
1001313.0145764114289-0.0145764114288983
1011615.89571675069890.104283249301138
1021615.18984535676170.81015464323831
1031415.6944063024031-1.69440630240307
104118.994008885848432.00599111415157
10547.37063441742283-3.37063441742284
1061414.6930170629043-0.69301706290434
107910.5659658154158-1.56596581541582
1081415.2574638574311-1.25746385743105
109810.0167137756442-2.01671377564416
110810.4697500279441-2.46975002794406
1111111.9652097964192-0.965209796419187
1121213.1931382162864-1.19313821628645
1131111.0137981823412-0.0137981823411839
1141413.01971279941670.980287200583345
1151514.40118373768310.598816262316856
1161613.35344329627532.64655670372468
1171612.87311181099953.12688818900047
1181112.6472019672902-1.64720196729016
1191413.36306660288290.63693339711708
1201410.99614951011693.00385048988306
1211211.55541432287830.444585677121667
1221413.05278987026980.947210129730188
123810.8065061752171-2.80650617521711
1241314.2747980236383-1.27479802363834
1251614.50865984660981.49134015339024
1261210.56942807826611.43057192173394
1271615.84107187558260.158928124417362
1281212.6796300217692-0.6796300217692
1291111.2682259994715-0.26822599947148
13045.69832608065275-1.69832608065275
1311616.0766810985428-0.0766810985427819
1321513.06389867075971.93610132924026
1331011.1235806511745-1.12358065117449
1341314.2784553749570-1.27845537495702
1351512.56410719570152.43589280429851
1361210.17419174575751.82580825424246
1371412.84695430395621.15304569604381
138710.3775092422047-3.37750924220472
1391913.70535664916095.29464335083911
1401213.0227660694378-1.02276606943781
1411211.88217334639780.117826653602175
1421313.2070126965691-0.207012696569090
1431512.40761733729642.59238266270357
14488.9046262949945-0.904626294994503
1451211.12112704607510.878872953924872
1461010.3911752139798-0.391175213979777
147811.2623122209065-3.26231222090646
1481014.2774505151922-4.27745051519218
1491514.16090976054150.839090239458515
1501613.96414778300562.03585221699443
1511313.1799642692192-0.179964269219202
1521614.96907963006441.03092036993557
15399.6862486002568-0.6862486002568
1541413.27853356589490.721466434105089
1551413.33556860094170.664431399058298
156129.960881276030942.03911872396906


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
130.8360017920639080.3279964158721840.163998207936092
140.901958394078540.1960832118429210.0980416059214603
150.8792405576445190.2415188847109610.120759442355481
160.8086167936731950.382766412653610.191383206326805
170.7265851617577060.5468296764845890.273414838242294
180.6667970381310560.6664059237378870.333202961868944
190.6079103465340510.7841793069318980.392089653465949
200.7021283567818560.5957432864362890.297871643218144
210.694192286731520.611615426536960.30580771326848
220.7453161201656740.5093677596686520.254683879834326
230.6834184238435540.6331631523128920.316581576156446
240.7077771320386890.5844457359226220.292222867961311
250.6845357751627270.6309284496745460.315464224837273
260.6260797639906050.747840472018790.373920236009395
270.8061671630168050.387665673966390.193832836983195
280.7709756533203480.4580486933593040.229024346679652
290.7170351166570270.5659297666859450.282964883342973
300.8186239096800470.3627521806399070.181376090319953
310.8601566196548280.2796867606903430.139843380345172
320.8296662109924670.3406675780150670.170333789007533
330.7873125932527150.4253748134945710.212687406747285
340.7549054105990890.4901891788018220.245094589400911
350.736412067999250.52717586400150.26358793200075
360.756719463465380.4865610730692400.243280536534620
370.7400780364288230.5198439271423540.259921963571177
380.6964621888116210.6070756223767580.303537811188379
390.6463023439943410.7073953120113170.353697656005659
400.6025816866541130.7948366266917740.397418313345887
410.5526456395378220.8947087209243560.447354360462178
420.843176300736540.3136473985269200.156823699263460
430.9708149181968720.05837016360625550.0291850818031278
440.9717544762045280.05649104759094330.0282455237954716
450.963116069055830.07376786188833890.0368839309441695
460.9686958461038130.06260830779237360.0313041538961868
470.9750191368960970.04996172620780630.0249808631039031
480.9715922006109860.05681559877802780.0284077993890139
490.9680591305216810.06388173895663760.0319408694783188
500.9594327589301220.08113448213975650.0405672410698782
510.9527291428159770.09454171436804630.0472708571840232
520.989272727210280.02145454557943960.0107272727897198
530.98580342590630.02839314818739830.0141965740936991
540.9891549151957050.02169016960858930.0108450848042947
550.9927678910020530.01446421799589430.00723210899794713
560.9902117190816380.01957656183672420.0097882809183621
570.9865131544645910.02697369107081800.0134868455354090
580.9858478311767550.02830433764648930.0141521688232447
590.9890595788110890.02188084237782300.0109404211889115
600.9878590335761450.02428193284771090.0121409664238554
610.9877983317135950.02440333657281040.0122016682864052
620.989447218573090.02110556285381850.0105527814269092
630.9878855753545760.02422884929084790.0121144246454240
640.9882874413655620.02342511726887570.0117125586344379
650.987659898327960.02468020334407930.0123401016720396
660.9856703082117070.02865938357658670.0143296917882934
670.9873147163489450.02537056730210980.0126852836510549
680.988869906293760.02226018741247770.0111300937062389
690.988298091441910.02340381711618070.0117019085580904
700.9850823550256860.02983528994862860.0149176449743143
710.9855569406129770.02888611877404670.0144430593870233
720.9821643168462680.03567136630746350.0178356831537317
730.9824987923777140.03500241524457220.0175012076222861
740.9874030103962650.02519397920747010.0125969896037350
750.9833495355852780.03330092882944380.0166504644147219
760.9801562422371860.03968751552562730.0198437577628136
770.9742931165743880.05141376685122350.0257068834256118
780.966661732462630.06667653507474120.0333382675373706
790.9756401282116540.04871974357669180.0243598717883459
800.97399429858950.05201140282099980.0260057014104999
810.9749669441903630.05006611161927410.0250330558096371
820.9729834829159950.05403303416800980.0270165170840049
830.9644489453169550.07110210936609030.0355510546830452
840.9552105811569710.08957883768605760.0447894188430288
850.981998073761220.03600385247755820.0180019262387791
860.9760140750782780.04797184984344420.0239859249217221
870.9687225114776140.06255497704477160.0312774885223858
880.9597489503999030.08050209920019470.0402510496000973
890.951008179153530.0979836416929410.0489918208464705
900.9384758045615820.1230483908768360.0615241954384181
910.9306311776964690.1387376446070620.0693688223035308
920.9547720784722720.09045584305545580.0452279215277279
930.945151260319080.1096974793618400.0548487396809199
940.9434307560432380.1131384879135240.056569243956762
950.9320031673230580.1359936653538840.067996832676942
960.9197028008542970.1605943982914050.0802971991457026
970.9127613963768920.1744772072462150.0872386036231077
980.8944599622838110.2110800754323780.105540037716189
990.8789282253723880.2421435492552240.121071774627612
1000.8530227067171310.2939545865657370.146977293282869
1010.8222658893142340.3554682213715310.177734110685766
1020.7957130232207190.4085739535585620.204286976779281
1030.8081798667721190.3836402664557630.191820133227881
1040.8644358748211280.2711282503577450.135564125178872
1050.8618593918989080.2762812162021840.138140608101092
1060.8298872560317040.3402254879365930.170112743968296
1070.7974678520633550.405064295873290.202532147936645
1080.7836563727571280.4326872544857450.216343627242872
1090.7648546255359240.4702907489281530.235145374464076
1100.7841433090689460.4317133818621080.215856690931054
1110.7690453858734060.4619092282531870.230954614126594
1120.8343242561006160.3313514877987690.165675743899384
1130.7972502037923040.4054995924153920.202749796207696
1140.7663321627394730.4673356745210530.233667837260527
1150.7229761302440690.5540477395118620.277023869755931
1160.732170131757850.5356597364842990.267829868242150
1170.7443748227326770.5112503545346470.255625177267323
1180.7256229710673910.5487540578652180.274377028932609
1190.675379918339690.649240163320620.32462008166031
1200.771318547410680.4573629051786410.228681452589320
1210.7409583544455080.5180832911089850.259041645554492
1220.6882524185663690.6234951628672620.311747581433631
1230.6743283621109530.6513432757780930.325671637889046
1240.6314835368724560.7370329262550880.368516463127544
1250.6121768779478870.7756462441042260.387823122052113
1260.6125528192807930.7748943614384140.387447180719207
1270.546035670759180.907928658481640.45396432924082
1280.504878729170790.990242541658420.49512127082921
1290.4829941377381180.9659882754762370.517005862261882
1300.4650092500288740.9300185000577480.534990749971126
1310.3929231015754660.7858462031509320.607076898424534
1320.3714622525341470.7429245050682940.628537747465853
1330.3256673343316130.6513346686632260.674332665668387
1340.2813238243717270.5626476487434550.718676175628273
1350.2375461515696080.4750923031392150.762453848430392
1360.2190691513409920.4381383026819840.780930848659008
1370.1843066889337090.3686133778674190.81569331106629
1380.1975809082023620.3951618164047240.802419091797638
1390.6160697450689150.767860509862170.383930254931085
1400.5261505179104360.9476989641791270.473849482089564
1410.4055698626061720.8111397252123440.594430137393828
1420.4008516816240130.8017033632480250.599148318375987
1430.2780890056171930.5561780112343870.721910994382807


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level290.221374045801527NOK
10% type I error level480.366412213740458NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/10g6ns1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/10g6ns1291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/1a5qh1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/1a5qh1291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/2kepj1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/2kepj1291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/3kepj1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/3kepj1291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/4kepj1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/4kepj1291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/5vn651291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/5vn651291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/6vn651291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/6vn651291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/7oxo81291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/7oxo81291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/8oxo81291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/8oxo81291312441.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/9g6ns1291312441.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291312377zlinnjxxzag95h1/9g6ns1291312441.ps (open in new window)


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