Home » date » 2010 » Dec » 10 »

WS 10 - Multiple regression

*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, 10 Dec 2010 20:15:37 +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/10/t1292012078ujcdbvbase33sf3.htm/, Retrieved Fri, 10 Dec 2010 21:14: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/Dec/10/t1292012078ujcdbvbase33sf3.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 «
2 24 14 11 12 24 26 2 25 11 7 8 25 23 2 17 6 17 8 30 25 1 18 12 10 8 19 23 2 18 8 12 9 22 19 2 16 10 12 7 22 29 2 20 10 11 4 25 25 2 16 11 11 11 23 21 2 18 16 12 7 17 22 2 17 11 13 7 21 25 1 23 13 14 12 19 24 2 30 12 16 10 19 18 1 23 8 11 10 15 22 2 18 12 10 8 16 15 2 15 11 11 8 23 22 1 12 4 15 4 27 28 1 21 9 9 9 22 20 2 15 8 11 8 14 12 1 20 8 17 7 22 24 2 31 14 17 11 23 20 1 27 15 11 9 23 21 2 34 16 18 11 21 20 2 21 9 14 13 19 21 2 31 14 10 8 18 23 1 19 11 11 8 20 28 2 16 8 15 9 23 24 1 20 9 15 6 25 24 2 21 9 13 9 19 24 2 22 9 16 9 24 23 1 17 9 13 6 22 23 2 24 10 9 6 25 29 1 25 16 18 16 26 24 2 26 11 18 5 29 18 2 25 8 12 7 32 25 1 17 9 17 9 25 21 1 32 16 9 6 29 26 1 33 11 9 6 28 22 1 13 16 12 5 17 22 2 32 12 18 12 28 22 1 25 12 12 7 29 23 1 29 14 18 10 26 30 2 22 9 14 9 25 23 1 18 10 15 8 14 17 1 17 9 16 5 25 23 2 20 10 10 8 26 23 2 15 12 11 8 20 25 2 20 14 14 10 18 24 2 33 14 9 6 32 24 2 29 10 12 8 25 23 1 23 14 17 7 25 21 2 26 16 5 4 23 24 1 18 9 12 8 21 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 time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
PE[t] = + 7.07697462326621 -0.630456701488424gendeR[t] + 0.0888573959968063COM[t] -0.109453550630909DA[t] + 0.665543146599335PC[t] + 0.114839167100403PS[t] -0.0871517232603647`O `[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)7.076974623266211.8768443.77070.0002330.000116
gendeR-0.6304567014884240.44232-1.42530.1561090.078054
COM0.08885739599680630.0479681.85240.0659050.032953
DA-0.1094535506309090.087608-1.24940.2134540.106727
PC0.6655431465993350.0860157.737500
PS0.1148391671004030.0630171.82230.0703690.035184
`O `-0.08715172326036470.061658-1.41350.1595630.079781


