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 16:04: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/t1290528232ewo56fymx517bmk.htm/, Retrieved Tue, 23 Nov 2010 17:04:05 +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/t1290528232ewo56fymx517bmk.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 11 12 6 6 53 6 18 12 12 8 13 5 3 86 6 11 15 10 12 16 6 0 66 13 12 10 10 10 11 5 4 67 8 16 12 9 7 12 6 7 76 7 18 11 6 6 9 4 0 78 9 14 5 15 8 12 3 3 53 5 14 16 11 16 16 7 10 80 8 15 11 11 8 12 6 3 74 9 15 15 13 16 18 8 6 76 11 17 12 12 7 12 3 1 79 8 19 9 12 11 11 4 3 54 11 10 11 5 16 14 6 5 67 12 18 15 11 16 11 5 6 87 8 14 12 13 12 12 6 6 58 7 14 16 11 13 14 7 7 75 9 17 14 9 19 12 6 2 88 12 14 11 14 7 13 6 2 64 20 16 10 12 8 11 4 0 57 7 18 7 14 12 12 4 6 66 8 14 11 12 13 11 4 1 54 8 12 10 12 11 12 6 5 56 16 17 11 8 8 13 4 4 86 10 9 16 9 16 16 6 7 80 6 16 14 11 15 16 6 7 76 8 14 12 7 11 15 5 2 69 9 11 12 12 12 14 5 2 67 9 16 11 9 7 13 2 3 80 11 13 6 7 9 11 4 3 54 12 17 14 12 15 13 6 3 71 8 15 9 9 6 12 5 8 84 7 14 15 11 14 15 7 7 74 8 16 12 10 14 13 7 6 71 9 9 12 12 7 11 4 6 63 4 15 9 11 15 15 7 5 71 8 17 13 8 14 14 5 10 76 8 13 15 11 17 16 6 5 69 8 15 11 8 14 15 5 5 74 6 16 10 12 5 13 6 5 75 8 16 13 9 14 14 6 2 54 4 12 16 12 8 14 4 6 69 14 11 13 10 8 8 4 4 68 10 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 time14 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Happiness[t] = + 7.35959823099505 -0.0312731524219015Popularity[t] + 0.125401376884334FindingFriends[t] + 0.0641716190319723KnowingPeople[t] + 0.0499017519535321Liked[t] + 0.0373567347735441Celebrity[t] -0.220050387130058WeightedSum[t] + 0.0785349987054337BelongingtoSports[t] -0.043444033219829ParentalCriticism[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.359598230995052.1180783.47470.0006870.000343
Popularity-0.03127315242190150.090652-0.3450.7306420.365321
FindingFriends0.1254013768843340.1055451.18810.236850.118425
KnowingPeople0.06417161903197230.0744930.86140.3905090.195254
Liked0.04990175195353210.108540.45980.6464270.323213
Celebrity0.03735673477354410.1875950.19910.8424550.421227
WeightedSum-0.2200503871300580.064136-3.4310.0007970.000398
BelongingtoSports0.07853499870543370.0183134.28843.4e-051.7e-05
ParentalCriticism-0.0434440332198290.075098-0.57850.5638830.281942


Multiple Linear Regression - Regression Statistics
Multiple R0.432247937595427
R-squared0.186838279555500
Adjusted R-squared0.139005237176411
F-TEST (value)3.90605050949429
F-TEST (DF numerator)8
F-TEST (DF denominator)136
p-value0.000352998523401538
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.20429805773299
Sum Squared Residuals660.814470116257


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11412.63064772769021.36935227230984
21815.67121085402182.3287891459782
31114.5556800644922-3.55568006449215
41213.7123907102809-1.71239071028086
51613.50929451836242.49070548163755
61814.48630783657333.51369216342671
71413.5935009060680.40649909393199
81414.0600577765307-0.0600577765306574
91514.49178552825470.508214471745308
101514.91502337544080.0849766245591556
111715.28589173037161.71410826962837
121913.09004480502985.90995519497021
131013.2323758582539-3.23237585825389
141815.19705523909612.80294476090392
151413.13817853149190.861821468508111
161413.99177155017090.00822844982914775
171716.04225939591870.957740604081346
181413.81053582648690.189464173513147
191613.93578908589782.06421091410224
201813.93006815736234.06993184263772
211413.72627461216950.273725387830465
221212.6831359311601-0.683135931160116
231714.76969524412342.23030475587655
24914.5189375158183-5.51893751581828
251614.36708689413741.63291310586262
261414.0911456400813-0.0911456400813096
271114.5753523941706-3.57535239417055
281614.46160789410631.53839210589365
291312.38507010659010.614929893409949
301714.83030957015422.16969042984582
311513.90981522433601.09018477566396
321414.1020271080927-0.102027108092653
331613.91164304236092.08835695763911
34913.0903109311337-4.09031093113373
351514.55833341979980.44166658020015
361713.16067289680353.83932710319648
371314.3545127631015-1.35451276310150
381514.30319095827990.696809041720058
391614.18772521008371.81227478991631
401613.52984026686162.47015973313835
411213.215864856373-1.21586485637300
421113.2948129565828-2.29481295658285
431515.2925161847293-0.292516184729268
441714.12553931670852.87446068329151
451313.5801242962764-0.580124296276409
461614.06357400746751.93642599253252
471412.16776919780311.83223080219689
481113.0135840392906-2.01358403929058
491213.2179470675665-1.21794706756645
501212.1337486814449-0.133748681444940
511514.83844378280570.161556217194319
521614.73100836886591.26899163113415
531514.17921643891360.820783561086443
541214.6824299755909-2.68242997559088
551213.4472633566066-1.44726335660660
56813.1637759141025-5.16377591410246
571315.6359178491568-2.63591784915680
581112.4976831330759-1.49768313307586
591413.84283258271670.157167417283339
601513.47687019912641.52312980087361
611015.0015334687176-5.00153346871761
621113.5281970684520-2.52819706845204
631214.6511036793256-2.65110367932557
641512.71734383188432.28265616811568
651514.1701274712170.829872528783
661415.2229102072091-1.22291020720913
671613.11575022730802.88424977269197
681516.3805412291863-1.38054122918627
691515.1149056444681-0.114905644468148
701314.4493269759958-1.44932697599577
711715.21333568173511.78666431826486
721313.6736123056363-0.673612305636337
731513.67192223709811.32807776290185
741312.79552420594140.204475794058628
751513.36587224284531.63412775715468
761611.32446083711874.67553916288129
771513.48355317757841.51644682242161
781613.53775034953592.46224965046407
791513.33033936296751.66966063703248
801413.80334638597100.19665361402898
811513.72503021753931.27496978246073
82714.1976137481222-7.19761374812221
831714.34182393804112.6581760619589
841312.96129929421130.0387007057887043
851514.47670999972570.523290000274294
861415.5170480641489-1.51704806414889
871314.4464043795154-1.44640437951538
881615.09086686324880.909133136751205
891213.5123923112252-1.51239231122517
901414.0184543050635-0.0184543050635022
911714.71345066192712.28654933807286
921514.24292143383530.75707856616466
931715.19391801358871.80608198641128
941214.5707264754630-2.57072647546302
951614.93214179444731.06785820555272
961113.3548781289606-2.35487812896058
971514.59160246969450.408397530305549
98913.2045493226285-4.20454932262847
991614.53147031998341.46852968001657
1001012.1996838587030-2.19968385870295
1011011.6404511988986-1.64045119889855
1021515.1155685243875-0.11556852438751
1031112.5692849764924-1.56928497649244
1041315.3163729002433-2.3163729002433
1051413.43774223839470.562257761605252
1061814.06480656872363.93519343127644
1071615.19941418473240.80058581526756
1081412.45875782510361.54124217489639
1091414.0538509401887-0.053850940188737
1101414.5339876395488-0.533987639548811
1111415.6563292165257-1.65632921652571
1121212.3230772073644-0.323077207364429
1131414.6040619296622-0.60406192966222
1141516.4688541909947-1.46885419099471
1151514.04256257592760.957437424072445
1161314.9055139128044-1.90551391280445
1171716.30431840063750.695681599362526
1181715.96238816538381.03761183461622
1191916.15555051345662.84444948654337
1201514.08745541889010.91254458110993
1211313.6902410989869-0.690241098986853
122912.8002569554608-3.80025695546077
1231514.68600553460380.313994465396165
1241513.99646211094981.00353788905025
1251615.80844843482030.191551565179657
1261112.3320729711756-1.33207297117563
1271413.95301217899830.046987821001694
1281112.2086825899907-1.20868258999070
1291513.56357988243171.43642011756828
1301314.0662310454359-1.06623104543591
1311613.98454902910492.01545097089508
1321414.8209861057312-0.820986105731151
1331514.60931280928560.390687190714361
1341616.0856483530275-0.0856483530275327
1351614.81320959765841.18679040234155
1361113.9799157282784-2.97991572827842
1371315.0929140244885-2.09291402448847
1381614.36708689413741.63291310586262
1391215.4450075085444-3.4450075085444
140913.3108996936204-4.31089969362043
1411314.1870981451331-1.18709814513312
1421312.96129929421130.0387007057887043
1431413.28683033206540.713169667934567
1441916.15555051345662.84444948654337
1451315.1224291434151-2.12242914341513


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.9022546256365450.195490748726910.097745374363455
130.8297107070069440.3405785859861110.170289292993056
140.7615635689378730.4768728621242540.238436431062127
150.6713883810961390.6572232378077230.328611618903861
160.5938016692511220.8123966614977560.406198330748878
170.4885079422231450.9770158844462890.511492057776855
180.5970000338129080.8059999323741850.402999966187092
190.5183057265638260.9633885468723470.481694273436174
200.4962752430472890.9925504860945790.503724756952711
210.4257545565589190.8515091131178380.574245443441081
220.3857109545981670.7714219091963330.614289045401833
230.3242983220587280.6485966441174560.675701677941272
240.5744280414539880.8511439170920230.425571958546012
250.6118180915793030.7763638168413950.388181908420697
260.6018943715221660.7962112569556680.398105628477834
270.6936982480299310.6126035039401380.306301751970069
280.6361263156382230.7277473687235540.363873684361777
290.5696568861308110.8606862277383770.430343113869189
300.568372205332840.863255589334320.43162779466716
310.5376255984577330.9247488030845350.462374401542267
320.4747044544631180.9494089089262350.525295545536882
330.4583902596890950.9167805193781910.541609740310905
340.723977494780460.552045010439080.27602250521954
350.6728348023607130.6543303952785730.327165197639287
360.7715466048116080.4569067903767840.228453395188392
370.7298083944621860.5403832110756280.270191605537814
380.6882646644484750.623470671103050.311735335551525
390.6530399913097910.6939200173804180.346960008690209
400.7625712931229570.4748574137540860.237428706877043
410.7210079071357540.5579841857284920.278992092864246
420.7791765243578170.4416469512843650.220823475642183
430.735495096091320.5290098078173590.264504903908679
440.7576321651056270.4847356697887450.242367834894373
450.714303753321090.5713924933578220.285696246678911
460.6863327731682920.6273344536634150.313667226831708
470.685033717662990.6299325646740210.314966282337011
480.6850311419661020.6299377160677960.314968858033898
490.6439808189144430.7120383621711140.356019181085557
500.6021102997082020.7957794005835960.397889700291798
510.5501393053604790.8997213892790420.449860694639521
520.5092325959004220.9815348081991560.490767404099578
530.4618070583040950.923614116608190.538192941695905
540.5185050584174180.9629898831651640.481494941582582
550.4776408239873350.955281647974670.522359176012665
560.7246168480836460.5507663038327070.275383151916354
570.8225359503657630.3549280992684750.177464049634237
580.8019192512759560.3961614974480880.198080748724044
590.7653884819995360.4692230360009290.234611518000464
600.7609168291237330.4781663417525340.239083170876267
610.9238418103204480.1523163793591050.0761581896795523
620.926676544427270.1466469111454610.0733234555727303
630.9352380718914270.1295238562171460.0647619281085728
640.9353898641872820.1292202716254350.0646101358127176
650.9203150704942820.1593698590114360.0796849295057181
660.9055053960592440.1889892078815130.0944946039407564
670.9211419170968320.1577161658063350.0788580829031677
680.9091951390763650.1816097218472700.0908048609236348
690.886946652126730.2261066957465390.113053347873269
700.8722370171585660.2555259656828670.127762982841434
710.8653377210239610.2693245579520780.134662278976039
720.8389358096932690.3221283806134630.161064190306731
730.8196583104459450.3606833791081110.180341689554055
740.785066182743640.4298676345127210.214933817256360
750.770670660086650.4586586798267010.229329339913351
760.8939975949185270.2120048101629460.106002405081473
770.8857490231879440.2285019536241120.114250976812056
780.8878048199433330.2243903601133340.112195180056667
790.883117305342550.23376538931490.11688269465745
800.8586059176779760.2827881646440480.141394082322024
810.8437907075874630.3124185848250750.156209292412537
820.9894414761571660.02111704768566840.0105585238428342
830.9910595345126260.01788093097474780.0089404654873739
840.9878332567663880.02433348646722340.0121667432336117
850.983811306815740.03237738636852150.0161886931842607
860.9808874330784950.03822513384300940.0191125669215047
870.976602191277030.0467956174459410.0233978087229705
880.9708246768996130.05835064620077310.0291753231003866
890.964900682226480.07019863554703890.0350993177735195
900.9534952969063160.09300940618736840.0465047030936842
910.9625909803261170.07481803934776660.0374090196738833
920.953420744073350.09315851185330040.0465792559266502
930.9519024810282530.09619503794349380.0480975189717469
940.9573885204963440.08522295900731190.0426114795036559
950.9557761177640620.08844776447187650.0442238822359383
960.9524455563174330.0951088873651340.047554443682567
970.9390843075452450.1218313849095110.0609156924547554
980.9650618705183020.06987625896339650.0349381294816982
990.9580517377452720.08389652450945580.0419482622547279
1000.9514641792602880.0970716414794230.0485358207397115
1010.9398343426250240.1203313147499510.0601656573749757
1020.9204513697395050.1590972605209910.0795486302604953
1030.9058389767719380.1883220464561230.0941610232280616
1040.9186975316515370.1626049366969270.0813024683484635
1050.8954353966817180.2091292066365640.104564603318282
1060.9526602310991570.09467953780168510.0473397689008426
1070.943179402223770.113641195552460.05682059777623
1080.9546851347791260.0906297304417490.0453148652208745
1090.9371595147701560.1256809704596870.0628404852298436
1100.919668322433930.1606633551321410.0803316775660707
1110.8986916725296450.2026166549407110.101308327470356
1120.8658826803448780.2682346393102450.134117319655122
1130.8377573035786970.3244853928426070.162242696421303
1140.8194549600895830.3610900798208340.180545039910417
1150.7943067443836950.4113865112326090.205693255616305
1160.772929201840990.4541415963180220.227070798159011
1170.726147822757370.5477043544852590.273852177242630
1180.6730930203158730.6538139593682540.326906979684127
1190.6700524803394410.6598950393211190.329947519660559
1200.6382982043793470.7234035912413060.361701795620653
1210.563644417668250.8727111646634990.436355582331749
1220.6001654911837950.7996690176324090.399834508816204
1230.5181158927708910.9637682144582170.481884107229109
1240.4548089887293140.9096179774586270.545191011270686
1250.3735536017691840.7471072035383680.626446398230816
1260.2971587710153860.5943175420307720.702841228984614
1270.2905372498947240.5810744997894470.709462750105276
1280.2130608573330200.4261217146660390.78693914266698
1290.2392433636731530.4784867273463060.760756636326847
1300.1715846720819380.3431693441638750.828415327918062
1310.1909427772903520.3818855545807040.809057222709648
1320.2223287777730380.4446575555460760.777671222226962
1330.1257956731347870.2515913462695730.874204326865213


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level60.0491803278688525OK
10% type I error level200.163934426229508NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/109bm31290528231.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/109bm31290528231.ps (open in new window)


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/75b5y1290528231.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/75b5y1290528231.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/9ykmi1290528231.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528232ewo56fymx517bmk/9ykmi1290528231.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by