Home » date » 2010 » Dec » 02 »

workshop 7

*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 10:14:38 +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/t1291284838f7m39gp7biwlt54.htm/, Retrieved Thu, 02 Dec 2010 11:14: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/t1291284838f7m39gp7biwlt54.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 «
13 14 3 25 55 147 12 8 5 158 7 71 10 12 6 0 0 0 9 7 6 143 10 0 10 10 5 67 74 43 12 7 3 0 0 0 13 16 8 148 138 8 12 11 4 28 0 0 12 14 4 114 113 34 6 6 4 0 0 0 5 16 6 123 115 103 12 11 6 145 9 0 11 16 5 113 114 73 14 12 4 152 59 159 14 7 6 0 0 0 12 13 4 36 114 113 12 11 6 0 0 0 11 15 6 8 102 44 11 7 4 108 0 0 7 9 4 112 86 0 9 7 2 51 17 41 11 14 7 43 45 74 11 15 5 120 123 0 12 7 4 13 24 0 12 15 6 55 5 0 11 17 6 103 123 32 11 15 7 127 136 126 8 14 5 14 4 154 9 14 6 135 76 129 12 8 4 38 99 98 10 8 4 11 98 82 10 14 7 43 67 45 12 14 7 141 92 8 8 8 4 62 13 0 12 11 4 62 24 129 11 16 6 135 129 31 12 10 6 117 117 117 7 8 5 82 11 99 11 14 6 145 20 55 11 16 7 87 91 132 12 13 6 76 111 58 9 5 3 124 0 0 15 8 3 151 58 0 11 10 4 131 0 0 11 8 6 127 146 101 11 13 7 76 129 31 11 15 5 25 48 147 15 6 4 0 0 0 11 12 5 58 111 132 12 16 6 115 32 123 12 5 6 130 112 39 9 15 6 17 51 136 12 12 5 102 53 141 12 8 4 21 131 0 13 13 5 0 0 0 11 14 5 14 76 135 9 12 4 110 106 118 9 16 6 133 2 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 time19 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
FindingFriends[t] = + 9.01508211087726 + 0.173745393657251KnowingPeople[t] + 0.00935140411484961Celebrity[t] + 0.0055986399334022firstbestfriend[t] + 0.0106393108702864secondbestfriend[t] -0.0156929343329173thirdbestfriend[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)9.015082110877260.76289911.816900
KnowingPeople0.1737453936572510.0829662.09420.0379250.018963
Celebrity0.009351404114849610.0057161.63590.1039630.051982
firstbestfriend0.00559863993340220.0047051.18990.2359770.117988
secondbestfriend0.01063931087028640.004582.3230.0215240.010762
thirdbestfriend-0.01569293433291730.007084-2.21520.0282550.014127


