Home » date » 2010 » Nov » 23 »

Happiness

*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 20:06:26 +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/t1290542891wlut1f03yqmb0jh.htm/, Retrieved Tue, 23 Nov 2010 21:08:22 +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/t1290542891wlut1f03yqmb0jh.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 23 26 9 15 6 11 13 4 18 21 20 9 15 6 12 16 4 11 21 21 9 14 13 15 19 6 12 21 31 14 10 8 10 15 8 16 24 21 8 10 7 12 14 8 18 22 18 8 12 9 11 13 4 14 21 26 11 18 5 5 19 4 14 22 22 10 12 8 16 15 5 15 21 22 9 14 9 11 14 5 15 20 29 15 18 11 15 15 8 17 22 15 14 9 8 12 16 4 19 21 16 11 11 11 9 16 4 10 21 24 14 11 12 11 16 4 18 23 17 6 17 8 15 17 4 14 22 19 20 8 7 12 15 4 14 23 22 9 16 9 16 15 8 17 22 31 10 21 12 14 20 4 14 24 28 8 24 20 11 18 4 16 23 38 11 21 7 10 16 4 18 21 26 14 14 8 7 16 4 14 23 25 11 7 8 11 19 8 12 23 25 16 18 16 10 16 3 17 21 29 14 18 10 11 17 4 9 20 28 11 13 6 16 17 4 16 32 15 11 11 8 14 16 4 14 22 18 12 13 9 12 15 10 11 21 21 9 13 9 12 14 5 16 21 25 7 18 11 11 15 4 13 21 23 13 14 12 6 12 4 17 22 23 10 12 8 14 14 4 15 21 19 9 9 7 9 16 4 14 21 18 9 12 8 15 14 4 16 21 18 13 8 9 12 7 10 9 22 26 16 5 4 12 10 4 15 21 18 12 10 8 9 14 8 17 21 18 6 11 8 13 16 4 13 21 28 14 11 8 15 16 4 15 21 17 14 12 6 11 16 4 16 23 29 10 12 8 10 14 7 16 21 12 4 15 4 13 20 4 12 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 time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Happiness[t] = + 16.0606034156061 + 0.0191423359391710Age[t] -0.0115621244172054Concern_over_mistakes[t] -0.250443166783529Doubts_about_actions[t] + 0.0879285077749663Parental_expectations[t] -0.0909414328317329Parental_criticism[t] + 0.0351776347057642Popularity[t] + 0.0420782212752515Perceived_learning_competence[t] -0.143892749023934Amotivation[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)16.06060341560612.4754156.48800
Age0.01914233593917100.0621210.30810.7584470.379224
Concern_over_mistakes-0.01156212441720540.038417-0.3010.7639030.381952
Doubts_about_actions-0.2504431667835290.077967-3.21220.0016470.000824
Parental_expectations0.08792850777496630.0692611.26950.2064350.103218
Parental_criticism-0.09094143283173290.086108-1.05610.2927960.146398
Popularity0.03517763470576420.0635690.55340.5809190.29046
Perceived_learning_competence0.04207822127525150.0892990.47120.6382530.319126
Amotivation-0.1438927490239340.07338-1.96090.0519470.025974