Multiple Linear Regression - Regression Statistics
Multiple R0.644361482982939
R-squared0.415201720751972
Adjusted R-squared0.392117578150076
F-TEST (value)17.9864475762627
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value1.11022302462516e-15
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.68633275396784
Sum Squared Residuals1096.89031708615


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11114.8930019802121-3.89300198021215
2713.0243417785859-6.0243417785859
31713.26064275274733.73935724725274
41012.2343081548633-2.23430815486332
51213.4003331968406-1.40033319684055
61210.80110777778281.1988922222172
7119.85303231631471.14696768368531
81114.1658797667326-3.16587976673255
91210.35796749331151.64203250668851
101311.01427934908981.98572065091025
111415.1441624473534-1.14416244735343
121614.43698511483711.56301488516292
131114.0752906854284-3.07529068542842
141011.9565477381566-1.95654773815662
151111.9932412076774-0.993241207677377
161510.39757431803384.60242568196617
17914.1007568124281-5.10075681242811
181112.1595665882701-1.15956658827012
191712.44165978082214.55834021917791
201715.25753177805231.74246822194772
211114.0048673284635-3.00486732846353
221815.07551853058012.92448146941993
231415.7008034727755-1.70080347277546
241012.4252513329712-2.42525133297117
251112.1116996522896-1.11169965228962
261512.90169895564552.09830104435448
271512.01118058489312.98881941510695
281312.77717571659700.222824283402974
291613.52738067135622.47261932864379
301311.48724261886181.51275738113821
31911.1909413004591-2.19094130045913
321818.4595633435545-0.459563343554469
331812.01168501948815.98831498051188
341213.3167300070614-1.31673000706137
351714.00269300648172.99730699351827
36912.5963477043192-3.59634770431925
37913.4662405794117-4.46624057941166
38129.213050921617212.78694907838279
391816.63073181089151.36926818910847
401213.3391584512457-1.33915845124567
411814.51773080964533.48226919035468
421413.64221983845660.357780161543384
431512.40192976018532.59807023981468
441611.16621697356374.83378302643633
451012.8043475163332-2.80434751633316
461111.2778149859642-0.277814985964163
471412.69175454694461.30824545305540
48912.7924764479114-3.79247644791139
491213.4892249132040-1.48922491320402
501712.65748333610944.34251666389064
5159.58692877756963-4.58692877756963
521212.7051954176965-0.705195417696499
531212.3100105989173-0.310010598917340
5469.12710379320632-3.12710379320632
552423.07190008443260.928099915567425
561212.2565425666583-0.256542566658277
571212.6334554152853-0.633455415285316
581411.28306952546552.71693047453455
5979.49501783063909-2.49501783063909
601310.95592744481552.04407255518451
611213.5392469463399-1.53924694633987
621311.87574526315851.12425473684145
631411.16560292197262.83439707802743
64812.6469851615850-4.64698516158498
65119.115269946864271.88473005313573
66912.0925715640434-3.09257156404339
671113.4541775818979-2.45417758189787
681313.7445429860768-0.744542986076818
69109.189291599053340.810708400946656
701113.0362080535695-2.03620805356954
711213.0971440611165-1.09714406111646
72911.5852046888659-2.58520468886591
731514.32130217085080.678697829149221
741815.33936496713512.66063503286491
751512.45717323761352.54282676238647
761212.5561881482419-0.556188148241892
77139.664945966610463.33505403338954
781412.79333256600551.20666743399449
791012.2596118796996-2.25961187969956
801312.67743609812640.322563901873584
811314.1312024363452-1.13120243634517
821112.3998959546669-1.39989595466689
831311.95757536462571.04242463537431
841614.78280672192131.21719327807870
8589.48399499925766-1.48399499925766
861611.34202148923694.65797851076306
871111.4398804507600-0.439880450760020
88911.0548184929621-2.05481849296209
891617.4915493530026-1.49154935300257
901211.19069791635410.809302083645878
911411.77897346262642.22102653737363
92810.2409291233578-2.24092912335779
9399.3092824380134-0.309282438013395
941511.45307451650763.54692548349241
951113.2332272356225-2.23322723562246
962116.87153129151674.12846870848331
971413.04210143308920.957898566910836
981815.53798362582772.46201637417226
991212.0454473355739-0.0454473355738553
1001313.0424125660534-0.042412566053429
1011514.23179194274180.76820805725823
1021211.35822087334950.641779126650482
1031914.16591442038294.83408557961712
1041514.32003870804680.679961291953193
1051112.752246452834-1.75224645283401
1061111.1083088376633-0.108308837663261
1071012.0507658697514-2.05076586975142
1081315.1241132620185-2.12411326201848
1091515.1528532131991-0.152853213199097
110129.679947441036732.32005255896327
1111210.70624658685461.29375341314538
1121615.39042131190320.60957868809682
113915.1405182889701-6.14051828897008
1141817.76054413296220.239455867037837
115814.6058773039911-6.60587730399114
1161310.64030473653582.35969526346421
1171713.82283066510293.17716933489713
118910.7568073749522-1.75680737495220
1191512.92985504873092.07014495126909
12089.41132943960332-1.41132943960332
121710.9195896665365-3.91958966653653
1221211.0727160020410.927283997958995
1231414.7746452715422-0.774645271542197
124610.3845428952891-4.38454289528913
12589.97723385120437-1.97723385120437
1261712.12069813020024.87930186979976
1271010.0007433610401-0.000743361040053847
1281112.2037604617204-1.20376046172035
1291412.45652486565581.54347513434423
1301113.3473760152473-2.34737601524728
1311315.7057751810833-2.70577518108331
1321212.2147399599820-0.214739959981965
1331110.04462676809330.955373231906655
13499.71739581189561-0.717395811895613
1351212.3752699428144-0.375269942814357
1362014.42736925688035.57263074311969
1371211.05522348081480.944776519185156
1381314.0010468682671-1.00104686826712
1391212.7608780174415-0.760878017441517
1401216.2192745071120-4.21927450711202
141914.9909551299074-5.99095512990742
1421515.2367698927996-0.23676989279965
1432421.89771392535992.10228607464009
14479.68796016061504-2.68796016061504
1451714.93456462368282.06543537631718
1461111.6439439271603-0.643943927160331
1471714.79054329546932.20945670453067
1481112.5659739561322-1.56597395613224
1491212.8884618900618-0.888461890061799
1501414.7349325714544-0.734932571454359
1511113.8854030380856-2.88540303808559
1521612.5416553230613.45834467693902
1532114.08084781027296.91915218972713
1541411.91522435192022.08477564807980
1552016.05438653427923.94561346572078
1561310.68657186259292.31342813740711
1571112.7605624243228-1.76056242432280
1581513.61258300449151.38741699550853
1591917.67730540718471.32269459281528


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.578714161692360.842571676615280.42128583830764
110.7229151484233550.5541697031532910.277084851576645
120.8573432236011240.2853135527977530.142656776398876
130.8627132680665740.2745734638668520.137286731933426
140.8123453708135990.3753092583728030.187654629186401
150.7372017874135650.525596425172870.262798212586435
160.7094343636860090.5811312726279830.290565636313992
170.7205096970210150.558980605957970.279490302978985
180.6429000828473370.7141998343053250.357099917152663
190.7620733784598860.4758532430802280.237926621540114
200.8340527621820550.331894475635890.165947237817945
210.7935347817573140.4129304364853730.206465218242686
220.8376543253592660.3246913492814690.162345674640734
230.7926753460735490.4146493078529030.207324653926451
240.8265287002915440.3469425994169120.173471299708456
250.7820549479087250.435890104182550.217945052091275
260.7563289281751920.4873421436496170.243671071824808
270.7423292550806950.5153414898386090.257670744919305
280.685441873782780.629116252434440.31455812621722
290.6572038157406590.6855923685186830.342796184259341
300.6074115630176720.7851768739646550.392588436982328
310.6836984382402330.6326031235195330.316301561759767
320.6634441128592880.6731117742814240.336555887140712
330.730913414208650.53817317158270.26908658579135
340.766405018841820.4671899623163610.233594981158180
350.7624806443933950.475038711213210.237519355606605
360.8180859676212050.363828064757590.181914032378795
370.8721762621632920.2556474756734150.127823737836708
380.8641559263716090.2716881472567820.135844073628391
390.8546981756800030.2906036486399940.145301824319997
400.8309141715133780.3381716569732440.169085828486622
410.8734323318155630.2531353363688750.126567668184437
420.8434649037940540.3130701924118910.156535096205946
430.8472224381899010.3055551236201980.152777561810099
440.88449083231340.2310183353731990.115509167686599
450.892166807233070.2156663855338590.107833192766929
460.8671881994271090.2656236011457820.132811800572891
470.847919171210790.3041616575784190.152080828789209
480.8666163960657240.2667672078685520.133383603934276
490.843225548033180.3135489039336400.156774451966820
500.8800524787246790.2398950425506420.119947521275321
510.9163502024421470.1672995951157050.0836497975578525
520.8997635916786310.2004728166427390.100236408321369
530.8763979717130670.2472040565738660.123602028286933
540.8933733628012840.2132532743974320.106626637198716
550.8708158228631140.2583683542737710.129184177136886
560.8447002018148190.3105995963703630.155299798185181
570.8149979078808950.370004184238210.185002092119105
580.8122058636629380.3755882726741240.187794136337062
590.8214351352385030.3571297295229930.178564864761497
600.804896578308250.3902068433834990.195103421691749
610.7873800616530410.4252398766939180.212619938346959
620.7574625841117230.4850748317765550.242537415888277
630.7620699875486720.4758600249026550.237930012451328
640.832693442587710.334613114824580.16730655741229
650.8171592261426170.3656815477147670.182840773857383
660.8217311259223360.3565377481553280.178268874077664
670.8164383602432530.3671232795134930.183561639756746
680.7903939897946330.4192120204107330.209606010205367
690.763233968486890.4735320630262210.236766031513111
700.7472948998887910.5054102002224180.252705100111209
710.7193204695171360.5613590609657290.280679530482864
720.7139983191107250.572003361778550.286001680889275
730.6839060178925880.6321879642148230.316093982107412
740.6877851342322550.624429731535490.312214865767745
750.6838960544680470.6322078910639050.316103945531953
760.6444020024285240.7111959951429520.355597997571476
770.6844962725843520.6310074548312960.315503727415648
780.6520571036632150.6958857926735710.347942896336785
790.6348942075637710.7302115848724580.365105792436229
800.5913065395203570.8173869209592860.408693460479643
810.551597730369990.8968045392600190.448402269630010
820.5207129411037950.958574117792410.479287058896206
830.4823520000827210.9647040001654430.517647999917279
840.4441472964329540.8882945928659080.555852703567046
850.4127987789561850.825597557912370.587201221043815
860.5107058451522690.9785883096954620.489294154847731
870.4652857541467820.9305715082935640.534714245853218
880.4384788980140960.8769577960281920.561521101985904
890.4115830800765090.8231661601530180.588416919923491
900.3700510815363850.740102163072770.629948918463615
910.3575248235272740.7150496470545480.642475176472726
920.3410727700333350.682145540066670.658927229966665
930.298726582958750.59745316591750.70127341704125
940.3286252449595950.657250489919190.671374755040405
950.3183468016420280.6366936032840560.681653198357972
960.3647206928975030.7294413857950070.635279307102497
970.3283782664677120.6567565329354240.671621733532288
980.3119062617376510.6238125234753010.688093738262349
990.270282390914080.540564781828160.72971760908592
1000.2318475308330820.4636950616661650.768152469166918
1010.1980817637994460.3961635275988920.801918236200554
1020.1683910135061150.3367820270122310.831608986493885
1030.2422382079665850.484476415933170.757761792033415
1040.2071447390027370.4142894780054740.792855260997263
1050.1957890849265160.3915781698530320.804210915073484
1060.1635252770185120.3270505540370250.836474722981488
1070.1503100153790680.3006200307581350.849689984620932
1080.1429169602582220.2858339205164440.857083039741778
1090.1171294315267610.2342588630535210.882870568473239
1100.1122753055249930.2245506110499860.887724694475007
1110.09750320079728320.1950064015945660.902496799202717
1120.082715095791110.165430191582220.91728490420889
1130.2034222334921490.4068444669842970.796577766507851
1140.171614726054350.34322945210870.82838527394565
1150.3600727813601440.7201455627202880.639927218639856
1160.3492562505293640.6985125010587290.650743749470636
1170.3838886544710530.7677773089421060.616111345528947
1180.3428867784849140.6857735569698280.657113221515086
1190.3109541290757420.6219082581514840.689045870924258
1200.2718688815110980.5437377630221960.728131118488902
1210.3096636603047770.6193273206095550.690336339695223
1220.2926829423751990.5853658847503980.707317057624801
1230.246722867669170.493445735338340.75327713233083
1240.3418971735630190.6837943471260390.65810282643698
1250.3009677637524040.6019355275048070.699032236247596
1260.3949376968213140.7898753936426290.605062303178686
1270.3383856866569430.6767713733138860.661614313343057
1280.3095737981647520.6191475963295050.690426201835248
1290.2602120009316710.5204240018633420.739787999068329
1300.3007484532084180.6014969064168360.699251546791582
1310.2985015970922490.5970031941844980.701498402907751
1320.2436836066665250.487367213333050.756316393333475
1330.1958691209935570.3917382419871140.804130879006443
1340.1532056468427740.3064112936855470.846794353157226
1350.1240837942803590.2481675885607190.87591620571964
1360.2179867151854850.4359734303709700.782013284814515
1370.1892014149493760.3784028298987520.810798585050624
1380.158542536045130.317085072090260.84145746395487
1390.1381295143916430.2762590287832850.861870485608357
1400.1687512619701590.3375025239403180.831248738029841
1410.3903538816461480.7807077632922960.609646118353852
1420.3649297671569050.7298595343138090.635070232843095
1430.2906076493417270.5812152986834540.709392350658273
1440.2512360514133890.5024721028267770.748763948586611
1450.1985726520148690.3971453040297380.80142734798513
1460.1914709214385810.3829418428771620.808529078561419
1470.1251107600447870.2502215200895730.874889239955214
1480.1016427761752060.2032855523504120.898357223824794
1490.05447853505857310.1089570701171460.945521464941427


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


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/1o0cm1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/1o0cm1292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/2grs61292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/2grs61292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/3grs61292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/3grs61292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/4grs61292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/4grs61292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/591aa1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/591aa1292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/691aa1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/691aa1292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/7karv1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/7karv1292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/8karv1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/8karv1292012125.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/9vj8x1292012125.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/10/t1292012078ujcdbvbase33sf3/9vj8x1292012125.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