Home » date » 2010 » Dec » 24 »

Multiple Regression 1

*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: Fri, 24 Dec 2010 21:52:44 +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/24/t1293227520qiiigwaiiepm1g3.htm/, Retrieved Fri, 24 Dec 2010 22:52:12 +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/24/t1293227520qiiigwaiiepm1g3.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 «
12 2 53 10 15 2 7 6 2 11 2 86 12 15 4 5 6 1 14 4 66 11 14 7 7 11 4 12 3 67 10 10 3 3 7 1 21 4 76 12 10 7 7 12 5 12 3 78 12 12 2 7 8 1 22 3 53 14 18 7 7 7 1 11 4 80 14 12 2 1 11 1 10 3 74 11 14 1 4 8 1 13 4 76 11 18 2 5 9 1 10 3 79 13 9 6 6 9 2 8 2 54 11 11 1 4 6 1 15 3 67 10 11 1 7 9 3 10 3 87 14 17 1 6 5 1 14 3 58 14 8 2 2 9 1 14 2 75 12 16 2 2 4 1 11 3 88 11 21 2 6 9 1 10 2 64 10 24 1 7 6 1 13 4 57 12 21 7 5 8 2 7 5 66 10 14 1 2 12 4 12 3 54 14 7 2 7 7 1 14 3 56 12 18 4 4 8 2 11 1 86 13 18 2 5 3 1 9 4 80 13 13 1 5 9 2 11 3 76 12 11 1 5 7 3 15 4 69 14 13 5 3 9 1 13 3 67 11 13 2 5 9 1 9 3 80 12 18 1 1 7 1 15 1 54 13 14 3 1 5 1 10 4 71 11 12 1 3 8 1 11 4 84 11 9 2 2 7 2 13 2 74 14 12 5 3 6 1 8 2 71 12 8 2 2 6 1 20 1 63 13 5 6 5 4 1 12 3 71 11 10 4 2 8 1 10 4 76 13 11 1 3 8 1 10 1 69 13 11 3 4 3 1 9 3 74 13 12 6 6 8 1 14 3 75 12 12 7 2 9 2 8 2 54 14 15 4 7 6 1 14 4 52 14 12 1 6 9 2 11 3 69 8 16 5 5 5 1 13 3 68 13 14 3 3 8 1 11 2 75 11 17 2 3 6 2 11 3 75 13 10 2 4 9 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 time11 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Depressie[t] = + 8.59793305408271 + 0.0318426073277617Leeftijd[t] -0.08663982982343Sportgerelateerde_groep[t] + 0.447620146494133Stress[t] + 0.0387187535662257Verwachtingen_ouders[t] + 0.349162354351205Slaapgebrek[t] + 0.196790971528799Veranderingen_verleden[t] + 0.297703798450042Alcoholgebruik[t] -0.140133754998486Rookgedrag[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)8.597933054082712.861683.00450.0031680.001584
Leeftijd0.03184260732776170.3881240.0820.9347340.467367
Sportgerelateerde_groep-0.086639829823430.023467-3.69190.0003210.000161
Stress0.4476201464941330.1602352.79350.0059670.002983
Verwachtingen_ouders0.03871875356622570.0691040.56030.5761990.2881
Slaapgebrek0.3491623543512050.1307572.67030.0085020.004251
Veranderingen_verleden0.1967909715287990.1369991.43640.1531740.076587
Alcoholgebruik0.2977037984500420.169571.75560.0814020.040701
Rookgedrag-0.1401337549984860.261671-0.53550.5931550.296577


