Home » date » 2010 » Nov » 19 »

workshop 7 - tutorial 6

*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: Fri, 19 Nov 2010 16:27:16 +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/19/t1290183948j7nozjxjxlsxayt.htm/, Retrieved Fri, 19 Nov 2010 17:25:48 +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/19/t1290183948j7nozjxjxlsxayt.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 «
1 26 24 24 14 14 11 11 12 12 24 24 1 23 25 25 11 11 7 7 8 8 25 25 0 25 17 0 6 0 17 0 8 0 30 0 1 23 18 18 12 12 10 10 8 8 19 19 1 19 18 18 8 8 12 12 9 9 22 22 0 29 16 0 10 0 12 0 7 0 22 0 1 25 20 20 10 10 11 11 4 4 25 25 1 21 16 16 11 11 11 11 11 11 23 23 1 22 18 18 16 16 12 12 7 7 17 17 1 25 17 17 11 11 13 13 7 7 21 21 1 24 23 23 13 13 14 14 12 12 19 19 1 18 30 30 12 12 16 16 10 10 19 19 1 22 23 23 8 8 11 11 10 10 15 15 1 15 18 18 12 12 10 10 8 8 16 16 1 22 15 15 11 11 11 11 8 8 23 23 1 28 12 12 4 4 15 15 4 4 27 27 1 20 21 21 9 9 9 9 9 9 22 22 1 12 15 15 8 8 11 11 8 8 14 14 1 24 20 20 8 8 17 17 7 7 22 22 1 20 31 31 14 14 17 17 11 11 23 23 1 21 27 27 15 15 11 11 9 9 23 23 1 20 34 34 16 16 18 18 11 11 21 21 1 21 21 21 9 9 14 14 13 13 19 19 1 23 31 31 14 14 10 10 8 8 18 18 1 28 19 19 11 11 11 11 8 8 20 20 1 24 16 16 8 8 15 15 9 9 23 23 1 24 20 20 9 9 15 15 6 6 25 25 1 24 21 21 9 9 13 13 9 9 19 19 1 23 22 22 9 9 16 16 9 9 24 24 1 23 17 17 9 9 13 13 6 6 22 22 1 29 24 24 10 10 9 9 6 6 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 time15 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
O[t] = + 29.5494632738198 -15.2181794105889B[t] -0.380081606319416CM[t] + 0.317358735332185CM_B[t] + 0.0209368771515474D[t] + 0.207544690798781D_B[t] -0.541638217696423PE[t] + 0.410737731232436PE_B[t] + 0.275927135451116PC[t] -0.509480209169096PC_B[t] + 0.251134847979600PS[t] + 0.221717890089259PS_B[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)29.54946327381986.4114444.60899e-064e-06
B-15.21817941058896.7603-2.25110.0258620.012931
CM-0.3800816063194160.283486-1.34070.1820720.091036
CM_B0.3173587353321850.2907921.09140.27690.13845
D0.02093687715154740.4221670.04960.9605130.480257
D_B0.2075446907987810.4380690.47380.6363650.318183
PE-0.5416382176964230.625067-0.86650.3876130.193806
PE_B0.4107377312324360.633940.64790.5180520.259026
PC0.2759271354511160.7447980.37050.7115640.355782
PC_B-0.5094802091690960.756683-0.67330.5018090.250904
PS0.2511348479796000.2897650.86670.3875270.193763
PS_B0.2217178900892590.3011740.73620.4627950.231397


