Home » date » 2010 » Nov » 23 »

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 21:05:07 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz.htm/, Retrieved Tue, 23 Nov 2010 22:03:21 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz.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 «
14 11 12 12 11 7 8 11 6 17 8 14 12 10 8 12 8 12 9 21 10 12 7 12 10 11 4 22 11 11 11 11 16 12 7 10 11 13 7 13 13 14 12 10 12 16 10 8 8 11 10 15 12 10 8 14 11 11 8 10 4 15 4 14 9 9 9 14 8 11 8 11 8 17 7 10 14 17 11 13 15 11 9 7 16 18 11 14 9 14 13 12 14 10 8 14 11 11 8 11 8 15 9 9 9 15 6 11 9 13 9 15 9 16 9 14 9 13 6 13 10 9 6 9 16 18 16 15 11 18 5 10 8 12 7 11 9 17 9 13 16 9 6 8 11 9 6 20 16 12 5 12 12 18 12 10 12 12 7 10 14 18 10 9 9 14 9 14 10 15 8 8 9 16 5 14 10 10 8 11 12 11 8 13 14 14 10 9 14 9 6 11 10 12 8 15 14 17 7 11 16 5 4 10 9 12 8 14 10 12 8 18 6 6 4 14 8 24 20 11 13 12 8 12 10 12 8 13 8 14 6 9 7 7 4 10 15 13 8 15 9 12 9 20 10 13 6 12 12 14 7 12 13 8 9 14 10 11 5 13 11 9 5 11 8 11 8 17 9 13 8 12 13 10 6 13 11 11 8 14 8 12 7 13 9 9 7 15 9 15 9 13 15 18 11 10 9 15 6 11 10 12 8 19 14 13 6 13 12 14 9 17 12 10 8 13 11 13 6 9 14 13 10 11 6 11 8 10 12 13 8 9 8 16 10 12 14 8 5 12 11 16 7 13 10 11 5 13 14 9 8 12 12 16 14 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'RServer@AstonUniversity' @ vre.aston.ac.uk
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
Depression[t] = + 13.7909534342014 -0.0552145384139858Concerns[t] + 0.0174589172036399Expectations[t] -0.068568336220047Criticism[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)13.79095343420141.35912610.146900
Concerns-0.05521453841398580.090769-0.60830.5438650.271932
Expectations0.01745891720363990.0893640.19540.8453560.422678
Criticism-0.0685683362200470.112304-0.61060.5423680.271184


