Home » date » 2010 » Nov » 23 »

Workshop 7 Multiple Lineair Regression 1

*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, 23 Nov 2010 11:23:19 +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/23/t12905114317cldyhux11ycpmj.htm/, Retrieved Tue, 23 Nov 2010 12:23:51 +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/23/t12905114317cldyhux11ycpmj.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
5,5 6 5,33 12 3,5 4 5,56 11 8,5 4 3,78 14 5 4 4,00 12 6 4,5 4,00 21 6 3,5 3,56 12 5,5 2 4,44 22 5,5 5,5 3,56 11 6 3,5 4,00 10 6,5 3,5 3,78 13 7 6 5,11 10 8 5 6,67 8 5,5 5 5,11 15 5 4 4,00 14 5,5 4 3,33 10 7,5 2 2,67 14 4,5 4,5 4,67 14 5,5 4 3,33 11 8,5 3,5 4,44 10 8,5 5,5 6,89 13 5,5 4,5 6,00 7 9 5,5 7,56 14 7 6,5 4,67 12 5 4 6,89 14 5,5 4 4,22 11 7,5 4,5 3,56 9 7,5 3 4,44 11 6,5 4,5 4,67 15 8 4,5 4,89 14 6,5 3 3,78 13 4,5 3 5,33 9 9 8 5,56 15 9 2,5 5,78 10 6 3,5 5,56 11 8,5 4,5 3,78 13 4,5 3 7,11 8 4,5 3 7,33 20 6 2,5 2,89 12 9 6 7,11 10 6 3,5 5,56 10 9 5 6,44 9 7 4,5 4,89 14 7,5 4 4,00 8 8 2,5 3,78 14 5 4 4,44 11 5,5 4 3,33 13 7 5 4,44 9 4,5 3 7,33 11 6 4 6,44 15 8,5 3,5 5,11 11 2,5 2 5,78 10 6 4 4,00 14 6 4 4,44 18 3 2 2,44 14 12 10 6,22 11 6 4 5,78 12 6 4 4,89 13 7 3 3,78 9 3,5 2 2,67 10 6,5 4 3,11 15 6 4,5 3,78 20 6,5 3 4,67 12 7 3,5 4,22 12 4 4,5 4,00 14 5,5 2,5 2,22 13 4,5 2,5 6,44 11 5,5 4 6,89 17 6,5 4 4,22 12 5 3 2,00 13 5,5 4 4,44 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 time9 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Depression[t] = + 14.1670937733770 -0.00374346986010154Expect[t] -0.0356071628680679Criticism[t] -0.230056642873884Concerns[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)14.16709377337701.19413411.863900
Expect-0.003743469860101540.184582-0.02030.9838450.491923
Criticism-0.03560716286806790.233426-0.15250.8789580.439479
Concerns-0.2300566428738840.211821-1.08610.2791250.139562


