Home » date » 2010 » Nov » 22 »

*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: Mon, 22 Nov 2010 19:18:29 +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/22/t129045343264ps8n03nxhw61b.htm/, Retrieved Mon, 22 Nov 2010 20:17:24 +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/22/t129045343264ps8n03nxhw61b.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
5 1 6 5 7 2 1 6 2 3 6 3 6 6 3 6 2 4 4 6 6 3 2 6 2 5 2 7 3 3 5 2 6 5 1 6 2 5 3 2 6 4 6 5 5 5 4 7 4 1 5 1 7 1 6 5 2 4 6 1 6 1 1 6 1 5 3 6 6 2 5 2 4 4 1 6 5 5 6 3 6 2 5 5 2 4 5 6 3 2 5 4 4 5 2 5 2 6 4 2 5 2 3 5 2 6 5 3 6 2 5 1 5 3 1 7 4 5 4 3 6 1 5 5 2 6 3 5 4 3 6 2 5 5 4 6 2 2 6 5 4 1 6 7 2 5 3 7 2 5 6 4 2 4 5 4 3 3 6 1 5 5 6 5 6 5 2 5 5 3 5 1 7 5 4 7 2 5 6 6 7 5 6 6 5 6 1 5 1 5 7 3 3 4 3 6 2 7 2 3 5 3 5 3 5 6 2 5 4 2 4 2 6 5 2 6 3 2 4 3 5 3 7 4 5 5 5 3 3 2 6 3 6 4 4 6 2 7 6 5 5 1 5 4 2 6 6 4 5 2 5 6 6 4 5 5 3 7 5 6 5 5 2 6 6 6 4 2 6 5 6 3 2 4 4 5 2 5 4 3 7 7 2 6 7 6 2 5 4 7 5 2 6 2 5 5 2 2 6 2 6 2 4 5 6 5 3 6 6 6 5 5 4 6 4 6 2 3 5 5 6 5 3 5 2 3 2 3 5 6 5 1 6 5 3 5 3 6 3 2 6 4 5 4 2 5 2 3 1 5 5 4 3 5 3 4 4 2 2 4 5 3 3 6 5 5 2 3 5 7 2 1 5 2 2 6 5 3 6 5 6 2 5 5 6 6 4 2 6 4 6 4 5 3 3 5 4 6 4 6 5 2 6 4 5 6 2 5 4 2 5 2 2 4 5 5 2 6 5 3 6 3 7 2 6 3 5 5 3 5 6 1 5 5 1 3 2 2 6 5 5 2 5 5 2 5 2 6 6 1 6 5 5 3 4 5 2 5 4 2 6 1 4 4 3 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 time11 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Quiet_Outgoing[t] = + 6.61747451124493 -0.219240011126145Use_hands[t] -0.12159210020993Hand_on_hips[t] -0.279781546959985individual[t] + 0.12278254111577Cry[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.617474511244930.6959479.508600
Use_hands-0.2192400111261450.117568-1.86480.0640530.032026
Hand_on_hips-0.121592100209930.09218-1.31910.1890420.094521
individual-0.2797815469599850.091435-3.05990.00260.0013
Cry0.122782541115770.0715671.71560.0881770.044089


Multiple Linear Regression - Regression Statistics
Multiple R0.355223107204072
R-squared0.126183455891716
Adjusted R-squared0.104200649750627
F-TEST (value)5.74009774192846
F-TEST (DF numerator)4
F-TEST (DF denominator)159
p-value0.000242967852694509
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.58435955092612
Sum Squared Residuals399.121034671118


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
164.860252408414821.13974759158517
265.866186918210050.133813081789946
363.626916485445672.37308351455433
444.67641930292288-0.676419302922883
523.50413394432991-1.50413394432991
674.80709323766172.19290676233830
764.001965061510191.99803493848981
854.465070685419790.534929314580211
964.030671014427271.96932898557273
1074.038562408050322.96143759194968
1175.856596055138911.14340394486109
1243.722183514550210.277816485449791
1313.62453560363399-2.62453560363399
1463.723373955456052.27662604454395
1544.28174660847018-0.281746608470179
1653.383732285025811.61626771497419
1753.905507591499821.09449240850018
1864.538774407042291.46122559295771
1943.881563402206100.118436597793896
2064.404529149585951.59547085041405
2134.12474760262596-1.12474760262596
2233.26094974391004-0.260949743910044
2354.683120255640090.316879744359906
2453.845647468029571.15435253197043
2554.027099691709750.972900308290251
2654.186479579365640.813520420634356
2754.151072673731360.848927326268641
2823.99407366788714-1.99407366788714
2963.906016620042072.09398337995793
3075.21084776664331.7891522333567
3124.31045256138725-2.31045256138725
3233.81983142546642-0.819831425466424
3364.251101466459251.74889853354075
3454.247530143741730.752469856258266
3574.491904785067432.50809521493257
3653.897616197876771.10238380212323
3763.410057356131212.58994264386879
3855.514573502897-0.514573502896999
3933.9672395682395-0.967239568239499
4074.867634773495542.13236522650446
4154.931066219683310.0689337803166858
4254.18528913845980.814710861540196
4364.343987613752111.65601238624789
4424.18647957936564-2.18647957936564
4574.651284672723332.34871532727667
4634.31953439591614-1.31953439591614
4764.309262120481411.69073787951859
4873.994073667887143.00592633211286
4954.526121249795880.473878750204121
5043.41913919066010.580860809339901
5164.286508372093541.71349162790646
5274.494285666879112.50571433312089
5323.97131991949927-1.97131991949927
5423.75088946746728-1.75088946746728
5524.30926212048141-2.30926212048141
5654.527311690701720.472688309298281
5723.41243823794289-1.41243823794289
5854.799201844038650.200798155961346
5965.332439866853230.66756013314677
6023.84496605566598-1.84496605566598
6144.3966377559629-0.396637755962899
6264.214504119919131.78549588008087
6343.725754837267730.274245162732271
6434.27385521484713-1.27385521484713
6533.54073129087003-0.54073129087003
6635.05435778934133-2.05435778934133
6764.369122243951661.63087775604834
6864.562718596336001.43728140366400
6953.942104938039941.05789506196006
7035.61222141381321-2.61222141381321
7134.00434594332187-1.00434594332187
7225.18571313644374-3.18571313644374
7334.09172157880336-1.09172157880336
7434.73866030820481-1.73866030820481
7555.74340437709428-0.743404377094284
7633.62929736725735-0.629297367257354
7754.39663775596290.603362244037101
7823.62810692635151-1.62810692635151
7954.34466902611570.655330973884301
8064.652475113629171.34752488637083
8164.772876772933261.22712322706674
8254.18528913845980.814710861540196
8324.77287677293326-2.77287677293326
8464.247530143741731.75246985625827
8575.114390296632921.88560970336708
8655.12636204151574-0.126362041515745
8753.904317150593981.09568284940602
8824.65179370126558-2.65179370126558
8954.124747602625960.875252397374036
9063.722183514550212.27781648544979
9154.345859467021540.654140532978461
9254.404529149585950.595470850414051
9344.4296637797855-0.429663779785504
9454.83341830876710.166581691232901
9544.79801140313281-0.798011403132814
9623.72524580872548-1.72524580872548
9734.65009423181749-1.65009423181749
9855.89251198931545-0.89251198931545
9924.06301562588628-2.06301562588628
10024.250592437917-2.25059243791700
10144.02709969170975-0.0270996917097486
10234.02829013261559-1.02829013261559
10354.493095225973270.506904774026726
10454.465579713962040.534420286037961
10524.1852891384598-2.18528913845980
10654.989226873705470.0107731262945261
10724.02709969170975-2.02709969170975
10865.053848760799080.946151239200916
10923.38373228502581-1.38373228502581
11013.62572604453983-2.62572604453983
11165.90040338293850.0995966170615005
11223.10156985625415-1.10156985625415
11334.00196506151019-1.00196506151019
11453.847346937477661.15265306252234
11544.1606635368025-0.160663536802499
11643.576647225046560.423352774953436
11764.463880244513951.53611975548605
11824.21331367901329-2.21331367901329
11973.714292120927163.28570787907284
12024.18579816700205-2.18579816700205
12154.028290132615590.971709867384411
12234.71233523709942-1.71233523709942
12334.19845132424846-1.19845132424846
12453.905507591499821.09449240850018
12554.28531793118770.7146820688123
12623.72218351455021-1.72218351455021
12743.969620450051180.0303795499488210
12833.62453560363399-0.624535603633994
12923.5041339443299-1.50413394432990
13064.404529149585951.59547085041405
13165.07779295009280.922207049907201
13233.90550759149982-0.905507591499819
13323.56399406780015-1.56399406780015
13465.464813271040140.53518672895986
13564.650094231817491.34990576818251
13625.89370243022129-3.89370243022129
13754.310452561387250.689547438612746
13864.530883013419241.46911698658076
13955.17544086100901-0.175440861009014
14034.71971760218022-1.71971760218022
14175.273597800467481.72640219953252
14254.246339702835890.753660297164106
14344.40452914958595-0.404529149585949
14454.239638750118680.760361249881316
14533.90550759149982-0.905507591499819
14625.24387379046590-3.24387379046590
14754.615877767089040.384122232910956
14863.917479336382642.08252066361736
14954.124747602625960.875252397374036
15023.78510593219573-1.78510593219573
15133.78629637310157-0.78629637310157
15224.1522631146372-2.1522631146372
15364.310452561387251.68954743861275
15463.593890461623072.40610953837693
15523.96774859678175-1.96774859678175
15623.44189293904797-1.44189293904797
15733.7485085856556-0.748508585655604
15844.58666278562972-0.586662785629719
15964.028290132615591.97170986738441
16023.89880663878261-1.89880663878261
16176.122024275876330.877975724123675
16223.87129112677137-1.87129112677137
16324.53088301341924-2.53088301341924
16444.02709969170975-0.0270996917097486


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.8315749199015350.336850160196930.168425080098465
90.7848328890877590.4303342218244820.215167110912241
100.7228325510086640.5543348979826730.277167448991336
110.6219689323310560.7560621353378880.378031067668944
120.5102966716005380.9794066567989230.489703328399462
130.5254888778578240.9490222442843520.474511122142176
140.4752009255246930.9504018510493860.524799074475307
150.4003569872196740.8007139744393480.599643012780326
160.3777206884893680.7554413769787360.622279311510632
170.3361666975397950.672333395079590.663833302460205
180.3640824503668210.7281649007336420.635917549633179
190.35379036802490.70758073604980.6462096319751
200.3182239212257480.6364478424514970.681776078774252
210.3175364101128660.6350728202257320.682463589887134
220.3323638777052410.6647277554104820.667636122294759
230.2681462875361880.5362925750723750.731853712463812
240.2153196866825520.4306393733651040.784680313317448
250.1936709812619800.3873419625239610.80632901873802
260.1510704724210580.3021409448421160.848929527578942
270.1166751695812110.2333503391624230.883324830418789
280.1652999670107710.3305999340215420.834700032989229
290.2180517341092900.4361034682185810.78194826589071
300.1850220430098630.3700440860197250.814977956990137
310.3596072881947080.7192145763894160.640392711805292
320.3680913788616150.736182757723230.631908621138385
330.3327818366543370.6655636733086740.667218163345663
340.2838552360438570.5677104720877150.716144763956143
350.3411676390571660.6823352781143330.658832360942834
360.3091023725424630.6182047450849250.690897627457537
370.3431982693022640.6863965386045280.656801730697736
380.3123539279112910.6247078558225820.687646072088709
390.2946908683617240.5893817367234480.705309131638276
400.3186851454019570.6373702908039140.681314854598043
410.2885084112413370.5770168224826730.711491588758663
420.2509091846991030.5018183693982060.749090815300897
430.2319859342970530.4639718685941060.768014065702947
440.3223095220644380.6446190441288770.677690477935562
450.3330890450184880.6661780900369770.666910954981512
460.3741428523285720.7482857046571440.625857147671428
470.3634184476658520.7268368953317040.636581552334148
480.4454325132871530.8908650265743060.554567486712847
490.3989034095238170.7978068190476330.601096590476183
500.3557821581972470.7115643163944940.644217841802753
510.3360021246517230.6720042493034460.663997875348277
520.3523735815947440.7047471631894880.647626418405256
530.5017381736920620.9965236526158750.498261826307938
540.5574201719035560.8851596561928880.442579828096444
550.643484897408190.713030205183620.35651510259181
560.6019789199131480.7960421601737030.398021080086852
570.6017096664635140.7965806670729710.398290333536486
580.5584554682672830.8830890634654330.441544531732717
590.5187336446707880.9625327106584240.481266355329212
600.5661734744540290.8676530510919420.433826525545971
610.5289343378766890.9421313242466230.471065662123311
620.5259884821300940.9480230357398130.474011517869906
630.4826687994856650.965337598971330.517331200514335
640.477844169731480.955688339462960.52215583026852
650.4383857436664960.8767714873329920.561614256333504
660.5282282109931040.9435435780137920.471771789006896
670.5238176131620260.9523647736759480.476182386837974
680.5110298258120010.9779403483759970.488970174187999
690.4866244547993590.9732489095987170.513375545200641
700.5925144561464460.8149710877071090.407485543853554
710.5735766517949570.8528466964100850.426423348205043
720.7121197961265620.5757604077468770.287880203873438
730.6958927367046940.6082145265906120.304107263295306
740.7070201658653130.5859596682693750.292979834134687
750.6779425093064120.6441149813871760.322057490693588
760.6426042373112850.714791525377430.357395762688715
770.6051955033239460.7896089933521080.394804496676054
780.6096539063518620.7806921872962770.390346093648138
790.575238879545660.849522240908680.42476112045434
800.566788719956310.866422560087380.43321128004369
810.5493648831688080.9012702336623840.450635116831192
820.5187808742226350.962438251554730.481219125777365
830.6128964083126410.7742071833747190.387103591687359
840.623354210441690.7532915791166210.376645789558310
850.6516248782259010.6967502435481980.348375121774099
860.6083553837585470.7832892324829060.391644616241453
870.5908549104490190.8182901791019610.409145089550981
880.6762508945834480.6474982108331030.323749105416551
890.6512143998392540.6975712003214920.348785600160746
900.7053967760727040.5892064478545930.294603223927296
910.6819374351012710.6361251297974580.318062564898729
920.6544402790105770.6911194419788460.345559720989423
930.6197671847283490.7604656305433020.380232815271651
940.5803669555402780.8392660889194440.419633044459722
950.5460519345640320.9078961308719350.453948065435968
960.5433667153909170.9132665692181670.456633284609083
970.5444746312767290.9110507374465410.455525368723271
980.5120464169862920.9759071660274150.487953583013708
990.5482426535618630.9035146928762730.451757346438137
1000.5768294546524220.8463410906951560.423170545347578
1010.5373910385481770.9252179229036460.462608961451823
1020.5082841153824130.9834317692351750.491715884617587
1030.4660292813132020.9320585626264040.533970718686798
1040.4285380979728560.8570761959457110.571461902027144
1050.4577322886172590.9154645772345180.542267711382741
1060.416905201541780.833810403083560.58309479845822
1070.4335871165695850.867174233139170.566412883430415
1080.4056548379020950.8113096758041910.594345162097905
1090.3895146428191170.7790292856382340.610485357180883
1100.4559062374803570.9118124749607140.544093762519643
1110.4151337687303780.8302675374607570.584866231269622
1120.3875125864513850.775025172902770.612487413548615
1130.353489129603860.706978259207720.64651087039614
1140.3292552964990570.6585105929981150.670744703500943
1150.2855172302302140.5710344604604290.714482769769786
1160.2477890402069470.4955780804138930.752210959793054
1170.2783259819617140.5566519639234270.721674018038286
1180.3261886034201830.6523772068403660.673811396579817
1190.470474952041280.940949904082560.52952504795872
1200.5101961150263020.9796077699473960.489803884973698
1210.4924538595958170.9849077191916330.507546140404183
1220.510585142228990.978829715542020.48941485777101
1230.5032610167499160.9934779665001680.496738983250084
1240.5020974593598540.9958050812802920.497902540640146
1250.4613483141723340.9226966283446670.538651685827666
1260.4648278702341870.9296557404683740.535172129765813
1270.4222690038421210.8445380076842420.577730996157879
1280.3716495837522590.7432991675045180.628350416247741
1290.3568067925720430.7136135851440860.643193207427957
1300.3881419710729400.7762839421458810.611858028927060
1310.4182246233351690.8364492466703380.581775376664831
1320.3671047989505260.7342095979010520.632895201049474
1330.4144868847972620.8289737695945240.585513115202738
1340.3577560228906560.7155120457813120.642243977109344
1350.3768616591538390.7537233183076770.623138340846161
1360.6457148342143690.7085703315712630.354285165785631
1370.6383796977561130.7232406044877730.361620302243887
1380.6733202879013760.6533594241972470.326679712098624
1390.6207888196648640.7584223606702730.379211180335136
1400.5662813284104610.8674373431790790.433718671589539
1410.5126028579764910.9747942840470170.487397142023509
1420.4502897456902660.9005794913805320.549710254309734
1430.378677301227540.757354602455080.62132269877246
1440.3306200563071010.6612401126142020.669379943692899
1450.2681532225513560.5363064451027120.731846777448644
1460.2960186613984730.5920373227969460.703981338601527
1470.2392480645285230.4784961290570460.760751935471477
1480.2062757073322750.4125514146645490.793724292667725
1490.1717052810444530.3434105620889060.828294718955547
1500.1434731917241850.286946383448370.856526808275815
1510.09851750935803160.1970350187160630.901482490641968
1520.09154704095853690.1830940819170740.908452959041463
1530.1249890995156120.2499781990312230.875010900484388
1540.5212438535278710.9575122929442590.478756146472129
1550.4986668454713180.9973336909426350.501333154528682
1560.354599517374290.709199034748580.64540048262571


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/Nov/22/t129045343264ps8n03nxhw61b/102t9p1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/102t9p1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/1escd1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/1escd1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/2ojcg1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/2ojcg1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/3ojcg1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/3ojcg1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/4ojcg1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/4ojcg1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/5zstj1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/5zstj1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/6zstj1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/6zstj1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/7ajsm1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/7ajsm1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/8ajsm1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/8ajsm1290453497.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/92t9p1290453497.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129045343264ps8n03nxhw61b/92t9p1290453497.ps (open in new window)


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