Home » date » 2010 » Dec » 18 »

MR - 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: Sat, 18 Dec 2010 17:31:06 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6.htm/, Retrieved Sat, 18 Dec 2010 18:31:02 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6.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 11 26 9 2 1 1 18 12 8 20 9 1 1 1 11 15 12 21 9 4 1 1 12 10 10 31 14 1 1 2 16 12 7 21 8 5 2 1 18 11 6 18 8 1 1 1 14 5 8 26 11 1 1 1 14 16 16 22 10 1 1 1 15 11 8 22 9 1 1 1 15 15 16 29 15 1 1 1 17 12 7 15 14 2 1 2 19 9 11 16 11 1 1 1 10 11 16 24 14 3 2 2 18 15 16 17 6 1 1 1 14 12 12 19 20 1 1 2 14 16 13 22 9 1 1 2 17 14 19 31 10 1 1 1 14 11 7 28 8 1 1 2 16 10 8 38 11 2 1 1 18 7 12 26 14 4 2 2 14 11 13 25 11 1 1 1 12 10 11 25 16 2 1 1 17 11 8 29 14 1 1 2 9 16 16 28 11 2 4 1 16 14 15 15 11 3 1 2 14 12 11 18 12 1 1 1 11 12 12 21 9 1 2 2 16 11 7 25 7 1 2 1 13 6 9 23 13 1 1 2 17 14 15 23 10 1 1 1 15 9 6 19 9 2 1 1 14 15 14 18 9 1 1 2 16 12 14 18 13 1 1 2 9 12 7 26 16 1 1 2 15 9 15 18 12 1 1 2 17 13 14 18 6 1 1 1 13 15 17 28 14 1 1 2 15 11 14 17 14 1 1 2 16 10 5 29 10 2 2 1 16 13 14 12 4 1 1 2 12 16 8 28 12 1 1 1 11 13 8 20 14 1 1 1 15 14 13 17 9 2 1 1 17 14 14 17 9 1 1 1 13 16 16 20 10 1 1 2 16 9 11 31 14 1 1 1 14 8 10 21 10 1 1 2 11 8 10 19 9 1 1 2 12 12 10 23 1 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 time7 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Happiness[t] = + 18.9957165366223 -0.027802499147085Popularity[t] + 0.0455463905768971KnowingPeople[t] -0.00637402452264016CMistakes[t] -0.280840510374424DAction[t] + 0.181746271876873Tobacco[t] -0.914459276859251Drugs[t] -0.762811775254925Gender[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)18.99571653662231.55945912.18100
Popularity-0.0278024991470850.078309-0.3550.7231080.361554
KnowingPeople0.04554639057689710.0661990.6880.4926050.246302
CMistakes-0.006374024522640160.035558-0.17930.8579990.429
DAction-0.2808405103744240.073563-3.81770.0002030.000102
Tobacco0.1817462718768730.2018330.90050.3694470.184723
Drugs-0.9144592768592510.368378-2.48240.0142590.007129
Gender-0.7628117752549250.401175-1.90140.0593430.029672