Multiple Linear Regression - Regression Statistics
Multiple R0.0996858428771909
R-squared0.00993726727013599
Adjusted R-squared-0.0092252372343129
F-TEST (value)0.518578731074993
F-TEST (DF numerator)3
F-TEST (DF denominator)155
p-value0.67010300974329
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.15987814050084
Sum Squared Residuals1547.64862873633


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11212.7066598054202-0.706659805420193
21112.7324480430155-1.73244804301554
31413.12323151803050.876768481969457
41213.0857212011086-1.08572120110864
52113.06417414981457.9358258501855
61213.2010062355471-1.20100623554709
72213.05383886905028.94616113094978
81113.131663644741-2.131663644741
91013.0997813126826-3.09978131268258
101313.1485220391848-0.14852203918478
111012.7516570620623-2.75165706206229
12812.424632392187-4.424632392187
131512.79287942972052.20712057027949
141413.08572120110860.914278798891356
151013.2379874169041-3.23798741690409
161413.45355218721680.546447812783209
171412.91565140387921.08434859612084
181113.2379874169041-2.23798741690409
191012.9891977151678-2.98919771516781
201312.35434461439070.645655385609337
21712.6059325989968-5.60593259899679
221412.19833492873511.80166507126489
231212.8350784034928-0.835078403492769
241412.42085750320311.57914249679688
251113.0332370047463-2.03323700474634
26913.1597838678889-4.15978386788886
271113.0107447664619-2.01074476646195
281512.90816446415902.09183553584104
291412.85193679793651.14806320206345
301313.1663256206188-0.166325620618814
31912.8172247638845-3.8172247638845
321512.56943030731272.43056969268729
331012.7146572416548-2.71465724165483
341112.7408929497993-1.74089294979932
351313.1054279365965-0.105427936596509
36812.4077239395690-4.40772393956898
372012.35711147813677.64288852186327
381213.3907513491407-1.39075134914066
391012.2840568365943-2.28405683659432
401012.7408929497993-2.74089294979932
41912.4738019501879-3.47380195018789
421412.85568026779671.14431973220335
43813.0763625264584-5.07636252645839
441413.17851399726270.821486002737304
451112.9844962782441-1.98449627824413
461313.2379874169041-0.237987416904095
47912.9414021756559-3.94140217565586
481112.3571114781367-1.35711147813673
491512.52063952263632.47936047736373
501112.8350597644423-1.83505976444231
511012.7567933771795-2.75679337717952
521413.08197773124850.918022268751458
531812.98075280838405.01924719161597
541413.52331082944820.476689170551759
551112.3351481876995-1.33514818769950
561212.6724769069330-0.672476906933029
571312.87722731909080.122772680909214
58913.1644538856888-4.16445388568876
591013.4685260666572-3.4685260666572
601513.28485640847621.71514359152375
612013.11478661124686.88521338875324
621212.9615752084611-0.961575208461058
631213.0454253813902-1.04542538139022
641413.07166108953470.928338910465289
651313.5467610347962-0.546761034796208
661112.5796654717285-1.57966547172852
671712.41898576827314.58101423172693
681213.0294935348862-1.02949353488624
691313.5814416497245-0.581441649724479
701412.98262454331411.01737545668592
711312.58905556550260.410944434497445
721513.05478405604051.94521594395953
731312.44430770855110.555692291448913
741012.4559983687539-2.45599836875386
751112.7024688650109-1.70246886501094
761912.82661485765856.17338514234147
771313.3710760327766-0.371076032776571
781712.90629272922894.09370727077110
791313.0351087396764-0.0351087396763895
80912.6049874120065-3.60498741200654
811112.7891359598604-1.78913595986041
821013.0838494661786-3.08384946617859
83912.925968045593-3.92596804559299
841212.9376587057958-0.937658705795762
851212.8875125416808-0.887512541680836
861312.93815642223690.0618435777631288
871312.98312225975520.0168777402448070
881213.2417308867642-1.24173088676420
891512.45694355574412.54305644425589
902213.04916885125038.95083114874968
911312.66873343707290.331266562927072
921513.53457265815231.46542734184767
931313.2422286032053-0.242228603205305
941512.90721927716872.0927807228313
951012.9976298418783-2.99762984187827
961112.3290540932364-1.32905409323643
971612.39556698204893.60443301795112
981112.4381947873198-1.43819478731983
991113.0491688512503-2.04916885125032
1001012.8753555841607-2.87535558416074
1011012.7853924900003-2.78539249000031
1021613.27172284484212.72827715515789
1031212.9320435010056-0.93204350100561
1041113.0407553635903-2.04075536359032
1051612.79287942972053.20712057027949
1061912.77837184759746.22162815240256
1071112.9493868318172-1.94938683181718
1081612.73852349842823.26147650157184
1091512.66406341927302.33593658072697
1102413.168197355548910.8318026444511
1111413.35514418627260.644855813727413
1121512.49255071861222.50744928138782
1131112.8800442410111-1.88004424101109
1141512.65844821448292.34155178551712
1151213.4961672124144-1.49616721241441
1161013.2347416634851-3.2347416634851
1171413.02200659516600.977993404833966
1181313.1738125603390-0.173812560339017
119912.6996705821411-3.6996705821411
1201513.05945407384041.94054592615963
1211512.60121252302272.39878747697734
1221413.30453172484030.695468275159667
1231112.8200731049286-1.82007310492858
124813.2829532544224-5.28295325442242
1251113.0566557909705-2.05665579097052
1261112.9713941337338-1.97139413373378
127813.3110734775703-5.31107347757028
1281012.9826245433141-2.98262454331408
1291113.0604306799544-2.06043067995441
1301312.31776084540860.68223915459144
1311112.8219448398586-1.82194483985863
1322013.18320265411316.81679734588695
1331013.1878726719129-3.18787267191295
1341513.26003218463931.73996781536066
1351212.9278397805230-0.92783978052304
1361412.62189586462461.37810413537545
1372313.11758489411669.8824151058834
1381413.06230241488450.937697585115542
1391613.11478661124682.88521338875324
1401112.7882094119206-1.78820941192062
1411212.4555381181314-0.455538118131391
1421012.4265041271171-2.42650412711705
1431412.53989859985731.46010140014274
1441212.9906091994754-0.990609199475396
1451212.8650703615707-0.865070361570685
1461112.5581184204344-1.55811842043438
1471212.3899517772587-0.389951777258731
1481313.0004281247481-0.000428124748118182
1491113.1653990726790-2.16539907267902
1501912.83787668636266.16212331363738
1511212.9648209618801-0.96482096188005
1521712.56376504434834.43623495565168
153912.0614842039521-3.06148420395208
1541212.9090910120988-0.909091012098752
1551912.87676102177356.12323897822654
1561813.16632562061884.83367437938119
1571512.57312371899862.42687628100143
1581412.83600495143261.16399504856743
1591112.2615832373604-1.26158323736039


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.9791533205914760.04169335881704880.0208466794085244
80.9550738715948180.08985225681036420.0449261284051821
90.9726045167650930.05479096646981380.0273954832349069
100.955773034385010.0884539312299810.0442269656149905
110.9343001510670050.1313996978659910.0656998489329954
120.9316738627787140.1366522744425720.068326137221286
130.9243819994108650.1512360011782710.0756180005891354
140.8872345959729230.2255308080541530.112765404027077
150.9007537802016120.1984924395967750.0992462197983876
160.8735362400472570.2529275199054870.126463759952743
170.8298652071461010.3402695857077970.170134792853898
180.803756644099930.3924867118001410.196243355900071
190.7836918619677790.4326162760644430.216308138032221
200.7548697727473960.4902604545052080.245130227252604
210.8462375933815580.3075248132368850.153762406618442
220.8383720962918870.3232558074162270.161627903708113
230.802254962711690.395490074576620.19774503728831
240.7563276273659490.4873447452681020.243672372634051
250.7218133506557170.5563732986885660.278186649344283
260.7216503687074740.5566992625850520.278349631292526
270.6944922179857780.6110155640284440.305507782014222
280.674732222828210.650535554343580.32526777717179
290.634162713756470.7316745724870610.365837286243530
300.5758084690071330.8483830619857350.424191530992867
310.628741001391560.742517997216880.37125899860844
320.6401706831869080.7196586336261830.359829316813092
330.6222283260575230.7555433478849530.377771673942477
340.5764608137834710.8470783724330570.423539186216528
350.5197997380851830.9604005238296340.480200261914817
360.5351774396931960.9296451206136080.464822560306804
370.7894002592285320.4211994815429360.210599740771468
380.7522040027635230.4955919944729550.247795997236477
390.7249171696082270.5501656607835450.275082830391773
400.7077149615228940.5845700769542120.292285038477106
410.7007958349813280.5984083300373440.299204165018672
420.6650297017036480.6699405965927050.334970298296352
430.7122998260726610.5754003478546780.287700173927339
440.6759983456199040.6480033087601930.324001654380096
450.6426451201333460.7147097597333070.357354879866654
460.5942644806728370.8114710386543260.405735519327163
470.6028439148866120.7943121702267770.397156085113388
480.5621937210759740.8756125578480520.437806278924026
490.548896595162850.9022068096743010.451103404837151
500.5099496817977770.9801006364044460.490050318202223
510.4992031902887460.9984063805774920.500796809711254
520.4591291495859060.9182582991718110.540870850414095
530.5493589757633930.9012820484732130.450641024236607
540.5016474746905650.996705050618870.498352525309435
550.4592191657594870.9184383315189730.540780834240513
560.4124736936112070.8249473872224150.587526306388793
570.3669123705619110.7338247411238230.633087629438089
580.3907112974193810.7814225948387620.609288702580619
590.3948127410412220.7896254820824450.605187258958778
600.3701622049037710.7403244098075420.629837795096229
610.5581932537170770.8836134925658470.441806746282923
620.514714284405570.9705714311888610.485285715594431
630.4720672634271440.9441345268542870.527932736572856
640.4292966856807190.8585933713614380.570703314319281
650.3854807236681480.7709614473362960.614519276331852
660.34994536444870.69989072889740.6500546355513
670.4067223752360960.8134447504721920.593277624763904
680.3663574995577530.7327149991155060.633642500442247
690.3257259588139160.6514519176278310.674274041186084
700.2897726993055520.5795453986111030.710227300694448
710.252562442424080.505124884848160.74743755757592
720.2303015331433220.4606030662866440.769698466856678
730.1986687866619730.3973375733239460.801331213338027
740.1835772410804610.3671544821609220.816422758919539
750.1625624422255190.3251248844510380.837437557774481
760.2598602743225690.5197205486451380.740139725677431
770.2262987043457420.4525974086914850.773701295654258
780.2524133613377720.5048267226755440.747586638662228
790.2169009300924590.4338018601849190.78309906990754
800.2258377163878880.4516754327757750.774162283612112
810.2023206482040360.4046412964080720.797679351795964
820.2012264148524910.4024528297049810.79877358514751
830.2199849404482150.439969880896430.780015059551785
840.1915121116150670.3830242232301340.808487888384933
850.1639653695164360.3279307390328720.836034630483564
860.1397825531451130.2795651062902260.860217446854887
870.1164691926448360.2329383852896730.883530807355164
880.09871786861330830.1974357372266170.901282131386692
890.09341517872992620.1868303574598520.906584821270074
900.2967354436417460.5934708872834920.703264556358254
910.2587011483638920.5174022967277840.741298851636108
920.2282580910823510.4565161821647030.771741908917649
930.195190045044890.390380090089780.80480995495511
940.1766610229669760.3533220459339530.823338977033024
950.1724872923978010.3449745847956020.827512707602199
960.1513229812284900.3026459624569790.84867701877151
970.1587100265380320.3174200530760640.841289973461968
980.1378256064987860.2756512129975730.862174393501214
990.1250346290784520.2500692581569030.874965370921548
1000.1227420158300170.2454840316600340.877257984169983
1010.1195643799145540.2391287598291080.880435620085446
1020.1100893415252130.2201786830504260.889910658474787
1030.09544097570843380.1908819514168680.904559024291566
1040.08732742025515130.1746548405103030.912672579744849
1050.08813597626068340.1762719525213670.911864023739317
1060.1490309279303020.2980618558606040.850969072069698
1070.1318224998125970.2636449996251940.868177500187403
1080.1322141316118160.2644282632236320.867785868388184
1090.1192340401182290.2384680802364580.880765959881771
1100.5139456385995740.9721087228008520.486054361400426
1110.4642846921299660.9285693842599310.535715307870035
1120.4437815279298710.8875630558597420.556218472070129
1130.4045138116829430.8090276233658860.595486188317057
1140.374873398555240.749746797110480.62512660144476
1150.3360308187473680.6720616374947350.663969181252632
1160.3535508152039630.7071016304079270.646449184796037
1170.3085296458157140.6170592916314280.691470354184286
1180.26368589927330.52737179854660.7363141007267
1190.2842326318241770.5684652636483540.715767368175823
1200.2572006704540490.5144013409080990.74279932954595
1210.2664697716225590.5329395432451180.733530228377441
1220.2242378663702530.4484757327405050.775762133629748
1230.1991482617570360.3982965235140730.800851738242964
1240.2592146352233070.5184292704466140.740785364776693
1250.2318302937018450.463660587403690.768169706298155
1260.2296695255250860.4593390510501720.770330474474914
1270.39491414747470.78982829494940.6050858525253
1280.4147197500910260.8294395001820530.585280249908974
1290.4418368523120320.8836737046240640.558163147687968
1300.4241971310646820.8483942621293630.575802868935318
1310.3965674251886740.7931348503773480.603432574811326
1320.4933627803698420.9867255607396840.506637219630158
1330.6170029584622680.7659940830754640.382997041537732
1340.5605698901098390.8788602197803220.439430109890161
1350.5266279910976050.946744017804790.473372008902395
1360.4624610620237420.9249221240474850.537538937976258
1370.8208617086318570.3582765827362860.179138291368143
1380.7713276407371680.4573447185256640.228672359262832
1390.7238092530083280.5523814939833440.276190746991672
1400.6850266457110850.629946708577830.314973354288915
1410.626356644251240.7472867114975190.373643355748760
1420.5742351852514570.8515296294970860.425764814748543
1430.5040974223597120.9918051552805760.495902577640288
1440.4216070105058720.8432140210117440.578392989494128
1450.4183467887352050.836693577470410.581653211264795
1460.329981454575490.659962909150980.67001854542451
1470.2468733204930410.4937466409860830.753126679506959
1480.1822634741509360.3645269483018720.817736525849064
1490.324832655092250.64966531018450.67516734490775
1500.3719208757648990.7438417515297980.628079124235101
1510.400335009051720.800670018103440.59966499094828
1520.4758085397580620.9516170795161240.524191460241938


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level10.00684931506849315OK
10% type I error level40.0273972602739726OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/10xkxl1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/10xkxl1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/18jis1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/18jis1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/28jis1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/28jis1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/38jis1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/38jis1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/48jis1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/48jis1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/5jshc1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/5jshc1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/6jshc1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/6jshc1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/7u1zf1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/7u1zf1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/8u1zf1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/8u1zf1290511386.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/95agi1290511386.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905114317cldyhux11ycpmj/95agi1290511386.ps (open in new window)


 
Parameters (Session):
par1 = 4 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 4 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by