Multiple Linear Regression - Regression Statistics
Multiple R0.332773506741778
R-squared0.110738206789220
Adjusted R-squared0.0810961470155275
F-TEST (value)3.73584722636247
F-TEST (DF numerator)5
F-TEST (DF denominator)150
p-value0.00323763782245301
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.88804771231853
Sum Squared Residuals1251.12293829424


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1139.893838583685283.10616141631472
21210.29666422864191.70333577135806
31011.1561352594534-1.15613525945336
4911.1944069103465-2.19440691034649
51011.2869147716477-1.28691477164771
61210.25935407882261.74064592117744
71314.0410997778918-1.04109977789177
81211.12044897570170.879551024298322
91212.7918505519692-0.79185055196919
10610.0949600892802-4.09496008928016
11512.1468980596833-7.14689805968329
121211.88994645397200.110053546027988
131112.5417089753517-1.54170897535165
141410.12096850351393.87903149648615
151410.28740829116713.71259170883289
161210.95230874207641.04769125792361
171210.98238986579611.01761013420388
181112.1168811580132-1.11688115801318
191110.87335859574490.126641404255147
20712.1582246776376-5.15822467763759
21910.0729912884565-1.07299128845649
221111.0712108165460-0.07121081654602
231113.6484920653638-2.64849206536375
241210.59683126295851.40316873704148
251212.0384931911137-0.0384931911136705
261113.4079834792719-2.40798347927191
271111.8673866684934-0.867386668493416
2889.19850095793254-1.19850095793254
29911.0436415349726-2.0436415349726
301210.17058340559641.82941659440359
311010.2598677658509-0.259867765850937
321011.7603707513469-1.76037075134692
331213.1556588068954-1.15565880689543
34810.9278775937793-2.92787759377932
35129.54175766537792.4582423346221
361113.4929233630382-2.49292336303817
371210.87241139921911.12758860078089
3879.47432267586284-2.47432267586284
391111.6651036662065-0.665103666206464
401111.2442598696542-0.244259869654189
411212.0261506033418-0.0261506033417682
42910.6060946432499-1.60609464324994
431511.89557413290023.10442586709984
441111.5233634951849-0.523363495184854
451111.1405339758036-0.140533975803608
461112.6507188301105-1.65071883011054
471110.01181160948020.98818839051977
481510.09496008928024.90503991071984
491110.58100114613260.418998853867449
501210.90518745132401.09481254867604
511211.24731907368320.752680926316802
52910.1809141044008-1.18091410440081
531210.06902486372941.93097513627062
541211.95377203920360.0462279607963763
551311.32052924899581.67947075100423
561110.26269709291860.737302907081419
57911.0292835448640-2.02928354486403
58910.4556461405830-1.45564614058305
591111.5314333707824-0.531433370782359
601512.32728305532942.67271694467061
6189.34800307985401-1.34800307985401
621611.91348143373774.08651856626225
631911.47175140703027.52824859296983
641411.55598625910272.44401374089731
65612.1628404454536-6.1628404454536
661311.84819394615771.15180605384229
671510.66205118111864.33794881888143
68710.4342547922416-3.43425479224163
691311.86173064650071.13826935349932
70410.8682303434704-6.8682303434704
711411.79815631996132.2018436800387
721311.80825061436081.19174938563919
731112.8764432340041-1.87644323400408
741411.44723098865872.55276901134126
751211.78200975598990.217990244010121
761511.81003375085913.18996624914094
771411.45323701618862.54676298381141
781311.48601337076351.51398662923648
79812.0549280446279-4.05492804462788
8069.72599052897288-3.72599052897288
81710.6606853124895-3.66068531248951
821311.87843968059791.12156031940209
831312.88312256298760.116877437012414
841112.5349040926459-1.53490409264587
85510.6809567472698-5.68095674726982
861211.95566582753540.0443341724646023
87811.2761588909443-3.27615889094431
881111.8764862117699-0.876486211769938
891411.99508140682582.0049185931742
90911.0833231770439-2.08332317704388
911011.4473033172173-1.44730331721730
921312.50205237482000.497947625179985
931612.07909795634823.92090204365176
941612.41221496945153.58778503054846
951110.30986446015600.690135539843977
96810.4979479402014-2.49794794020141
9749.85354632649284-5.85354632649284
9879.60715430359752-2.60715430359752
991411.96110167769272.03889832230729
1001111.8706382097162-0.870638209716206
1011712.46594139717684.53405860282324
1021512.11104970782842.88895029217165
1031710.34123492234216.65876507765786
104510.2765136167700-5.27651361677003
105412.0857841145972-8.08578411459724
1061012.6996959101111-2.69969591011112
1071110.32001073185470.679989268145262
1081512.90774058767102.09225941232902
1091011.2077384815379-1.20773848153788
110910.0589677938194-1.05896779381944
1111212.4660636051942-0.466063605194235
1121512.71108096148192.28891903851815
113712.3092543946452-5.30925439464515
1141312.14178276871050.85821723128954
1151213.2009024721173-1.20090247211731
1161412.07530422950891.92469577049115
1171411.28084248916822.71915751083175
118811.7664790750518-3.76647907505175
1191512.03916476096642.9608352390336
1201211.49354493002860.506455069971386
1211211.97017221465250.0298277853475329
1221611.89738972108164.1026102789184
123911.9466874403003-2.94668744030026
1241512.36049978348622.63950021651376
1251512.73374454412192.26625545587805
12669.6954938671685-3.69549386716851
1271411.24973410808882.75026589191121
1281512.41840751076922.58159248923077
1291012.2075859169522-2.20758591695223
13069.52174847351126-3.52174847351126
1311412.23170727228761.76829272771238
1321210.76955650988931.23044349011066
13389.68373221736048-1.68373221736048
134119.869239260825761.13076073917424
1351310.73711531964622.2628846803538
136911.1990339526980-2.19903395269802
1371511.99930444729633.00069555270366
138139.348003079854013.65199692014599
1391511.27609019460833.7239098053917
1401412.56292698043531.43707301956469
1411611.28504846292614.7149515370739
1421412.05356947398781.94643052601225
1431412.02722472489141.9727752751086
1441010.2282143206381-0.228214320638078
1451011.4035241720714-1.4035241720714
146412.1991464216973-8.19914642169729
147810.3684731810132-2.36847318101318
1481512.29487474276622.70512525723376
1491610.98324144524425.01675855475582
1501212.8891921035521-0.889192103552134
1511211.49353059372400.506469406275974
1521510.64218420030744.35781579969259
153910.2026985998068-1.20269859980682
1541211.92885010789190.0711498921081077
1551411.6916561783642.30834382163599
1561111.4070056110141-0.40700561101407


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.1767016883628580.3534033767257170.823298311637142
100.2162144339863860.4324288679727720.783785566013614
110.7504969256500710.4990061486998580.249503074349929
120.6439707934911360.7120584130177270.356029206508864
130.5379394528093040.9241210943813920.462060547190696
140.5175032494054940.9649935011890130.482496750594506
150.7223968896533680.5552062206932630.277603110346632
160.6560734259913340.6878531480173310.343926574008666
170.5771607491136090.8456785017727820.422839250886391
180.4911648949131540.9823297898263070.508835105086846
190.405436519912730.810873039825460.59456348008727
200.4132620405932720.8265240811865450.586737959406728
210.350108159728420.700216319456840.64989184027158
220.291390172935950.58278034587190.70860982706405
230.2452013500968030.4904027001936060.754798649903197
240.2177769172740230.4355538345480450.782223082725977
250.1687707526947260.3375415053894510.831229247305274
260.1361629870844680.2723259741689360.863837012915532
270.1014000544507850.202800108901570.898599945549215
280.1429600080849880.2859200161699750.857039991915012
290.1238447894448480.2476895788896960.876155210555152
300.1090019258248090.2180038516496190.89099807417519
310.08147158425154240.1629431685030850.918528415748458
320.06482208659265260.1296441731853050.935177913407347
330.05365593568659130.1073118713731830.946344064313409
340.05802841988756190.1160568397751240.941971580112438
350.04828709519020440.09657419038040870.951712904809796
360.04531939149695260.09063878299390520.954680608503047
370.0368564572334360.0737129144668720.963143542766564
380.04599303412379430.09198606824758850.954006965876206
390.03639424195202230.07278848390404460.963605758047978
400.02643728739740290.05287457479480570.973562712602597
410.02089998258922160.04179996517844320.979100017410778
420.01608453153669220.03216906307338430.983915468463308
430.02752821946053230.05505643892106460.972471780539468
440.02265346187714120.04530692375428240.97734653812286
450.01656549847760310.03313099695520620.983434501522397
460.01620500002019640.03241000004039280.983794999979804
470.01153835769217450.0230767153843490.988461642307826
480.02288622851940340.04577245703880680.977113771480597
490.01695532559193760.03391065118387520.983044674408062
500.01307146253683360.02614292507366710.986928537463166
510.01018049425289430.02036098850578850.989819505747106
520.008292191568695070.01658438313739010.991707808431305
530.007366941813399180.01473388362679840.9926330581866
540.005683742895981420.01136748579196280.994316257104018
550.007169164433069490.01433832886613900.99283083556693
560.00533224667210820.01066449334421640.994667753327892
570.004388783705688680.008777567411377360.995611216294311
580.003305620399204140.006611240798408280.996694379600796
590.003878848471379870.007757696942759740.99612115152862
600.002771888337690170.005543776675380330.99722811166231
610.002664062610710170.005328125221420340.99733593738929
620.00232989331848910.00465978663697820.99767010668151
630.003487818107093360.006975636214186730.996512181892907
640.002507908865490880.005015817730981770.99749209113451
650.009982985477040880.01996597095408180.99001701452296
660.0389253900694570.0778507801389140.961074609930543
670.04720978822120880.09441957644241760.952790211778791
680.1410341725108590.2820683450217190.85896582748914
690.1246046850765660.2492093701531320.875395314923434
700.3422745843181850.684549168636370.657725415681815
710.3297965942099150.6595931884198310.670203405790085
720.2959191210743150.5918382421486310.704080878925685
730.2678309193989940.5356618387979870.732169080601006
740.2493389866971300.4986779733942590.75066101330287
750.2133905242429330.4267810484858660.786609475757067
760.2205415840707490.4410831681414990.77945841592925
770.2091993562054700.4183987124109410.79080064379453
780.1843162234383940.3686324468767880.815683776561606
790.2027018724665680.4054037449331350.797298127533432
800.2264185242372150.452837048474430.773581475762785
810.2424230197500630.4848460395001260.757576980249937
820.2197659097106000.4395318194212010.7802340902894
830.1901515793907610.3803031587815220.80984842060924
840.1641057455095600.3282114910191200.83589425449044
850.234310599363360.468621198726720.76568940063664
860.2047908415961580.4095816831923170.795209158403842
870.2116762705198840.4233525410397690.788323729480116
880.1840284371740010.3680568743480020.815971562825999
890.1625481536063880.3250963072127770.837451846393612
900.1441642940366620.2883285880733240.855835705963338
910.1324091706924580.2648183413849160.867590829307542
920.1096279440157200.2192558880314410.89037205598428
930.1241953160723150.2483906321446290.875804683927685
940.1520969936816250.304193987363250.847903006318375
950.1264650407328930.2529300814657860.873534959267107
960.1189677563631220.2379355127262440.881032243636878
970.2500983411608010.5001966823216020.749901658839199
980.2386402850916860.4772805701833720.761359714908314
990.2217393756133550.443478751226710.778260624386645
1000.1904746160316440.3809492320632880.809525383968356
1010.2379426032092980.4758852064185960.762057396790702
1020.2373289647583190.4746579295166380.762671035241681
1030.3724840860307340.7449681720614680.627515913969266
1040.4925502133536360.9851004267072720.507449786646364
1050.7016564885356360.5966870229287280.298343511464364
1060.7064325129484590.5871349741030820.293567487051541
1070.6630660371452030.6738679257095950.336933962854797
1080.6267589276606880.7464821446786230.373241072339312
1090.5814985331507390.8370029336985220.418501466849261
1100.5451778520024750.909644295995050.454822147997525
1110.5175865506077510.9648268987844980.482413449392249
1120.4886515855818180.9773031711636360.511348414418182
1130.6203367492013090.7593265015973820.379663250798691
1140.5703536832759660.8592926334480670.429646316724034
1150.5457812782843080.9084374434313840.454218721715692
1160.5294156144409870.9411687711180270.470584385559013
1170.5124496679768110.9751006640463770.487550332023189
1180.572549389686620.8549012206267590.427450610313379
1190.5646850373670170.8706299252659660.435314962632983
1200.5228491884595670.9543016230808650.477150811540433
1210.4650630247394820.9301260494789630.534936975260518
1220.5135365843657590.9729268312684820.486463415634241
1230.5099947498531800.9800105002936390.490005250146820
1240.4868090026382920.9736180052765850.513190997361708
1250.4383530042751650.876706008550330.561646995724835
1260.4887725380745900.9775450761491790.511227461925410
1270.4562806651150920.9125613302301840.543719334884908
1280.4123799737303820.8247599474607650.587620026269618
1290.3805768768557390.7611537537114790.619423123144261
1300.4472836538697210.8945673077394420.552716346130279
1310.3850749559879000.7701499119758010.6149250440121
1320.3248173601812430.6496347203624860.675182639818757
1330.2963600659089940.5927201318179890.703639934091006
1340.2406355943708020.4812711887416050.759364405629198
1350.1939957440952100.3879914881904210.80600425590479
1360.2942443099893390.5884886199786780.705755690010661
1370.2911187192087010.5822374384174010.7088812807913
1380.2651049724752570.5302099449505130.734895027524743
1390.2171037485575820.4342074971151640.782896251442418
1400.1640341169028030.3280682338056060.835965883097197
1410.1586224090575660.3172448181151320.841377590942434
1420.1343281259341560.2686562518683130.865671874065844
1430.1002970390670230.2005940781340460.899702960932977
1440.06550063838207610.1310012767641520.934499361617924
1450.05008156457391860.1001631291478370.949918435426081
1460.2915581518974030.5831163037948070.708441848102596
1470.4239156105874160.8478312211748320.576084389412584


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level80.0575539568345324NOK
5% type I error level240.172661870503597NOK
10% type I error level330.237410071942446NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291284838f7m39gp7biwlt54/10rbup1291284858.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291284838f7m39gp7biwlt54/10rbup1291284858.ps (open in new window)


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291284838f7m39gp7biwlt54/65sdi1291284858.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291284838f7m39gp7biwlt54/65sdi1291284858.ps (open in new window)


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


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


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


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