Multiple Linear Regression - Regression Statistics
Multiple R0.430048346921455
R-squared0.184941580689876
Adjusted R-squared0.143296259995199
F-TEST (value)4.44087301057839
F-TEST (DF numerator)7
F-TEST (DF denominator)137
p-value0.000177261813259388
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.19879831012477
Sum Squared Residuals662.355819179235


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11415.1838316030313-1.18383160303134
21814.87588780741263.12411219258742
31115.5135306633869-4.5135306633869
41212.7854569899845-0.785456989984462
51614.91733371333571.08266628666429
61815.10618608482562.89381391517442
71414.4705801335575-0.47058013355749
81414.8354603760197-0.835460376019715
91514.89094225751440.109057742485613
101513.41444215163621.5855578483638
111712.87694348419874.12305651580128
121914.55974955392624.44025044607376
131012.5245842728517-2.52458427285174
141816.01849503927771.9815049607223
151411.21239000486922.78760999513078
161414.2168499394085-0.216849939408522
171714.97033832534082.02966167465919
181414.3251804549211-0.325180454921148
191614.43682561542731.56317438457275
201812.62260692996415.37739307003592
211414.5378711160821-0.537871116082105
221213.2521245540802-1.25212455408015
231712.67930975872894.32069024127114
24911.9547441598086-2.95474415980857
251614.20997741351991.79002258648013
261414.1827534970653-0.182753497065283
271113.3744282930834-2.37442829308335
281614.47349553725921.52650446274083
291313.1829533025515-0.182953302551449
301714.83914495921432.16085504078565
311515.0563228200996-0.0563228200995568
321414.3156949272231-0.315694927223065
331613.27574038316662.72425961683337
34912.063401921824-3.06340192182395
351513.68553478155921.3144652184408
361715.97663323189541.02336676810457
371312.98439130185520.0156086981447637
381513.02907639646191.97092360353807
391613.72393389791552.2760661020845
401615.81374662452520.186253375474805
411213.8711640835198-1.87116408351985
421113.4438827563934-2.44388275639338
431515.2488831074477-0.248883107447692
441715.11268322614771.88731677385229
451314.0853966498101-1.08539664981007
461613.62161765496342.37838234503663
471414.0281642750027-0.0281642750027282
481114.3217528344224-3.32175283442243
491213.5436559631263-1.54365596312634
501215.0266304790701-3.02663047907007
511515.1942063280719-0.194206328071937
521615.35121196592020.648788034079818
531515.1113719669578-0.111371966957816
541213.0078972731827-1.00789727318273
551213.9167541087356-1.91675410873562
56812.6239617231306-4.62396172313061
571314.3862312588195-1.38623125881954
581114.8003556334316-3.80035563343157
591415.3904512549226-1.39045125492265
601513.74451363578221.25548636421785
611013.9796685196258-3.97966851962584
621114.9184285830303-3.91842858303026
631213.3881385221454-1.38813852214537
641513.66210128020751.33789871979248
651514.55942022191670.440579778083251
661413.23195521499930.76804478500068
671612.70636394877423.29363605122582
681515.6057619488741-0.605761948874105
691515.4100005604537-0.410000560453672
701314.0790226252874-1.07902262528743
711714.75711564391122.2428843560888
721313.3163197666959-0.316319766695937
731513.81515992579991.18484007420015
741314.3141936282855-1.31419362828546
751513.13798295276981.86201704723019
761614.21291616183881.78708383816117
771514.72024967891350.279750321086532
781613.85247585401732.14752414598272
791514.50407763268390.495922367316138
801414.8077247998208-0.807724799820839
811512.7867586762962.21324132370395
82713.2415770178752-6.24157701787518
831715.48468344062411.51531655937586
841316.2435482236232-3.24354822362315
851514.54193873954820.45806126045178
861414.0916607159115-0.0916607159114886
871312.48249890681910.517501093180879
881614.97073209470921.02926790529078
891214.505455814822-2.50545581482197
901415.4631880430515-1.46318804305149
911714.38946587879452.61053412120552
921514.84326634725040.156733652749603
931712.91461703690474.08538296309534
941213.0957942989674-1.09579429896735
951614.13343236834411.86656763165585
961112.7267172565135-1.72671725651345
971514.20228800329440.79771199670562
98913.9461349596996-4.94613495969958
991614.8482084250651.151791574935
1001012.6384430932132-2.63844309321322
1011011.9097875817659-1.9097875817659
1021514.69113592057650.308864079423516
1031114.1189463288907-3.11894632889067
1041315.0133882751135-2.01338827511348
1051412.54612314809311.45387685190692
1061815.20496414969192.79503585030809
1071614.5066278380581.49337216194197
1081413.07268468325980.927315316740199
1091414.1847437244906-0.18474372449059
1101414.5128154083329-0.512815408332923
1111414.0170569178191-0.0170569178190805
1121213.6018834798003-1.6018834798003
1131414.633031520702-0.633031520702015
1141515.0048416954307-0.00484169543073433
1151513.99094871813341.00905128186662
1161312.15820211809120.84179788190879
1171714.20474189333062.79525810666936
1181714.59296389757922.40703610242076
1191915.59963717503453.40036282496553
1201514.53463649610720.465363503892836
1211313.8401108452435-0.84011084524348
122911.9320485170236-2.9320485170236
1231515.1418406191236-0.14184061912357
1241514.59146309938640.408536900613566
1251615.2662935966630.733706403336993
1261113.3044149073808-2.30441490738084
1271413.66260500799720.33739499200285
1281113.5778324867961-2.57783248679606
1291512.45378096124422.54621903875583
1301312.80358392168580.196416078314244
1311612.90742475188483.09257524811517
1321415.6099354605564-1.60993546055644
1331513.98998699450721.01001300549285
1341614.51811675155971.48188324844031
1351614.9873469983761.01265300162401
1361112.4350752898802-1.43507528988019
1371313.4421651686227-0.442165168622658
1381614.20997741351991.79002258648013
1391214.0979678174859-2.09796781748592
140913.4928538066929-4.49285380669292
1411313.0329331774603-0.0329331774602952
1421316.2435482236232-3.24354822362315
1431414.7118651812982-0.71186518129823
1441915.59963717503453.40036282496553
1451315.3188635876083-2.31886358760826


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.2497096611911540.4994193223823090.750290338808846
120.2105053697390870.4210107394781730.789494630260913
130.2320845650031270.4641691300062550.767915434996873
140.3979140591442420.7958281182884850.602085940855758
150.3405525336689040.6811050673378070.659447466331096
160.2411307777969670.4822615555939330.758869222203033
170.5685053132763290.8629893734473420.431494686723671
180.477143418819630.954286837639260.52285658118037
190.5316197417909790.9367605164180420.468380258209021
200.880272593369570.239454813260860.11972740663043
210.8588239759314020.2823520481371960.141176024068598
220.8565929125361130.2868141749277730.143407087463887
230.8900575383457260.2198849233085470.109942461654274
240.9269901301326660.1460197397346670.0730098698673336
250.9042259722009960.1915480555980080.0957740277990038
260.886954838147330.2260903237053390.11304516185267
270.9123359150993830.1753281698012330.0876640849006165
280.8940540313452090.2118919373095830.105945968654791
290.8925132696759280.2149734606481430.107486730324072
300.8840138655915070.2319722688169870.115986134408493
310.8639508344792030.2720983310415950.136049165520797
320.8319344192581550.336131161483690.168065580741845
330.8195058700368740.3609882599262520.180494129963126
340.8878804741593930.2242390516812130.112119525840607
350.8628699310129430.2742601379741140.137130068987057
360.8296483841415020.3407032317169960.170351615858498
370.7894328476575960.4211343046848090.210567152342404
380.7615928060437120.4768143879125770.238407193956288
390.7627963302421380.4744073395157230.237203669757862
400.7196986879833260.5606026240333480.280301312016674
410.6993855338425490.6012289323149020.300614466157451
420.733343664359830.5333126712803390.26665633564017
430.6890939278443040.6218121443113920.310906072155696
440.6644264719708880.6711470560582240.335573528029112
450.6254526657907390.7490946684185220.374547334209261
460.6147103857535580.7705792284928840.385289614246442
470.5851889966375930.8296220067248140.414811003362407
480.7114668017701230.5770663964597540.288533198229877
490.7024817296600430.5950365406799150.297518270339957
500.7472796836437380.5054406327125230.252720316356262
510.7036336855545690.5927326288908630.296366314445431
520.6593469740424820.6813060519150370.340653025957518
530.6189542857303170.7620914285393650.381045714269683
540.5854777700427740.8290444599144510.414522229957226
550.5665666486648290.8668667026703430.433433351335171
560.7575765373067720.4848469253864550.242423462693228
570.7311848847411960.5376302305176080.268815115258804
580.8045270977538560.3909458044922890.195472902246144
590.7908321645848610.4183356708302770.209167835415139
600.7651374312144660.4697251375710680.234862568785534
610.847696118963540.3046077620729190.152303881036459
620.9008366959400280.1983266081199440.099163304059972
630.8865337017423710.2269325965152570.113466298257629
640.8708934980866720.2582130038266570.129106501913328
650.8445751431719010.3108497136561980.155424856828099
660.8163176327890970.3673647344218060.183682367210903
670.8528690979301140.2942618041397720.147130902069886
680.825122749338790.3497545013224210.17487725066121
690.7933451446937760.4133097106124470.206654855306224
700.7687608746399120.4624782507201750.231239125360088
710.76852068284930.46295863430140.2314793171507
720.730247367631710.5395052647365810.26975263236829
730.7006434173953280.5987131652093450.299356582604672
740.6836344530401810.6327310939196370.316365546959819
750.6699730079417850.6600539841164310.330026992058215
760.6513469602014580.6973060795970840.348653039798542
770.6043218702850250.791356259429950.395678129714975
780.5993232632244180.8013534735511630.400676736775582
790.5537720098596330.8924559802807340.446227990140367
800.5118626739953560.9762746520092890.488137326004644
810.5156831305950540.968633738809890.484316869404946
820.7967464231861680.4065071536276630.203253576813832
830.7800976597317650.439804680536470.219902340268235
840.8211514267674210.3576971464651580.178848573232579
850.788076436374560.4238471272508780.211923563625439
860.7498813850448350.5002372299103290.250118614955165
870.7116297426250020.5767405147499950.288370257374998
880.6843006241517720.6313987516964560.315699375848228
890.6899707672688420.6200584654623160.310029232731158
900.6694441381482680.6611117237034640.330555861851732
910.6994322042886880.6011355914226240.300567795711312
920.6525442151702640.6949115696594720.347455784829736
930.8239344216918190.3521311566163630.176065578308181
940.7941130454958340.4117739090083330.205886954504166
950.7956070166502170.4087859666995650.204392983349783
960.777417712911420.445164574177160.22258228708858
970.7525588763752090.4948822472495830.247441123624791
980.8995403489469360.2009193021061280.100459651053064
990.8795893563719210.2408212872561570.120410643628079
1000.8791532132695710.2416935734608570.120846786730429
1010.863336637303990.2733267253920210.13666336269601
1020.8321781795597150.335643640880570.167821820440285
1030.862684777454960.274630445090080.13731522254504
1040.8866339560063670.2267320879872670.113366043993633
1050.891715929862090.216568140275820.10828407013791
1060.9085860510245450.1828278979509090.0914139489754545
1070.8849745832118570.2300508335762870.115025416788143
1080.8989646176273920.2020707647452160.101035382372608
1090.873400859807020.253198280385960.12659914019298
1100.902661080841910.194677838316180.0973389191580902
1110.8829562505870480.2340874988259040.117043749412952
1120.8512056553754830.2975886892490340.148794344624517
1130.810401890037170.3791962199256610.18959810996283
1140.7659761699762120.4680476600475770.234023830023788
1150.7244214854028160.5511570291943680.275578514597184
1160.6655754381788580.6688491236422850.334424561821142
1170.7132527411515180.5734945176969650.286747258848482
1180.690028965807620.619942068384760.30997103419238
1190.7037738182983440.5924523634033130.296226181701656
1200.8022129433252520.3955741133494950.197787056674748
1210.7498430051729310.5003139896541380.250156994827069
1220.8556847425784980.2886305148430030.144315257421502
1230.8216358144493190.3567283711013630.178364185550681
1240.782687972155570.4346240556888590.217312027844429
1250.7119520545844410.5760958908311180.288047945415559
1260.6649056992476850.670188601504630.335094300752315
1270.5768304950714150.846339009857170.423169504928585
1280.5328287288021370.9343425423957260.467171271197863
1290.4376338282128660.8752676564257310.562366171787134
1300.3452989663830090.6905979327660180.654701033616991
1310.4245580443337150.849116088667430.575441955666285
1320.5696083863657090.8607832272685810.430391613634291
1330.4337544574270570.8675089148541140.566245542572943
1340.6469732828913410.7060534342173180.353026717108659


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


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/1gy301292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/1gy301292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/2gy301292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/2gy301292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/398231292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/398231292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/498231292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/498231292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/598231292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/598231292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/6kz2p1292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/6kz2p1292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/7vqjr1292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/7vqjr1292693455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/8vqjr1292693455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/18/t12926934592qyydzseamoeth6/8vqjr1292693455.ps (open in new window)


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