Multiple Linear Regression - Regression Statistics
Multiple R0.508836076808853
R-squared0.258914153062225
Adjusted R-squared0.203458749549874
F-TEST (value)4.66887150148609
F-TEST (DF numerator)11
F-TEST (DF denominator)147
p-value4.20709262227703e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.48517056052898
Sum Squared Residuals1785.52283388875


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12623.13060038877492.86939961122509
22324.3130997927334-1.31309979273343
32523.74731005145671.25268994854331
42321.75082356978931.24917643021074
51921.7601014655486-2.76010146554857
62924.63432433557654.3656756644235
72524.80884292873520.191157071264768
82122.7076389884709-1.7076389884709
92221.69079646624290.309203533757135
102522.37162196328992.6283780367101
112420.20787654207563.79212345792443
121819.7456400517226-1.74564005172261
132218.03386535687643.96613464312358
141520.3322653555827-5.33226535558269
152223.4710210806121-1.47102108061207
162824.36184001921293.63815998078713
172022.1931158799292-2.19311587992917
181218.5299017341414-6.52990173414137
192421.44725943869012.55274056130986
202021.6668377087295-1.66683770872951
212123.3987198268486-2.39871982684864
222020.8590262690668-0.85902626906677
232119.18584293853071.81415706146926
242320.91953664478712.08046335521293
252821.80157138245666.19842861754342
262421.96569848619992.03430151380007
272423.5896532674930.410346732507007
282420.25095571986663.74904428013335
292322.15979507983170.840204920168254
302322.62106463917610.378935360823917
312924.35264627027834.64735372972168
322422.62003042970621.37996957029377
331825.4025417440717-7.40254174407172
342526.5166748967625-1.51667489676250
352122.8153616863728-1.81536168637277
362627.1131636623579-1.11316366235788
372225.4351802135502-3.43518021355015
382222.471516968615-0.471516968614977
392218.23150784772363.76849215227642
402326.0120429543572-3.01204295435724
413023.31349425216456.68650574783546
422322.89444879082860.105551209171422
431718.2750943112244-1.27509431122438
442323.8804744677087-0.880474467708677
452324.4783838583962-1.47838385839615
462522.28094443435582.71905556564417
472420.61878013235473.38121986764531
482428.0120358696766-4.01203586967657
492323.1792243085142-0.179224308514248
502124.048538447637-3.04853844763699
512425.64309255316-1.64309255316002
522421.7492833691482.25071663085198
532821.37946645705506.62053354294497
541620.3853975474503-4.38539754745034
552020.7758050117615-0.775805011761506
562923.57998488725815.42001511274193
572724.09113714349372.90886285650628
582223.2073880608995-1.20738806089948
592823.73022492443154.26977507556854
601619.9301946078529-3.93019460785292
612522.99701138062382.00298861937616
622423.54436019931520.455639800684793
632822.95494653148775.0450534685123
642424.3718167272939-0.371816727293876
652322.36540213647640.634597863523598
663027.33818298542362.66181701457637
672421.30915770289652.69084229710346
682124.3927764401100-3.39277644010995
692523.01091712406061.98908287593938
702524.70590468453670.294095315463281
712220.65427342697451.34572657302549
722322.31281503127070.687184968729269
732623.20747081260452.79252918739554
742321.88986453219031.11013546780969
752523.21331604156961.78668395843039
762121.1912978440933-0.191297844093338
772523.54151122480781.45848877519221
782422.22405815146021.77594184853978
792923.57951165107755.42048834892254
802223.8066344084238-1.80663440842378
812723.8714811723393.128518827661
822623.3523047275812.64769527241898
832221.16995349743560.83004650256439
842422.29605891820681.70394108179324
852722.91879465589144.08120534410856
862421.25517628188022.74482371811984
872424.9854197220989-0.985419722098878
882924.41826675739104.58173324260897
892222.719695403376-0.719695403376022
902122.2384052767203-1.23840527672025
912420.23669631579843.76330368420159
922421.38214268239872.61785731760126
932324.4726473550171-1.47264735501708
942022.2741308792623-2.27413087926229
952721.35035483718885.64964516281118
962624.2514310599741.74856894002601
972522.03790297532042.96209702467963
982120.25364284643400.746357153566045
992120.50155535767220.498444642327805
1001920.1774147524789-1.17741475247886
1012121.750048451472-0.750048451471991
1022121.0018895175073-0.00188951750729945
1031619.7675753364208-3.76757533642083
1042220.66099419436981.33900580563023
1052921.76901845492277.23098154507732
1061520.0314470942041-5.03144709420414
1071720.4094290206754-3.40942902067538
1081519.8292340331870-4.82923403318697
1092121.832123169512-0.832123169512005
1102122.3041191665550-1.30411916655496
1111918.75800006336980.241999936630185
1122418.01720063639095.98279936360905
1132022.4432336406806-2.44323364068060
1141722.2694115066078-5.26941150660783
1152325.234109133435-2.23410913343498
1162422.21600627786211.78399372213789
1171422.2380243142653-8.2380243142653
1181922.6559242447950-3.65592424479497
1192422.29922931694801.70077068305203
1201319.7557930992512-6.75579309925122
1212225.4692733417253-3.46927334172529
1221620.7992801104401-4.79928011044015
1231923.2114188566166-4.21141885661661
1242522.48862674231042.51137325768959
1252524.01130728905060.988692710949389
1262321.42629833075431.57370166924572
1272425.2280272166323-1.22802721663232
1282623.63025946374482.36974053625522
1292621.48241089045244.51758910954761
1302524.44601232089950.553987679100515
1311822.5423535276884-4.5423535276884
1322119.51046542077821.48953457922181
1332623.58927142389092.41072857610911
1342321.55460308322951.44539691677054
1352319.42533263379243.57466736620763
1362223.0113803242479-1.01138032424793
1372022.1846103122476-2.18461031224758
1381322.0702745128170-9.07027451281704
1392421.34997159846692.65002840153306
1401521.7174055264794-6.71740552647937
1411423.2438706188646-9.2438706188646
1422220.31586629052901.68413370947095
1431018.1419112607927-8.14191126079267
1442424.2871658173622-0.287165817362175
1452222.0655848506515-0.0655848506514833
1462426.0938258262539-2.09382582625388
1471921.9372414925515-2.93724149255154
1482023.3835644028641-3.38356440286411
1491316.4397959186471-3.43979591864706
1502020.0681504588160-0.0681504588159777
1512223.4284855943632-1.42848559436320
1522423.61638190327860.383618096721359
1532923.79005968539705.20994031460296
1541220.7579915835694-8.75799158356937
1552021.284389716979-1.28438971697899
1562121.2025064249695-0.202506424969507
1572423.81392119969790.18607880030208
1582222.0253632882413-0.0253632882413480
1592017.85711807469912.14288192530086


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
150.9109524040856740.1780951918286520.0890475959143262
160.8719804734681240.2560390530637530.128019526531876
170.8042686710876440.3914626578247120.195731328912356
180.8337641647236940.3324716705526120.166235835276306
190.7571437697566810.4857124604866380.242856230243319
200.78164833640170.43670332719660.2183516635983
210.7238612434730090.5522775130539820.276138756526991
220.6521619823985760.6956760352028480.347838017601424
230.5726633092117920.8546733815764160.427336690788208
240.5861428002619190.8277143994761620.413857199738081
250.7414110631144610.5171778737710780.258588936885539
260.6776374739570320.6447250520859350.322362526042968
270.6080045122562410.7839909754875180.391995487743759
280.5969709657651540.8060580684696910.403029034234846
290.5258358474491890.9483283051016220.474164152550811
300.452699709821360.905399419642720.54730029017864
310.4773982292800140.9547964585600280.522601770719986
320.4102706692918170.8205413385836350.589729330708183
330.6621384343692210.6757231312615580.337861565630779
340.6166384385416650.766723122916670.383361561458335
350.5740599940717170.8518800118565660.425940005928283
360.511436431145240.977127137709520.48856356885476
370.4883474166299380.9766948332598770.511652583370062
380.4261913826403010.8523827652806010.573808617359699
390.3855031682210570.7710063364421150.614496831778943
400.3536248979175970.7072497958351950.646375102082403
410.5166385960749120.9667228078501760.483361403925088
420.4575796031155130.9151592062310270.542420396884487
430.4136920446428170.8273840892856330.586307955357183
440.3599765236402110.7199530472804220.640023476359789
450.3152131684641650.6304263369283290.684786831535835
460.2930933098299780.5861866196599550.706906690170022
470.2785221319620180.5570442639240360.721477868037982
480.2670623403419890.5341246806839780.732937659658011
490.2238589094868000.4477178189736010.7761410905132
500.2110857055083550.4221714110167110.788914294491645
510.1790316183604830.3580632367209660.820968381639517
520.1562195235576440.3124390471152880.843780476442356
530.2486740899148110.4973481798296210.75132591008519
540.2719148542992990.5438297085985980.728085145700701
550.2648381020810660.5296762041621320.735161897918934
560.3342043325474870.6684086650949740.665795667452513
570.3207773305820860.6415546611641730.679222669417914
580.2806323654992110.5612647309984230.719367634500789
590.3033344799169190.6066689598338370.696665520083081
600.3268883740737800.6537767481475610.67311162592622
610.2927484786399510.5854969572799020.707251521360049
620.2513900772540970.5027801545081940.748609922745903
630.2882737382349710.5765474764699420.711726261765029
640.2480017952436860.4960035904873720.751998204756314
650.2106103631473370.4212207262946740.789389636852663
660.2011944712306380.4023889424612770.798805528769362
670.184919449142740.369838898285480.81508055085726
680.1870771404848330.3741542809696650.812922859515167
690.1654304776853140.3308609553706280.834569522314686
700.1363734214530630.2727468429061250.863626578546937
710.1140236170500860.2280472341001710.885976382949914
720.09259549199204330.1851909839840870.907404508007957
730.08491273501998730.1698254700399750.915087264980013
740.06870950797279030.1374190159455810.93129049202721
750.05731665265320190.1146333053064040.942683347346798
760.04490676782865960.08981353565731930.95509323217134
770.03628120722604390.07256241445208770.963718792773956
780.02936422974454230.05872845948908460.970635770255458
790.04347561031746970.08695122063493940.95652438968253
800.03573889967440.07147779934880.9642611003256
810.03393192810525310.06786385621050630.966068071894747
820.02770323002897060.05540646005794110.97229676997103
830.02111574117537750.0422314823507550.978884258824622
840.01684322487924830.03368644975849670.983156775120752
850.01390753370936260.02781506741872530.986092466290637
860.01235201998375550.02470403996751110.987647980016244
870.009121197971890250.01824239594378050.99087880202811
880.01231613227091920.02463226454183830.98768386772908
890.009442540977979470.01888508195595890.99055745902202
900.01118855215509410.02237710431018820.988811447844906
910.01174991982444350.0234998396488870.988250080175556
920.01055593996455690.02111187992911380.989444060035443
930.009030362130111780.01806072426022360.990969637869888
940.007431582921171220.01486316584234240.992568417078829
950.01377391799745190.02754783599490370.986226082002548
960.01101159043989840.02202318087979680.988988409560102
970.01018047399534050.02036094799068100.98981952600466
980.007571799888453590.01514359977690720.992428200111546
990.005485987026258840.01097197405251770.994514012973741
1000.004059026516962490.008118053033924970.995940973483038
1010.002908874290788300.005817748581576590.997091125709212
1020.002003864287638060.004007728575276130.997996135712362
1030.002154030274295810.004308060548591610.997845969725704
1040.001622749237575320.003245498475150630.998377250762425
1050.007481117524037380.01496223504807480.992518882475963
1060.01173297792077500.02346595584155010.988267022079225
1070.01114822851969030.02229645703938060.98885177148031
1080.01412479682610940.02824959365221880.98587520317389
1090.01053075645804420.02106151291608830.989469243541956
1100.007509778497235330.01501955699447070.992490221502765
1110.005305572843806240.01061114568761250.994694427156194
1120.01481731582583020.02963463165166030.98518268417417
1130.01244794147535740.02489588295071480.987552058524643
1140.01571316257928820.03142632515857650.984286837420712
1150.01245017887720140.02490035775440290.987549821122799
1160.009549473778547510.01909894755709500.990450526221452
1170.03903279479461470.07806558958922950.960967205205385
1180.03631025902865530.07262051805731050.963689740971345
1190.030152752268360.060305504536720.96984724773164
1200.05553186020893270.1110637204178650.944468139791067
1210.05242840845979290.1048568169195860.947571591540207
1220.06442661819303720.1288532363860740.935573381806963
1230.05881392343198080.1176278468639620.94118607656802
1240.05620024421682590.1124004884336520.943799755783174
1250.04854355667029810.09708711334059630.951456443329702
1260.03568177831539740.07136355663079490.964318221684603
1270.025476865288390.050953730576780.97452313471161
1280.02497964481874720.04995928963749450.975020355181253
1290.03880289398237630.07760578796475270.961197106017624
1300.02996200454405250.0599240090881050.970037995455947
1310.02456926250371480.04913852500742970.975430737496285
1320.01929227276532760.03858454553065510.980707727234672
1330.01617175476651610.03234350953303210.983828245233484
1340.01167618931648460.02335237863296930.988323810683515
1350.01712543606056190.03425087212112380.982874563939438
1360.01068470145416430.02136940290832870.989315298545836
1370.006361122659351530.01272224531870310.993638877340648
1380.02147609255685490.04295218511370990.978523907443145
1390.03253666467815460.06507332935630910.967463335321845
1400.02564654773474360.05129309546948730.974353452265256
1410.08979870892414620.1795974178482920.910201291075854
1420.05186324427502840.1037264885500570.948136755724972
1430.1572617930210360.3145235860420720.842738206978964
1440.1003605200639170.2007210401278350.899639479936083


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level50.0384615384615385NOK
5% type I error level430.330769230769231NOK
10% type I error level600.461538461538462NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/10lo7v1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/10lo7v1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/17erm1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/17erm1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/27erm1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/27erm1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/37erm1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/37erm1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/4io971290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/4io971290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/5io971290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/5io971290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/6io971290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/6io971290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/7sfqs1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/7sfqs1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/8lo7v1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/8lo7v1290184016.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/9lo7v1290184016.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/19/t1290183948j7nozjxjxlsxayt/9lo7v1290184016.ps (open in new window)


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