Home » date » 2010 » Dec » 12 »

workshop 10c

*The author of this computation has been verified*
R Software Module: Patrick.Wessa/rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Sun, 12 Dec 2010 13:04:15 +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/12/t1292159150fwui6aku241avp7.htm/, Retrieved Sun, 12 Dec 2010 14:06:00 +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/12/t1292159150fwui6aku241avp7.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 «
11 6 6 4 15 16 2 40 37 15 10 77 26 16 5 4 23 24 1 29 31 9 20 63 26 13 20 10 26 22 1 37 35 12 16 73 15 7 12 6 19 21 1 32 36 15 10 76 10 10 11 5 19 23 1 39 32 17 8 90 21 10 12 8 16 23 1 32 30 14 14 67 27 15 11 9 23 21 2 35 34 9 19 69 21 9 9 9 22 20 2 35 34 12 15 70 21 12 13 8 19 22 1 28 22 11 23 54 21 8 9 11 24 20 1 37 27 13 9 54 22 9 14 6 19 12 2 32 27 16 12 76 29 10 12 8 25 23 2 34 33 16 14 75 29 15 18 11 23 23 2 37 38 15 13 76 29 11 9 5 31 30 1 35 37 10 11 80 30 12 15 10 29 22 2 40 31 16 11 89 19 9 12 7 18 21 1 37 36 12 10 73 19 10 12 7 17 21 1 37 38 15 12 74 22 13 12 13 22 15 2 33 31 13 18 78 18 8 15 10 21 22 2 37 34 18 12 76 28 14 11 8 24 24 1 35 33 13 10 69 17 9 13 6 22 23 2 36 38 17 15 74 18 12 10 8 16 15 2 32 28 14 15 82 20 8 17 7 22 24 1 38 34 13 12 77 16 8 13 5 21 24 2 34 32 13 9 84 17 9 17 9 25 21 2 33 34 15 11 75 25 14 15 11 22 21 2 33 39 15 16 79 22 11 13 11 24 18 2 42 37 13 17 79 34 16 18 11 21 20 2 33 34 14 12 69 31 9 17 9 25 19 2 32 41 13 11 88 38 11 21 7 29 29 2 32 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
Person-Standards[t] = + 3.84738057444685 + 0.328446319879134Mistakes[t] -0.354503027876362Doubts[t] + 0.163700499059318`P-Expectations`[t] + 0.0505586668721037`P-Criticism`[t] + 0.440539729096576Organization[t] + 0.969401241072715Gender[t] + 0.162183660907544connected[t] -0.0530528042838888separate[t] -0.0554072382256775hapiness[t] + 0.0229805470290063depression[t] -0.0305734635206916sport[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.847380574446855.9056110.65150.5158210.25791
Mistakes0.3284463198791340.0579855.664300
Doubts-0.3545030278763620.12082-2.93420.0039180.001959
`P-Expectations`0.1637004990593180.1080131.51560.1319160.065958
`P-Criticism`0.05055866687210370.1360070.37170.710660.35533
Organization0.4405397290965760.0811995.425500
Gender0.9694012410727150.6815771.42230.1571980.078599
connected0.1621836609075440.0936281.73220.0854710.042736
separate-0.05305280428388880.088316-0.60070.5490160.274508
hapiness-0.05540723822567750.155465-0.35640.7220870.361043
depression0.02298054702900630.1162970.19760.8436470.421824
sport-0.03057346352069160.029014-1.05370.2938470.146923


Multiple Linear Regression - Regression Statistics
Multiple R0.63489725645034
R-squared0.403094526248169
Adjusted R-squared0.355515104427371
F-TEST (value)8.47203498534248
F-TEST (DF numerator)11
F-TEST (DF denominator)138
p-value2.73046030230262e-11
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.4320284582129
Sum Squared Residuals1625.47706864169


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11517.0740806190035-2.07408061900347
22320.37153517572182.62846482427823
32623.83420382040492.16579617959509
41919.1361375836983-0.136137583698324
51917.85990997662461.14009002337539
61621.7663106350127-5.76631063501266
72322.54478513041710.45521486958288
82221.64446728487150.355532715128475
91921.3266548035707-2.32665480357069
102422.12230825315301.87769174684696
111918.52622953880900.473770461190965
122525.173089159465-0.173089159464980
132324.7575932040346-1.75759320403456
143126.35079241083324.64920758916675
152925.52644596905333.47355403094668
161820.8603358841111-2.86033588411107
171720.2488931635272-3.24889316352721
182218.64927679816113.35072320183892
192122.6670139427815-1.6670139427815
202423.15399268563760.846007314362358
212221.70606958682650.29393041317349
221616.8601322325904-0.860132232590415
232223.8199561856778-1.81995618567777
242121.8940678964582-0.89406789645821
252521.34544718471453.6545528152855
262221.70156379963420.298436200365845
272421.83026731843352.16973268156649
282124.533620097611-3.53362009761103
292524.24242236461680.757577635383178
302932.0966144885543-3.09661448855428
311918.98499728908660.0150027109133627
322923.21734019103715.78265980896294
332523.75000609351511.24999390648491
341921.6515247674234-2.65152476742336
352724.44463102255212.55536897744787
362523.88299777079821.11700222920184
372320.82478117775392.17521882224607
382422.2196759813781.780324018622
392322.00318275545940.996817244540579
402523.08103587013401.91896412986595
412320.45869800936262.54130199063740
422221.83146655554610.168533444453873
433225.16351040814276.83648959185733
442222.1651352309697-0.165135230969673
451822.5166334929058-4.51663349290582
461919.5390899878252-0.539089987825227
472318.38882328157044.61117671842957
481922.3964936132109-3.39649361321093
491619.697831673144-3.69783167314402
502322.92632141385460.0736785861454138
511719.1138547918179-2.1138547918179
521723.2533948546980-6.25339485469803
532823.23449501729154.7655049827085
542419.02360896591784.97639103408225
552116.60287638656894.39712361343114
561418.1512862601056-4.15128626010555
572121.3879960128425-0.387996012842517
582023.0278722594801-3.02787225948007
592522.28898920260202.71101079739803
602022.2586736671871-2.25867366718711
611719.6152562545267-2.61525625452672
622627.3560883694443-1.35608836944427
631717.1699587552859-0.169958755285926
641722.2473931186814-5.24739311868136
652423.45266197277440.547338027225605
663026.73459312833443.26540687166560
672525.4206022933960-0.420602293395971
681522.381999432999-7.38199943299899
692520.38307065807724.61692934192279
701827.0793329461060-9.07933294610603
712025.8280089161154-5.82800891611541
723228.68880686266433.31119313733570
731416.2529313064501-2.25293130645009
742020.3604589824629-0.360458982462942
752525.1125461880958-0.112546188095794
762523.81874784005581.18125215994420
772522.51931327740832.48068672259173
783522.924396569918612.0756034300814
792924.66927557301224.33072442698776
802524.16519583512680.834804164873185
812122.0832609370322-1.08326093703216
822120.92455188098380.0754481190161932
832424.1246397385776-0.124639738577637
842621.98695359225074.01304640774934
852422.74423434953761.25576565046242
862022.4187044772761-2.41870447727607
872422.01535424813311.98464575186689
881820.1514057651612-2.15140576516123
891717.0438853055198-0.0438853055197641
902225.9721343619424-3.97213436194241
912222.7662670233775-0.766267023377484
922220.68348436400471.31651563599531
932425.2559147275626-1.25591472756256
943225.62017827315916.37982172684093
951917.84581143187721.15418856812280
962121.6633869624894-0.663386962489435
972322.43245300826830.567546991731743
982623.11498595833192.8850140416681
991823.0488720328140-5.04887203281405
1001921.1443370556301-2.14433705563008
1012223.5597892702048-1.55978927020481
1022720.96782140802116.03217859197892
1032121.2005620328168-0.200562032816824
1042022.8546394220854-2.85463942208538
1052124.3554460231998-3.35544602319977
1062024.8628848564903-4.86288485649034
1072924.34537448345214.65462551654795
1083023.40531428105186.59468571894822
1091017.1394165818265-7.13941658182648
1102322.81293466421320.187065335786822
1112920.72771399950638.27228600049367
1121917.85610927040911.14389072959089
1132624.36597094160661.63402905839344
1142222.3815146209505-0.381514620950453
1152624.53025668793471.46974331206527
1162727.3931475092359-0.393147509235885
1171923.7776546605799-4.77765466057991
1182423.64623828282100.353761717179024
1192621.71933756286554.2806624371345
1202221.23680908736680.763190912633181
1212323.4706958555525-0.470695855552488
1222523.93884875622161.06115124377836
1231921.8886884837636-2.88868848376364
1242022.8889528010285-2.88895280102850
1252527.4208080341128-2.42080803411276
1261415.4670098941009-1.4670098941009
1271920.0104786659160-1.01047866591595
1282725.90337781019591.0966221898041
1292124.4784741301668-3.47847413016677
1302120.1442502163850.855749783615
1311420.1815639394191-6.18156393941906
1322124.9376480249430-3.93764802494304
1332320.26493227113842.73506772886163
1341822.114907220133-4.114907220133
1352019.15664201276220.843357987237819
1361923.0840626345285-4.08406263452846
1371518.3728049300077-3.37280493000771
1382321.7344512954961.26554870450399
1392626.6250982146054-0.625098214605373
1402122.7029277856591-1.70292778565911
1411316.1324708726183-3.13247087261825
1422421.73729369590612.26270630409391
1431718.8318118401506-1.83181184015059
1442123.2303674431162-2.23036744311617
1452826.03735921505291.96264078494714
1462221.08193544212180.91806455787817
1472519.76820004455615.23179995544386
1482723.44109680799103.55890319200903
1492520.94093581618764.05906418381244
1502122.5400752264709-1.54007522647091


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
150.505704339954830.988591320090340.49429566004517
160.566741726202390.866516547595220.43325827379761
170.4522988135335190.9045976270670380.547701186466481
180.3321108149921270.6642216299842540.667889185007873
190.2673039097819780.5346078195639560.732696090218022
200.1803894736733020.3607789473466050.819610526326698
210.2436897323855660.4873794647711320.756310267614434
220.2013817836046530.4027635672093070.798618216395347
230.1513835186684020.3027670373368030.848616481331598
240.1017745366444200.2035490732888400.89822546335558
250.1783926995639390.3567853991278790.82160730043606
260.1275366162132360.2550732324264710.872463383786764
270.09634595762297290.1926919152459460.903654042377027
280.1017731359770760.2035462719541510.898226864022924
290.07087321611080770.1417464322216150.929126783889192
300.05038889805576160.1007777961115230.949611101944238
310.03719845580103420.07439691160206830.962801544198966
320.1399578300499390.2799156600998780.860042169950061
330.110207833209750.22041566641950.88979216679025
340.1025684209828430.2051368419656860.897431579017157
350.1041324665278740.2082649330557470.895867533472126
360.07851486373074270.1570297274614850.921485136269257
370.05929689616645510.1185937923329100.940703103833545
380.04367127486080080.08734254972160150.9563287251392
390.03088475139908780.06176950279817550.969115248600912
400.02475977153920340.04951954307840680.975240228460797
410.0208250461045660.0416500922091320.979174953895434
420.01401229265747500.02802458531494990.985987707342525
430.02626480315619950.0525296063123990.9737351968438
440.01815812066990400.03631624133980790.981841879330096
450.03436769627224970.06873539254449930.96563230372775
460.02480171011822320.04960342023644650.975198289881777
470.03302213205352620.06604426410705240.966977867946474
480.02746507164353830.05493014328707660.972534928356462
490.02420335276976560.04840670553953120.975796647230234
500.01707472274850340.03414944549700680.982925277251497
510.01412493770005970.02824987540011950.98587506229994
520.02259058086295250.04518116172590490.977409419137047
530.02604224505955020.05208449011910050.97395775494045
540.03190354164212340.06380708328424690.968096458357877
550.04593659485314740.09187318970629490.954063405146853
560.04740046479384510.09480092958769020.952599535206155
570.03547909228411080.07095818456822160.96452090771589
580.03111873598735250.06223747197470510.968881264012647
590.02825622347077710.05651244694155430.971743776529223
600.02296214665719500.04592429331439010.977037853342805
610.01795803165937500.03591606331874990.982041968340625
620.01750864277648340.03501728555296690.982491357223517
630.01270622286893860.02541244573787730.987293777131061
640.02943272496429810.05886544992859610.970567275035702
650.02178592319992350.04357184639984710.978214076800076
660.02325696155610860.04651392311221730.976743038443891
670.01804927668595830.03609855337191650.981950723314042
680.04814817253526380.09629634507052750.951851827464736
690.07692068951316970.1538413790263390.92307931048683
700.2543967860461520.5087935720923040.745603213953848
710.357136225787790.714272451575580.64286377421221
720.3749817267676870.7499634535353740.625018273232313
730.3601481361710890.7202962723421780.639851863828911
740.3189188952800340.6378377905600690.681081104719966
750.2768701002450210.5537402004900420.723129899754979
760.2461457124540390.4922914249080780.753854287545961
770.2305669893476880.4611339786953770.769433010652312
780.8018917046093650.3962165907812700.198108295390635
790.8497229246816180.3005541506367650.150277075318382
800.8234984650899750.353003069820050.176501534910025
810.7919686724538140.4160626550923720.208031327546186
820.7598871836689970.4802256326620070.240112816331003
830.7271559700321220.5456880599357560.272844029967878
840.7393445895546570.5213108208906860.260655410445343
850.7058305741915750.588338851616850.294169425808425
860.6878347175884440.6243305648231110.312165282411555
870.660359592819590.679280814360820.33964040718041
880.6559347112495670.6881305775008650.344065288750433
890.6069056855810630.7861886288378730.393094314418937
900.6174712691047130.7650574617905740.382528730895287
910.5670455311609290.8659089376781420.432954468839071
920.5191864766440150.961627046711970.480813523355985
930.4816320378629270.9632640757258540.518367962137073
940.5719645562358160.8560708875283690.428035443764184
950.5259161962073050.948167607585390.474083803792695
960.4746467574732580.9492935149465150.525353242526742
970.4235356236899690.8470712473799380.576464376310031
980.4005140372916150.801028074583230.599485962708385
990.4306302082428260.8612604164856520.569369791757174
1000.3899049212141650.779809842428330.610095078785835
1010.3664671331756970.7329342663513930.633532866824303
1020.4729925757883640.9459851515767280.527007424211636
1030.421104957834570.842209915669140.57889504216543
1040.3982437402690890.7964874805381780.601756259730911
1050.3721899565121270.7443799130242540.627810043487873
1060.5031551344905230.9936897310189550.496844865509477
1070.6808330845656090.6383338308687830.319166915434391
1080.7695868992173570.4608262015652850.230413100782643
1090.9257776936909120.1484446126181750.0742223063090876
1100.9019738739349440.1960522521301110.0980261260650557
1110.957410690296510.08517861940698230.0425893097034911
1120.94173695504560.1165260899088010.0582630449544005
1130.9233752585187790.1532494829624420.0766247414812212
1140.8973745123527150.2052509752945700.102625487647285
1150.878187084248830.2436258315023390.121812915751169
1160.8439471182023280.3121057635953450.156052881797672
1170.8557984775972750.2884030448054500.144201522402725
1180.817824910817640.3643501783647190.182175089182360
1190.8909484298572290.2181031402855420.109051570142771
1200.8536627542729160.2926744914541670.146337245727083
1210.8214536421513880.3570927156972240.178546357848612
1220.7732501071042970.4534997857914060.226749892895703
1230.7877323643980660.4245352712038670.212267635601933
1240.7708945767921140.4582108464157710.229105423207885
1250.7142980733958430.5714038532083150.285701926604157
1260.6829262548291130.6341474903417740.317073745170887
1270.5982215405398090.8035569189203820.401778459460191
1280.7015348193770310.5969303612459390.298465180622970
1290.6546426220288610.6907147559422770.345357377971139
1300.7802031562522180.4395936874955650.219796843747782
1310.7052994515979220.5894010968041560.294700548402078
1320.7328309951006790.5343380097986420.267169004899321
1330.742394965380050.5152100692399010.257605034619950
1340.6325282594684020.7349434810631960.367471740531598
1350.4993431992436520.9986863984873040.500656800756348


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level160.132231404958678NOK
10% type I error level330.272727272727273NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/101vs81292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/101vs81292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/153uz1292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/153uz1292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/253uz1292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/253uz1292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/353uz1292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/353uz1292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/4yub21292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/4yub21292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/5yub21292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/5yub21292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/6yub21292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/6yub21292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/7qmt51292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/7qmt51292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/81vs81292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/81vs81292159043.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/91vs81292159043.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/12/t1292159150fwui6aku241avp7/91vs81292159043.ps (open in new window)


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