Multiple Linear Regression - Regression Statistics
Multiple R0.504839149613103
R-squared0.254862566982081
Adjusted R-squared0.211030953275144
F-TEST (value)5.81458325231016
F-TEST (DF numerator)8
F-TEST (DF denominator)136
p-value2.20929847349893e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.81913157803836
Sum Squared Residuals1080.86038818385


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11212.7085068466385-0.708506846638536
21111.1895092760968-0.189509276096831
31415.0088389205265-1.00883892052653
41211.33363409029160.66636590970841
52114.59275579797306.40724420202697
61212.0889790925686-0.0889790925686139
72216.83063562584605.16936437415404
81112.5551478994151-1.55514789941511
91011.1258205035630-1.12582050356305
101311.98291558983891.01708441016110
111013.6912316378682-3.69123163786822
12812.1152106351051-4.11521063510513
131511.77633210817373.22366789182629
141010.958989963747-0.95898996374701
151413.87588990856660.124110091433375
161410.29716093753193.70283906246812
171111.2243422568575-0.224342256857453
181011.8949089013240-1.89490890132403
191315.5008229819844-2.50082298198437
20711.811836196059-4.81183619605899
211214.5722777350380-2.57227773503803
221414.1951859091990-0.195185909198954
231110.13000697190930.869993028090667
24911.8487066863526-2.84870668635263
251110.90282439279340.0971756072065696
261514.39256619025020.607433809749803
271312.53723768309090.46276231690912
28910.3203999723451-1.32039997234507
291512.90501257713032.09498742286972
301011.1433541216999-1.14335412169985
31119.615413902670461.38458609732954
321312.96385167756120.0361483224388247
33810.9293778251959-2.92937782519588
342013.31373247734226.68626752265785
351211.88477009876450.115229901235545
361011.5666765120047-1.56667651200474
371011.4842241867665-1.48422418676647
38914.0830170042325-5.08301700423249
391413.26832553960250.731674460397511
40815.2508060664924-7.25080606649244
411414.8803142858654-0.880314285865371
421110.99392571391370.0060742860862548
431313.0424335126655-0.0424335126655072
441110.54032435803440.459675641965627
451112.4264121052642-1.42641210526423
461011.4817469959667-1.48174699596670
471410.20602545998843.79397454001156
481813.82345688407934.17654311592074
491413.31714415178090.68285584821908
501114.9339894199318-3.93398941993175
511212.0502839126430-0.0502839126429844
521312.33966026725480.660339732745223
53913.5828832822197-4.58288328221972
541012.6598039520788-2.65980395207876
551512.75947597662912.24052402337086
562013.98020880473256.01979119526755
571212.1750013662297-0.175001366229745
581212.9527854746640-0.952785474663979
591412.74499087236571.25500912763433
601314.4966154874479-1.49661548744789
611110.74887270249100.251127297509042
621714.60868081922682.39131918077321
631212.5653941228050-0.565394122805016
641314.095181731298-1.09518173129801
651413.80347415670300.196525843297026
661311.34833996930841.65166003069163
671515.872283810791-0.872283810790993
681311.16148917578781.83851082421219
691012.2147822591059-2.21478225910590
701110.47398766150620.526012338493826
711313.4246673852542-0.424667385254207
721713.10836442422963.89163557577041
731314.3044777486017-1.30447774860174
74912.5540127441631-3.55401274416306
751111.0286691726578-0.0286691726578122
761014.1673078759561-4.16730787595614
77911.7221625450496-2.72216254504961
781211.99098262543130.0090173745686921
791211.43835700989300.561642990106977
801311.56177068801691.43822931198314
811312.24418701776260.755812982237403
822215.23412616346656.7658738365335
831313.7564589424249-0.756458942424917
841514.45157292217250.548427077827461
851311.88053297967661.11946702032338
861512.25497646161572.74502353838428
871013.3366595470543-3.33665954705432
881111.0866195895427-0.0866195895426615
891612.34176242733523.65823757266475
901110.97293096819330.0270690318066661
911110.85326061537280.146739384627189
921011.7187604611138-1.71876046111378
931013.1497561172889-3.14975611728886
941614.28016085627861.71983914372139
951212.4736147360917-0.473614736091663
961112.8658886504434-1.86588865044344
971613.61628237994572.38371762005429
981914.07718077338424.92281922661582
991113.1962560069692-2.19625600696921
1001512.73364280189682.26635719810323
1012418.91164994322655.08835005677353
1021410.47858419849373.52141580150634
1031513.79430445263991.20569554736012
1041112.0725347169398-1.07253471693977
1051516.2942577889932-1.29425778899317
1061213.2146544509363-1.21465445093631
107109.65008689042440.349913109575604
1081413.50236605053690.497633949463136
109912.3646848101308-3.36468481013082
1101510.64946541949654.35053458050352
1111512.03401418403022.96598581596976
1121411.23876695599302.76123304400698
1131111.7340910299026-0.734091029902645
114813.5262133692316-5.52621336923162
1151112.0488745326752-1.04887453267518
11689.52754882108194-1.52754882108194
1171011.9813295528431-1.98132955284310
1181113.3863608860011-2.38636088600109
1191315.2821634934785-2.28216349347848
1201113.6097524026495-2.60975240264953
1212013.81448079386646.18551920613357
1221013.0354490618543-3.03544906185427
1231212.1060526399449-0.106052639944856
1241413.14487925634440.855120743655613
1252314.55879576378378.44120423621626
1261413.38232054230090.617679457699054
1271614.38298726937181.61701273062821
1281115.5469871772547-4.54698717725465
1291213.3365112108077-1.33651121080768
1301013.9195061329379-3.91950613293792
1311413.91580621106820.0841937889317513
132128.383735625145293.61626437485471
1331212.9724368034870-0.972436803487024
1341110.40822536008190.591774639918141
1351213.2716892292206-1.27168922922058
1361314.2867069657117-1.28670696571170
1371714.15804139421862.8419586057814
138912.2312638348988-3.23126383489885
1391214.1643264871514-2.16432648715136
1401913.96125778359305.03874221640697
1411514.45157292217250.548427077827461
1421413.96362667563950.0363733243604931
1431113.3863608860011-2.38636088600109
144911.1549499320304-2.15494993203038
1451812.78371806093045.21628193906964


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.2485917067936860.4971834135873710.751408293206314
130.2251645566046980.4503291132093960.774835443395302
140.8946658135208870.2106683729582250.105334186479113
150.8459119774751470.3081760450497060.154088022524853
160.8547096346333740.2905807307332530.145290365366626
170.7876883175419260.4246233649161470.212311682458074
180.7472857074582330.5054285850835350.252714292541767
190.8326895158869410.3346209682261180.167310484113059
200.8724083732187710.2551832535624570.127591626781229
210.8515486234082460.2969027531835080.148451376591754
220.7989034571350820.4021930857298350.201096542864918
230.746746898365810.5065062032683790.253253101634190
240.707530141196730.5849397176065380.292469858803269
250.6389345788160150.722130842367970.361065421183985
260.5769523479085370.8460953041829270.423047652091463
270.5209406434918070.9581187130163860.479059356508193
280.4530471328522510.9060942657045020.546952867147749
290.3938652310471270.7877304620942530.606134768952873
300.342128131101640.684256262203280.65787186889836
310.3058529064651720.6117058129303430.694147093534828
320.2653459966337880.5306919932675770.734654003366211
330.2758061718181270.5516123436362530.724193828181873
340.3852523449314080.7705046898628160.614747655068592
350.3260836272302880.6521672544605770.673916372769712
360.2778076350481790.5556152700963580.722192364951821
370.2843548108999640.5687096217999280.715645189100036
380.4719038872884250.943807774576850.528096112711575
390.4185573844032910.8371147688065820.581442615596709
400.6944560887980350.6110878224039290.305543911201965
410.66527040095280.66945919809440.3347295990472
420.6149381730182940.7701236539634110.385061826981706
430.56385629827150.8722874034570.4361437017285
440.5074636342114520.9850727315770960.492536365788548
450.456165522030920.912331044061840.54383447796908
460.4110339693879260.8220679387758530.588966030612074
470.4297295339817820.8594590679635640.570270466018218
480.574657628445080.850684743109840.42534237155492
490.5328069814910670.9343860370178660.467193018508933
500.549610315169140.900779369661720.45038968483086
510.5010329949981660.9979340100036680.498967005001834
520.4546512450656420.9093024901312850.545348754934358
530.5142243619168950.971551276166210.485775638083105
540.5174564151664090.9650871696671830.482543584833591
550.5126119519349760.9747760961300480.487388048065024
560.6668570527607110.6662858944785780.333142947239289
570.6255597672632840.7488804654734320.374440232736716
580.5796228326089010.8407543347821970.420377167391099
590.5368185677042970.9263628645914070.463181432295703
600.5302537701639850.939492459672030.469746229836015
610.5000695406270400.9998609187459210.499930459372960
620.5026670628440500.9946658743118990.497332937155950
630.4556106208260360.9112212416520720.544389379173964
640.4119597688108110.8239195376216230.588040231189189
650.3653529356931450.730705871386290.634647064306855
660.3365156207744420.6730312415488840.663484379225558
670.3001068098449120.6002136196898250.699893190155088
680.2837730172305530.5675460344611070.716226982769447
690.2680182978663610.5360365957327220.73198170213364
700.2305511604338830.4611023208677660.769448839566117
710.1954505246683340.3909010493366690.804549475331666
720.2390810046654510.4781620093309030.760918995334549
730.2047214049705810.4094428099411610.79527859502942
740.2186225690123110.4372451380246220.781377430987689
750.1840068728917310.3680137457834630.815993127108269
760.2293314889218020.4586629778436040.770668511078198
770.2322170923913690.4644341847827380.767782907608631
780.2016842641362150.403368528272430.798315735863785
790.1716516946097930.3433033892195860.828348305390207
800.1493825820415170.2987651640830340.850617417958483
810.1252135253859790.2504270507719590.87478647461402
820.2878070599832790.5756141199665590.71219294001672
830.2485747286110180.4971494572220350.751425271388982
840.2109295576682040.4218591153364080.789070442331796
850.1810255265603920.3620510531207850.818974473439608
860.1800146437681290.3600292875362580.819985356231871
870.1972624941068110.3945249882136210.80273750589319
880.1652591103564210.3305182207128410.83474088964358
890.1767407994420460.3534815988840920.823259200557954
900.1489777187629970.2979554375259940.851022281237003
910.1209750218289620.2419500436579250.879024978171038
920.1061644107542850.2123288215085690.893835589245715
930.1114536661173250.2229073322346500.888546333882675
940.09537660670190190.1907532134038040.904623393298098
950.07751881243198320.1550376248639660.922481187568017
960.06679454299221870.1335890859844370.933205457007781
970.0658485841232470.1316971682464940.934151415876753
980.09715798721318190.1943159744263640.902842012786818
990.0840451232826020.1680902465652040.915954876717398
1000.07368775825139430.1473755165027890.926312241748606
1010.1272153482025960.2544306964051930.872784651797404
1020.1265190610234980.2530381220469960.873480938976502
1030.1044149597805940.2088299195611880.895585040219406
1040.08291483229827490.1658296645965500.917085167701725
1050.0656672935600230.1313345871200460.934332706439977
1060.05252764429588910.1050552885917780.94747235570411
1070.03923630281533770.07847260563067540.960763697184662
1080.02856353179544770.05712706359089530.971436468204552
1090.03170906670173270.06341813340346540.968290933298267
1100.0559906854717020.1119813709434040.944009314528298
1110.04755116630857570.09510233261715140.952448833691424
1120.04442435347856340.08884870695712680.955575646521437
1130.0321878786685290.0643757573370580.967812121331471
1140.0479595730874780.0959191461749560.952040426912522
1150.03514540092923410.07029080185846820.964854599070766
1160.02816999176153940.05633998352307880.97183000823846
1170.02770736515533920.05541473031067840.97229263484466
1180.02197212032593030.04394424065186060.97802787967407
1190.01687767006664430.03375534013328860.983122329933356
1200.01948363016383180.03896726032766360.980516369836168
1210.04749384238477290.09498768476954580.952506157615227
1220.05999999298153660.1199999859630730.940000007018463
1230.04069026572606580.08138053145213150.959309734273934
1240.0366848337538480.0733696675076960.963315166246152
1250.4321739325887210.8643478651774420.567826067411279
1260.8588159598765430.2823680802469130.141184040123457
1270.8846598888996890.2306802222006220.115340111100311
1280.8322723558777860.3354552882444270.167727644122214
1290.786411344841490.4271773103170190.213588655158509
1300.695284645210310.6094307095793810.304715354789690
1310.7439951065976450.512009786804710.256004893402355
1320.670250880836510.659498238326980.32974911916349
1330.8357021657951580.3285956684096830.164297834204842


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level30.0245901639344262OK
10% type I error level160.131147540983607NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/102yvc1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/102yvc1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/1vfyj1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/1vfyj1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/2vfyj1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/2vfyj1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/367gm1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/367gm1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/467gm1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/467gm1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/567gm1293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/567gm1293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/6hyx61293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/6hyx61293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/7a7e91293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/7a7e91293227552.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/8a7e91293227552.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/24/t1293227520qiiigwaiiepm1g3/8a7e91293227552.ps (open in new window)


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