Multiple Linear Regression - Regression Statistics
Multiple R0.0755276090147059
R-squared0.00570441972347828
Adjusted R-squared-0.0131746102817722
F-TEST (value)0.302156399025365
F-TEST (DF numerator)3
F-TEST (DF denominator)158
p-value0.82380333166505
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.18811928962261
Sum Squared Residuals1605.92852756847


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11212.3871779510051-0.387177951005099
21112.7572592423127-1.75725924231265
31413.2079211064190.792078893581017
41212.7544214555096-0.754421455509589
52112.94162910735288.05837089264724
61212.9683367029649-0.968336702964887
72213.15658279442148.84341720557861
81112.6213899024671-1.62138990246707
91012.637049472481-2.63704947248097
101312.93058108175450.0694189182454588
111012.49476924103-2.49476924102997
12812.7220382862913-4.72203828629133
131512.85560185392912.14439814607092
141412.75442145550961.24557854449041
151012.8270949111272-2.82709491112721
161413.55770569371990.442294306280137
171412.83403781732791.16596218267214
181112.9927385263692-1.99273852636917
191013.1660603658111-3.16606036581106
201312.5604997904470.439500209553045
21712.5376684212512-5.53766842125122
221412.46752963082261.53247036917738
231212.6470590584659-0.64705905846587
241412.64399237868161.35600762131838
251112.8270949111272-1.82709491112721
26912.9940058589637-3.99400585896368
271113.1444963292098-2.14449632920984
281512.90387348614242.09612651385758
291412.95625023775331.04374976224666
301313.1095784948026-0.10957849480256
31912.984528287574-3.98452828757401
321512.12468794972242.87531205027761
331013.1550123402128-3.15501234021283
341113.0787657797929-2.07876577979286
351312.9737091549570.0262908450430216
36812.6532410570901-4.6532410570901
372012.929313749167.07068625083997
381212.7741861449211-0.774186144921066
391012.6198194482585-2.61981944825852
401012.8579076261369-2.85790762613692
41912.6465270438706-3.64652704387064
421412.92133240334611.07866759665394
43812.9521451183558-4.95214511835576
441413.23052358263350.769476417366473
451112.8648505323376-1.86485053233756
461312.77188037271320.228119627286771
47912.5766913750561-3.57669137505608
481112.7636701339181-1.76367013391807
491512.89976836674482.10023163325516
501112.8347731353271-1.83477313532714
511012.7205420607156-2.72054206071563
521412.95498290515881.04501709484117
531812.89976836674485.10023163325516
541413.29014636205910.709853637940868
551112.3968844153759-1.39688441537593
561212.7341247515029-0.734124751502883
571312.89976836674480.10023163325516
58913.1822519504202-4.18225195042019
591013.2523907408488-3.25239074084879
601512.64115459187852.35884540812145
612012.88641456893887.11358543106122
621213.0543639563886-1.05436395638857
631212.8928254605442-0.892825460544195
641412.59572074646831.40427925353172
651313.0880144582013-0.0880144582013413
661112.9978820853801-1.99788208538008
671712.99273852636924.00726147363083
681212.9724418223625-0.972441822362466
691312.83634358953570.163656410464303
701412.82709491112721.17290508887279
711313.0787657797929-0.0787657797928587
721512.9711744897682.02882551023205
731312.93879132054970.0612086794503014
741012.5227441692366-2.52274416923661
751113.1444963292098-2.14449632920984
761912.89976836674486.10023163325516
771312.83350580273260.166494197267369
781712.75568878810414.2443112118959
791312.75442145550960.245578544490411
80912.9991494179746-3.99914941797459
811112.5592324578524-1.55923245785244
821013.1031676031971-3.10316760319714
83912.8067982071205-3.80679820712051
841212.9428964399473-0.942896439947277
851212.8147795529345-0.814779552934478
861312.98295783336550.0170421666345391
871313.0880144582013-0.0880144582013413
881212.626533461478-0.626533461477977
891512.44776494141112.55223505858885
902212.96833670296499.03166329703511
911312.71382804749620.286171952503823
921513.24314206244031.7568579375597
931312.99788208538010.00211791461992434
941513.08928179079591.91071820920415
951012.8003873155151-2.80038731551509
961112.7826252766974-1.78262527669741
971612.53483063444823.46516936555184
981112.5646049098445-1.56460490984453
991113.0235512413789-2.02355124137887
1001012.9172272839485-2.91722728394848
1011012.8150084459157-2.81500844591567
1021613.20254865442692.79745134557311
1031212.9400586531442-0.940058653144211
1041112.9254375227436-1.92543752274364
1051612.52431462344523.47568537655484
1061912.86715630454546.1328436954546
1071113.0438479453856-2.04384794538558
1081612.83530514992243.16469485007763
1091512.52558195603972.47441804396032
1102412.81604688552911.183953114471
1111413.07876577979290.921234220207141
1121512.80575976750722.19424023249282
1131112.7521156833018-1.75211568330175
1141512.96446047654852.0355395234515
1151212.8450858429261-0.845085842926083
1161013.2333613694366-3.23336136943659
1171413.2079211064190.792078893581017
1181312.929313749160.0706862508399713
119912.6627186284798-3.66271862847977
1201513.04899150439651.95100849560352
1211513.03153258719281.96846741280716
1221412.91312216455091.0868778354491
1231112.508123038836-1.50812303883604
124813.0425806127911-5.04258061279107
1251112.3463556500105-1.34635565001047
1261112.9318484143491-1.93184841434905
127813.2495529540457-5.24955295404572
1281012.8270949111272-2.82709491112721
1291112.8661178649321-1.86611786493207
1301312.66145129588530.338548704114743
1311112.6563077368744-1.65630773687435
1322012.95498290515887.04501709484117
1331013.1432289966153-3.14322899661533
1341513.23209403684211.76790596315792
1351212.8997683667448-0.89976836674484
1361412.73665941669191.26334058330809
1372312.87126142394310.128738576057
1381412.73822987090051.26177012909954
1391612.94162910735283.05837089264724
1401112.3912830704026-1.39128307040265
1411212.5579651252579-0.55796512525793
1421012.7045793690877-2.70457936908769
1431412.0655971848921.93440281510799
1441212.7421060973169-0.742106097316853
1451212.6157143288609-0.615714328860941
1461112.6881588914974-1.68815889149738
1471212.973709154957-0.973709154956978
1481313.0060923241752-0.00609232417523302
1491112.8864145689388-1.88641456893878
1501912.907978605546.09202139446
1511212.9793847285631-0.97938472856311
1521712.63831680507554.36168319492451
153913.0702524193837-4.07025241938366
1541213.1270374120062-1.1270374120062
1551912.64138348485976.35861651514026
1561813.10957849480264.89042150519744
1571512.66145129588532.33854870411474
1581412.64936483067371.35063516932629
1591112.142146866926-1.14214686692603
1601412.51118971862031.48881028137971
1611112.5702804834507-1.57028048345067
162612.7898713045121-6.7898713045121


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.9746512617516250.050697476496750.025348738248375
80.9485128803701030.1029742392597950.0514871196298975
90.9147166697811150.170566660437770.085283330218885
100.8661609239188280.2676781521623450.133839076081172
110.8019306664555010.3961386670889970.198069333544499
120.7759997311115130.4480005377769730.224000268888487
130.6976300174919620.6047399650160760.302369982508038
140.6130113917182850.773977216563430.386988608281715
150.6395532159279280.7208935681441450.360446784072072
160.7081786323779290.5836427352441430.291821367622071
170.6386992835472060.7226014329055880.361300716452794
180.6548038206086830.6903923587826340.345196179391317
190.6309450230561610.7381099538876770.369054976943839
200.6630366461970190.6739267076059630.336963353802981
210.7057019936366090.5885960127267820.294298006363391
220.7585116960255040.4829766079489910.241488303974496
230.7015531810292290.5968936379415420.298446818970771
240.6599722136092010.6800555727815980.340027786390799
250.6183068564036020.7633862871927960.381693143596398
260.6475941274558930.7048117450882130.352405872544107
270.6159087891841180.7681824216317630.384091210815882
280.5834438631400210.8331122737199580.416556136859979
290.5343738464203960.9312523071592080.465626153579604
300.4739397464635220.9478794929270440.526060253536478
310.5249484593595640.9501030812808720.475051540640436
320.5610169331836950.877966133632610.438983066816305
330.53504281718620.92991436562760.4649571828138
340.499745553558780.999491107117560.50025444644122
350.4425048869319490.8850097738638980.557495113068051
360.4451563322576890.8903126645153790.55484366774231
370.6876941080571680.6246117838856640.312305891942832
380.6430644732168260.7138710535663490.356935526783174
390.6131682731326220.7736634537347550.386831726867378
400.5899398762388290.8201202475223430.410060123761171
410.5735684592204020.8528630815591950.426431540779598
420.5274083528867910.9451832942264180.472591647113209
430.5796274618974540.8407450762050930.420372538102547
440.5395512537081810.9208974925836380.460448746291819
450.5061242670925460.9877514658149070.493875732907454
460.4570592410320070.9141184820640140.542940758967993
470.4475882257378590.8951764514757190.552411774262141
480.4060509733410130.8121019466820260.593949026658987
490.3821033530279460.7642067060558910.617896646972054
500.3448848218428850.689769643685770.655115178157115
510.3211543159104680.6423086318209360.678845684089532
520.2819994874922580.5639989749845160.718000512507742
530.3595558923398640.7191117846797280.640444107660136
540.3181231237300610.6362462474601230.681876876269939
550.2837546341335430.5675092682670860.716245365866457
560.2459259834502240.4918519669004480.754074016549776
570.2092369700055260.4184739400110510.790763029994474
580.2365970053835720.4731940107671430.763402994616428
590.2512471932759520.5024943865519050.748752806724048
600.255386664916230.5107733298324610.74461333508377
610.4296813094384310.8593626188768620.570318690561569
620.3876145176447560.7752290352895130.612385482355244
630.3470397350219670.6940794700439330.652960264978033
640.3127593709415940.6255187418831890.687240629058406
650.272906386456810.5458127729136210.72709361354319
660.2490457190687630.4980914381375260.750954280931237
670.2662905367507460.5325810735014920.733709463249254
680.2328969825291780.4657939650583560.767103017470822
690.2009995266796460.4019990533592920.799000473320354
700.1742719204901810.3485438409803630.825728079509819
710.1461439334121480.2922878668242950.853856066587852
720.1291982493648590.2583964987297170.870801750635141
730.1064122019159640.2128244038319280.893587798084036
740.09761406279410580.1952281255882120.902385937205894
750.08673199018419510.173463980368390.913268009815805
760.1502097036049410.3004194072098820.849790296395059
770.1302495815279950.2604991630559890.869750418472005
780.1562810772837890.3125621545675780.843718922716211
790.1304451559213390.2608903118426780.869554844078661
800.1453715924941540.2907431849883080.854628407505846
810.1265869888764840.2531739777529680.873413011123516
820.1331207023594660.2662414047189330.866879297640534
830.1450346370708820.2900692741417630.854965362929119
840.1227402701830440.2454805403660870.877259729816956
850.103607712628270.207215425256540.89639228737173
860.0871275397289440.1742550794578880.912872460271056
870.07085660905097720.1417132181019540.929143390949023
880.0574397366611210.1148794733222420.94256026333888
890.05335614307946020.106712286158920.94664385692054
900.2122820625535190.4245641251070380.787717937446481
910.1847675370689180.3695350741378370.815232462931082
920.1685054944976140.3370109889952280.831494505502386
930.141294254174530.282588508349060.85870574582547
940.1263702441609160.2527404883218310.873629755839084
950.1224498522076450.244899704415290.877550147792355
960.1089370902439470.2178741804878940.891062909756053
970.1138131591745380.2276263183490750.886186840825462
980.1005309941811240.2010619883622480.899469005818876
990.08942572993787960.1788514598757590.91057427006212
1000.08783643946189570.1756728789237910.912163560538104
1010.08531741999996940.1706348399999390.914682580000031
1020.08037207898722220.1607441579744440.919627921012778
1030.06744773939812390.1348954787962480.932552260601876
1040.0587280274494510.1174560548989020.94127197255055
1050.06034882424042420.1206976484808480.939651175759576
1060.1011612513187550.2023225026375110.898838748681245
1070.08898556626842950.1779711325368590.91101443373157
1080.08803004744063450.1760600948812690.911969952559366
1090.07885510761686840.1577102152337370.921144892383132
1100.4458970979072750.891794195814550.554102902092726
1110.40169786949630.80339573899260.5983021305037
1120.37444087544220.74888175088440.6255591245578
1130.3379431606114570.6758863212229150.662056839388543
1140.3073109249706820.6146218499413640.692689075029318
1150.2694773366375550.538954673275110.730522663362445
1160.2734429210517070.5468858421034150.726557078948292
1170.2339551785082180.4679103570164350.766044821491782
1180.1970151635092870.3940303270185740.802984836490713
1190.2180796590778710.4361593181557430.781920340922129
1200.1967193378716060.3934386757432130.803280662128394
1210.1817215957937630.3634431915875260.818278404206237
1220.1524835490071710.3049670980143420.847516450992829
1230.130154762265540.2603095245310790.86984523773446
1240.1487458040902280.2974916081804560.851254195909772
1250.1247185168621010.2494370337242030.875281483137899
1260.1157633170285940.2315266340571890.884236682971406
1270.1659200382670340.3318400765340690.834079961732966
1280.1587338346132070.3174676692264130.841266165386793
1290.1424070672521720.2848141345043430.857592932747828
1300.1127022297255130.2254044594510270.887297770274487
1310.09398129616338660.1879625923267730.906018703836613
1320.1960769523070920.3921539046141840.803923047692908
1330.2049671564084190.4099343128168390.79503284359158
1340.1711120973594140.3422241947188280.828887902640586
1350.1390128587135660.2780257174271330.860987141286434
1360.1109513806991970.2219027613983940.889048619300803
1370.4881832800579950.976366560115990.511816719942005
1380.4299654630495030.8599309260990070.570034536950497
1390.4355591254988370.8711182509976740.564440874501163
1400.3723499742808280.7446999485616560.627650025719172
1410.3074940944344420.6149881888688840.692505905565558
1420.297853025498040.595706050996080.70214697450196
1430.2403476964455750.4806953928911490.759652303554425
1440.185246489040970.370492978081940.81475351095903
1450.1473473488945660.2946946977891330.852652651105434
1460.1234941760297230.2469883520594450.876505823970277
1470.09539653652823380.1907930730564680.904603463471766
1480.06393226376349960.1278645275269990.9360677362365
1490.04568576843688930.09137153687377860.95431423156311
1500.108910742145130.2178214842902590.89108925785487
1510.07048020806590970.1409604161318190.92951979193409
1520.05112364322254650.1022472864450930.948876356777454
1530.420198065373840.840396130747680.57980193462616
1540.840534066991640.3189318660167190.159465933008359
1550.7291820943527060.5416358112945880.270817905647294


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 level20.0134228187919463OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/10590u1290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/10590u1290546294.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/1zq301290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/1zq301290546294.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/2rz2l1290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/2rz2l1290546294.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/3rz2l1290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/3rz2l1290546294.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/4rz2l1290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/4rz2l1290546294.ps (open in new window)


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/9590u1290546294.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290546197ghhni3y847qcbvz/9590u1290546294.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