Multiple Linear Regression - Regression Statistics
Multiple R0.419576907453149
R-squared0.176044781267948
Adjusted R-squared0.127217805343086
F-TEST (value)3.60548196838682
F-TEST (DF numerator)8
F-TEST (DF denominator)135
p-value0.000793486487427386
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.22706924744676
Sum Squared Residuals669.578053444616


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11415.0779522881879-1.07795228818793
21815.27045266134442.72954733865561
31114.4783540692253-3.47835406922526
41212.5815235675167-0.581523567516666
51614.37644930117541.62355069882458
61814.86514029254993.13485970745012
71414.9349117583161-0.934911758316131
81414.5250987612011-0.525098761201125
91514.62334877995960.376651220040392
101512.94155425086172.05844574913827
111713.38573587313873.61426412686132
121913.90386072607035.09613927392967
131013.0394480669619-3.03944806696189
141816.23633848210391.76366151789606
151411.79776307855022.20223692144981
161414.6237786151202-0.623778615120154
171715.13255906608271.86744093391730
181415.0529811587830-1.05298115878296
191614.96600710455251.03399289544749
201813.50316453395634.49683546604375
211413.38021548273070.619784517269298
221212.9257332182720-0.925733218271973
231713.82109808623933.17890191376065
24914.6648587410489-5.66485874104889
251614.57470101784241.42529898215757
261413.20727371630340.792726283696607
271114.5821600313076-3.58216003130761
281615.44535087601060.554649123989363
291313.2210378228577-0.221037822857698
301714.54499589512112.45500410487893
311514.55796940216280.442030597837232
321414.8692849827572-0.869284982757222
331612.16141990450383.83858009549615
34912.5172485435579-3.51724854355791
351513.15546166252641.84453833747362
361715.54648714847181.45351285152818
371313.4976758394431-0.497675839443059
381513.75396004264771.24603995735231
391613.92237669866222.07762330133785
401617.0005388760699-1.00053887606991
411213.8818619789282-1.88186197892816
421113.4296137885327-2.42961378853269
431515.236448799787-0.236448799787013
441714.89270945447062.10729054552944
451314.3111454372712-1.31114543727118
461611.76081508188514.23918491811492
471414.1940192507578-0.194019250757793
481113.4641094884327-2.46410948843266
491213.1752845451896-1.17528454518956
501213.9607429899927-1.96074298999265
511514.02167176795160.978328232048416
521615.12799184727860.872008152721424
531514.81671279937990.183287200620092
541214.9747072136804-2.97470721368041
551214.4392776828147-2.43927768281471
56812.8347214829339-4.83472148293395
571315.3946704295832-2.39467042958323
581114.9065615455410-3.90656154554104
591414.6883104129871-0.688310412987106
601513.17568254469381.82431745530620
611014.0598900072451-4.05989000724508
621112.7631232913734-1.76312329137341
631213.8717481205393-1.87174812053932
641513.16601942813871.83398057186127
651514.51592134943380.484078650566199
661413.77410676568470.225893234315285
671613.21619969965282.78380030034716
681514.95789689096790.0421031090321294
691515.2697013986737-0.269701398673676
701314.848550480332-1.84855048033201
711714.86613845486282.13386154513725
721313.4158267459841-0.415826745984057
731513.78638261614841.21361738385159
741314.6005177994864-1.60051779948635
751514.09765685696140.902343143038571
761614.55895973490701.44104026509302
771514.58319754507570.416802454924332
781614.23955144709581.76044855290416
791514.35685112167360.643148878326449
801414.7749855796484-0.77498557964838
811512.33450924564832.66549075435175
82711.6855997390837-4.6855997390837
831715.00843558837921.99156441162081
841314.5452660368803-1.54526603688032
851513.66039843491831.33960156508174
861413.87864378401470.121356215985340
871313.7439434803704-0.7439434803704
881615.29208550290730.707914497092714
891214.176131274987-2.17613127498700
901415.5628880163819-1.56288801638194
911714.71940502395232.28059497604773
921515.5194923230004-0.519492323000411
931713.2605438712223.73945612877799
941213.9681810482396-1.96818104823960
951615.39733619091040.602663809089637
961114.1190627659778-3.11906276597783
971513.26914647660651.73085352339346
98914.0890899483988-5.08908994839878
991614.75712986567081.2428701343292
1001013.1132570563521-3.11325705635209
1011013.2577107599210-3.25771075992098
1021514.90731246734740.092687532652553
1031113.9705819710362-2.97058197103620
1041315.2290907699082-2.22909076990817
1051413.24481146678800.755188533212036
1061814.65061848287413.34938151712589
1071615.11559461728440.884405382715643
1081412.33460167211981.66539832788022
1091413.17821428813950.821785711860506
1101413.22378719285360.776212807146425
1111414.348938141212-0.348938141211985
1121213.7332718180091-1.73327181800905
1131414.5052954315628-0.505295431562779
1141514.34652880330020.653471196699786
1151514.99975487059200.000245129408036393
1161313.6097461096947-0.609746109694739
1171714.90313518860112.09686481139894
1181715.3821673342171.617832665783
1191914.97678982075554.02321017924451
1201513.88422098595111.11577901404888
1211314.0475514263170-1.04755142631702
122912.2024559719639-3.20245597196392
1231515.0654718210993-0.0654718210993186
1241514.58950601007000.41049398992995
1251613.89010666205192.10989333794814
1261113.3104871668195-2.31048716681952
1271414.6190363894438-0.619036389443828
1281112.6696218413593-1.66962184135928
1291513.40928756841401.59071243158604
1301313.4213314060550-0.42133140605503
1311612.72077674378893.27922325621113
1321414.7040927994066-0.704092799406585
1331514.82534654771490.174653452285116
1341613.05495002415792.94504997584208
1351615.47065745428670.529342545713309
1361112.4370137923298-1.43701379232980
1371314.0417290804259-1.04172908042588
1381614.57470101784241.42529898215757
1391214.0188756070208-2.01887560702079
140911.4175931514257-2.41759315142568
1411311.4875660791741.51243392082600
1421314.5452660368803-1.54526603688032
1431914.97678982075554.02321017924451
1441315.5205134149569-2.52051341495688


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.2907796304809040.5815592609618070.709220369519096
130.1878835847315160.3757671694630320.812116415268484
140.1783081385338290.3566162770676570.821691861466171
150.1379980003792500.2759960007585010.86200199962075
160.1726729983867770.3453459967735540.827327001613223
170.8339216650808170.3321566698383670.166078334919183
180.787209347469020.425581305061960.21279065253098
190.7677474308579050.4645051382841910.232252569142095
200.8123350506714680.3753298986570640.187664949328532
210.7936184050775710.4127631898448580.206381594922429
220.776022159903570.4479556801928600.223977840096430
230.7850598373153540.4298803253692930.214940162684646
240.8991596473100140.2016807053799720.100840352689986
250.8714424082765380.2571151834469230.128557591723462
260.8676718965533910.2646562068932180.132328103446609
270.9260445744588230.1479108510823530.0739554255411766
280.9008558465799120.1982883068401760.0991441534200878
290.8893848983927320.2212302032145350.110615101607268
300.9034646423119890.1930707153760220.096535357688011
310.873682188173570.2526356236528590.126317811826429
320.8441663165581190.3116673668837620.155833683441881
330.8538965758132620.2922068483734750.146103424186738
340.882430442312520.2351391153749600.117569557687480
350.861373844801670.2772523103966580.138626155198329
360.8463420965319410.3073158069361180.153657903468059
370.8182104197892730.3635791604214530.181789580210727
380.7932360793277340.4135278413445310.206763920672266
390.788880209811070.4222395803778580.211119790188929
400.7862335960716620.4275328078566760.213766403928338
410.7553805244190740.4892389511618530.244619475580926
420.795259949904220.4094801001915590.204740050095779
430.756641607953730.4867167840925390.243358392046270
440.7370282645689970.5259434708620060.262971735431003
450.697790751097850.6044184978042990.302209248902150
460.7346858609790640.5306282780418730.265314139020936
470.703926943100560.5921461137988790.296073056899439
480.8318325387768030.3363349224463940.168167461223197
490.8154405328738670.3691189342522660.184559467126133
500.8248269534403990.3503460931192020.175173046559601
510.8011025890580040.3977948218839920.198897410941996
520.7772980635390230.4454038729219530.222701936460977
530.7369692647620870.5260614704758260.263030735237913
540.7677248689347250.464550262130550.232275131065275
550.7680541591596220.4638916816807560.231945840840378
560.8944473699721840.2111052600556310.105552630027816
570.9075166756039970.1849666487920050.0924833243960027
580.943099613673950.1138007726521010.0569003863260505
590.9293616075545570.1412767848908870.0706383924454433
600.9257213796488220.1485572407023570.0742786203511783
610.9571112099592320.08577758008153690.0428887900407684
620.961572649930670.0768547001386580.038427350069329
630.9579808870839470.0840382258321060.042019112916053
640.9543501817434780.09129963651304410.0456498182565221
650.941795293602970.1164094127940600.0582047063970298
660.9256071451259940.1487857097480130.0743928548740063
670.9362313711994820.1275372576010370.0637686288005185
680.9221365762278110.1557268475443780.0778634237721892
690.902255781110510.1954884377789790.0977442188894894
700.897216616108380.2055667677832390.102783383891619
710.8946086664532120.2107826670935760.105391333546788
720.8721132170408250.255773565918350.127886782959175
730.8551080184887250.2897839630225490.144891981511275
740.8484124259811810.3031751480376390.151587574018819
750.8229791485854820.3540417028290360.177020851414518
760.8113577205327350.377284558934530.188642279467265
770.7762858410624970.4474283178750070.223714158937503
780.7584890637571230.4830218724857540.241510936242877
790.7198067009563390.5603865980873220.280193299043661
800.6805953307184340.6388093385631310.319404669281565
810.7094140114061270.5811719771877460.290585988593873
820.8147262490662580.3705475018674830.185273750933742
830.8015750368334260.3968499263331480.198424963166574
840.7813137585316840.4373724829366320.218686241468316
850.7575458457339530.4849083085320940.242454154266047
860.7153648569313840.5692702861372330.284635143068616
870.6748935699109240.6502128601781530.325106430089076
880.6411713402964070.7176573194071860.358828659703593
890.632519710398760.7349605792024790.367480289601240
900.6103654635168370.7792690729663250.389634536483163
910.6099564870432980.7800870259134050.390043512956702
920.5648827069821040.8702345860357910.435117293017896
930.7296258238924820.5407483522150360.270374176107518
940.7090792398490970.5818415203018050.290920760150902
950.6758013763985120.6483972472029770.324198623601488
960.7075268006815460.5849463986369090.292473199318454
970.7172316374191710.5655367251616580.282768362580829
980.9049240423539160.1901519152921680.0950759576460841
990.8902139097498040.2195721805003930.109786090250196
1000.8871172544029180.2257654911941640.112882745597082
1010.8970564044310830.2058871911378340.102943595568917
1020.8679700667201040.2640598665597920.132029933279896
1030.8917256142121950.2165487715756110.108274385787805
1040.9201785007834190.1596429984331610.0798214992165806
1050.9136967868782920.1726064262434160.0863032131217082
1060.9144645816534070.1710708366931860.0855354183465928
1070.8977321520603250.2045356958793510.102267847939675
1080.9239861321129310.1520277357741370.0760138678870685
1090.9058521744471050.1882956511057900.0941478255528952
1100.9077741694915220.1844516610169570.0922258305084784
1110.881030828354660.2379383432906810.118969171645341
1120.8685233114643610.2629533770712770.131476688535639
1130.8336666914294830.3326666171410350.166333308570517
1140.7872344138947140.4255311722105720.212765586105286
1150.7495093304263720.5009813391472560.250490669573628
1160.6891841591229170.6216316817541670.310815840877083
1170.742806991269870.5143860174602610.257193008730130
1180.7633510259805540.4732979480388920.236648974019446
1190.7699987298284860.4600025403430280.230001270171514
1200.776885921308330.446228157383340.22311407869167
1210.7910617307435560.4178765385128890.208938269256444
1220.7486246816433590.5027506367132830.251375318356641
1230.6938399731448760.6123200537102490.306160026855124
1240.6159224103681860.7681551792636270.384077589631814
1250.5434026958022920.9131946083954160.456597304197708
1260.4585017677743940.9170035355487870.541498232225606
1270.3742999508526890.7485999017053780.625700049147311
1280.316368023114010.632736046228020.68363197688599
1290.2480291790997550.4960583581995110.751970820900244
1300.2857234570890420.5714469141780840.714276542910958
1310.7598253649230380.4803492701539250.240174635076962
1320.6956168167533180.6087663664933640.304383183246682


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 level40.0330578512396694OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290542891wlut1f03yqmb0jh/10kk4b1290542775.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290542891wlut1f03yqmb0jh/10kk4b1290542775.ps (open in new window)


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


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


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


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


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


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


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


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


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