Home » date » 2010 » Nov » 23 »

W7 Multiple Regression + depression

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 17:23:55 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0.htm/, Retrieved Tue, 23 Nov 2010 18:40:03 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0.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 26 9 15 6 25 25 11 12 18 20 9 15 6 25 24 12 11 11 21 9 14 13 19 21 15 14 12 31 14 10 8 18 23 10 12 16 21 8 10 7 18 17 12 21 18 18 8 12 9 22 19 11 12 14 26 11 18 5 29 18 5 22 14 22 10 12 8 26 27 16 11 15 22 9 14 9 25 23 11 10 15 29 15 18 11 23 23 15 13 17 15 14 9 8 23 29 12 10 19 16 11 11 11 23 21 9 8 10 24 14 11 12 24 26 11 15 18 17 6 17 8 30 25 15 10 14 19 20 8 7 19 25 12 14 14 22 9 16 9 24 23 16 14 17 31 10 21 12 32 26 14 11 14 28 8 24 20 30 20 11 10 16 38 11 21 7 29 29 10 13 18 26 14 14 8 17 24 7 7 14 25 11 7 8 25 23 11 12 12 25 16 18 16 26 24 10 14 17 29 14 18 10 26 30 11 11 9 28 11 13 6 25 22 16 9 16 15 11 11 8 23 22 14 11 14 18 12 13 9 21 13 12 15 11 21 9 13 9 19 24 12 13 16 25 7 18 11 35 17 11 9 13 23 13 14 12 19 24 6 15 17 23 10 12 8 20 21 14 10 15 19 9 9 7 21 23 9 11 14 18 9 12 8 21 24 15 13 16 18 13 8 9 24 24 12 8 9 26 16 5 4 23 24 12 20 15 18 12 10 8 19 23 9 12 17 18 6 11 8 17 26 13 10 13 28 14 11 8 24 24 15 10 15 17 14 12 6 15 21 11 9 16 29 10 12 8 25 23 10 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Happines[t] = + 21.7347429204207 -0.0180014326985808Concern_over_Mistakes[t] -0.147556651387398Doubts_about_actions[t] + 0.0992260314758162Parental_Expectations[t] -0.0802257256507926Parental_Criticism[t] + 0.0089687156303007Personal_Standards[t] -0.0573688170520963Organization[t] -0.0282446698882794Popularity[t] -0.376605608154422Depression[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)21.73474292042071.8779111.573900
Concern_over_Mistakes-0.01800143269858080.037028-0.48620.6276360.313818
Doubts_about_actions-0.1475566513873980.071178-2.07310.0400550.020027
Parental_Expectations0.09922603147581620.0603011.64550.1021720.051086
Parental_Criticism-0.08022572565079260.076655-1.04660.297150.148575
Personal_Standards0.00896871563030070.0495320.18110.8565830.428292
Organization-0.05736881705209630.050067-1.14580.253870.126935
Popularity-0.02824466988827940.056806-0.49720.6198450.309922
Depression-0.3766056081544220.057887-6.505800


Multiple Linear Regression - Regression Statistics
Multiple R0.592473962328227
R-squared0.35102539603691
Adjusted R-squared0.312850419333199
F-TEST (value)9.19516988212817
F-TEST (DF numerator)8
F-TEST (DF denominator)136
p-value4.56960691508357e-10
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation1.96922665656298
Sum Squared Residuals527.388092988874


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11414.9057707238344-0.905770723834429
21815.41950907534422.58049092465579
31113.6444448548606-2.64444485486064
41213.5015999893043-1.50159998930429
51611.54545303941154.4545469605885
61814.97629032085243.02370967914762
71411.82942976080932.17057023919074
81414.5017035977515-0.50170359775151
91515.5058220966137-0.505822096613653
101513.47019189872391.5298081012761
111714.0877494333772.91225056662302
121915.76708860323033.2329113967697
131012.129577495341-2.12957749534098
141816.23353029884121.76646970115882
151411.79858146150272.20141853849726
161414.0476596618759-0.0476596618758974
171715.07949253475391.92050746524608
181415.8720975137168-1.8720975137168
191614.36780934792751.6321906520725
201815.8899357964552.11006420354499
211413.78913678475430.210863215245652
221212.7276674210026-0.727667421002637
231714.18948859915032.81051140084973
24915.5369024188891-6.53690241888905
251614.69735822192451.3026417780755
261413.66247243910930.337527560890664
271114.155354892651-3.15535489265097
281616.7938894426644-0.79388944266439
291312.80393107924850.196068920751512
301715.20719772151471.79280227848532
311514.86815655773280.131843442267169
321414.1235623065175-0.123562306517452
331615.05087404674170.949125953258345
34910.039407151334-1.03940715133396
351514.06794530267920.93205469732078
361715.50269989681831.49730010318174
371314.263261662473-1.26326166247301
381515.3019272031259-0.301927203125921
391613.63585131630592.36414868369406
401617.3517895627986-1.35178956279863
411214.3099442716745-2.30994427167452
421113.417359988719-2.41735998871901
431515.5469053708189-0.546905370818936
441713.74261220825533.25738779174473
451314.5687296684054-1.56872966840542
461614.95391094818751.04608905181246
471413.75563367699840.244366323001562
481112.7453902986786-1.74539029867862
491212.8064432791371-0.80644327913712
501215.7459765854881-3.74597658548807
511514.80107115097460.198928849025394
521614.33358861482031.66641138517972
531515.9062291570902-0.906229157090205
541215.4890483980866-3.48904839808659
551213.1768869558733-1.17688695587331
56810.4902385518076-2.49023855180762
571315.366514318652-2.36651431865196
581114.1344751449257-3.13447514492569
591414.059484120722-0.0594841207220411
601513.43997297867741.56002702132262
611014.326319825877-4.32631982587699
621112.81323080134-1.81323080134
631213.7698505000775-1.76985050007754
641513.08874029839021.91125970160982
651513.71075907502621.28924092497382
661413.61028640518060.389713594819377
671613.16539115071212.83460884928786
681513.82388098576491.17611901423512
691515.4867245816992-0.486724581699238
701314.9335515331232-1.93355153312318
711714.11194103644112.88805896355893
721312.30370191596210.696298084037921
731513.71169819320751.2883018067925
741315.4980525759228-2.49805257592281
751514.37903364237820.620966357621809
761615.02955112345470.970448876545318
771515.7196914497976-0.719691449797592
781614.76533646528361.23466353471641
791513.98199422781081.01800577218919
801414.0359836981033-0.0359836981032603
811513.0304833215261.96951667847402
8279.9450377803145-2.94503778031449
831714.80663827233832.19336172766168
841313.5513051875617-0.551305187561724
851513.75646016200361.24353983799638
861413.2854388580770.714561141923016
871315.2381705771465-2.23817057714647
881615.87980196694830.120198033051667
891212.8669612219408-0.866961221940764
901415.2957228396481-1.29572283964811
911714.89776692250462.10223307749542
921516.0018512127134-1.00185121271337
931714.60550186651872.39449813348131
941213.0524454276766-1.05244542767659
951614.99702791733811.00297208266189
961114.3954567913681-3.39545679136809
971512.39627295037712.60372704962293
98912.4940741600249-3.49407416002494
991614.42652535231481.57347464768523
1001012.6064222704831-2.60642227048315
1011010.3639885615379-0.363988561537923
1021514.28045718552560.719542814474413
1031113.099388338146-2.09938833814603
1041315.3531336073664-2.35313360736644
1051412.77524631241341.22475368758662
1061814.92793351317763.07206648682239
1071615.45725485575370.542745144246334
1081412.80055011190411.19944988809589
1091413.75050763292220.249492367077826
1101415.6094601110529-1.60946011105287
1111413.90212186424780.097878135752231
1121213.1002087709175-1.1002087709175
1131414.1496355785078-0.149635578507765
1141515.2207136391422-0.220713639142172
1151516.0919227057247-1.09192270572475
1161313.9673315269833-0.967331526983318
1171716.21217235864710.787827641352853
1181715.67109364541051.32890635458947
1191915.08776874544473.91223125455526
1201514.48849014374820.511509856251822
1211314.6104007923928-1.61040079239276
122910.5109744868568-1.51097448685678
1231515.9527440704162-0.952744070416216
1241514.52282247498350.477177525016505
1251613.77220054409922.22779945590084
1261110.36754957580580.632450424194224
1271414.1670521938402-0.167052193840206
1281112.5774290076569-1.57742900765693
1291515.0915058907059-0.0915058907058622
1301313.8910403831401-0.891040383140057
1311612.39192066415323.60807933584677
1321414.4154545998879-0.415454599887913
1331514.64745611961340.352543880386627
1341614.76775773765981.23224226234017
1351615.34457539194220.655424608057795
1361112.7431651465027-1.74316514650273
1371312.6209120934990.37908790650104
1381615.45056943823330.549430561766656
1391214.1024440454568-2.1024440454568
140910.9401466598227-1.94014665982271
1411311.67421670035841.32578329964165
1421313.5513051875617-0.551305187561724
1431413.32291560304850.677084396951531
1441915.08776874544473.91223125455526
1451316.2381814740127-3.23818147401273


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.1391682859983570.2783365719967150.860831714001643
130.1641987176053870.3283974352107730.835801282394613
140.1033450737172820.2066901474345640.896654926282718
150.4730509637241710.9461019274483420.526949036275829
160.3779140426672460.7558280853344920.622085957332754
170.6744527879537930.6510944240924150.325547212046207
180.5868321228820770.8263357542358470.413167877117923
190.7443704265240230.5112591469519530.255629573475977
200.6826096639899380.6347806720201250.317390336010062
210.600581019076670.798837961846660.39941898092333
220.5188995219460690.9622009561078620.481100478053931
230.5863179203341280.8273641593317450.413682079665872
240.9300278858755660.1399442282488670.0699721141244337
250.9048652067877980.1902695864244040.095134793212202
260.8717287635645120.2565424728709750.128271236435488
270.9607280927351730.07854381452965390.0392719072648269
280.9441819857485410.1116360285029170.0558180142514587
290.9382781927958530.1234436144082940.0617218072041472
300.9439159001922610.1121681996154770.0560840998077385
310.9276461807438170.1447076385123650.0723538192561827
320.905994304531820.188011390936360.0940056954681798
330.8813613454226460.2372773091547080.118638654577354
340.8552125840067210.2895748319865570.144787415993279
350.8257139637399650.348572072520070.174286036260035
360.795412574173510.409174851652980.20458742582649
370.7571089591104350.485782081779130.242891040889565
380.759893655920490.480212688159020.24010634407951
390.7902653948447770.4194692103104450.209734605155223
400.8522047376723840.2955905246552330.147795262327616
410.8407825452539670.3184349094920660.159217454746033
420.8685078243827230.2629843512345530.131492175617277
430.8413140465337060.3173719069325880.158685953466294
440.8756396333829360.2487207332341280.124360366617064
450.8584887188419170.2830225623161650.141511281158083
460.8355375676317760.3289248647364470.164462432368224
470.8091499890632160.3817000218735680.190850010936784
480.8485406391098530.3029187217802950.151459360890147
490.8243608941740920.3512782116518160.175639105825908
500.897045963178640.2059080736427190.10295403682136
510.8887760240395930.2224479519208140.111223975960407
520.8860057221161730.2279885557676540.113994277883827
530.8674905964369870.2650188071260270.132509403563013
540.9136938185253660.1726123629492690.0863061814746345
550.8989971360157820.2020057279684370.101002863984218
560.9265088349565060.1469823300869880.0734911650434939
570.9393811243584780.1212377512830440.0606188756415222
580.9568493313514420.08630133729711630.0431506686485582
590.9455913334778490.1088173330443030.0544086665221513
600.94045042358120.1190991528376020.0595495764188008
610.9786656985900040.04266860281999230.0213343014099961
620.9775963344382460.04480733112350820.0224036655617541
630.976205234958640.04758953008272120.0237947650413606
640.9754176642357860.04916467152842810.024582335764214
650.9713552165693710.05728956686125820.0286447834306291
660.962346891020150.07530621795970070.0376531089798504
670.9709095992947940.0581808014104120.029090400705206
680.9664485550872430.06710288982551370.0335514449127569
690.9563446165842240.08731076683155160.0436553834157758
700.956353179649450.08729364070109960.0436468203505498
710.9684654295073770.06306914098524620.0315345704926231
720.959088519263560.08182296147288150.0409114807364408
730.9525747602720530.09485047945589450.0474252397279473
740.9666793035609380.06664139287812450.0333206964390622
750.9568380600625070.08632387987498680.0431619399374934
760.9471719394417620.1056561211164760.0528280605582382
770.937553638423850.1248927231523010.0624463615761505
780.9274978378784310.1450043242431370.0725021621215686
790.912933163268290.1741336734634190.0870668367317093
800.891090472472060.217819055055880.10890952752794
810.8874367923361950.2251264153276110.112563207663805
820.9094063207198420.1811873585603160.0905936792801582
830.9159942458684360.1680115082631290.0840057541315643
840.9033509054201770.1932981891596460.0966490945798228
850.8874038986567280.2251922026865450.112596101343272
860.866073039594610.2678539208107810.133926960405391
870.8729610112393480.2540779775213050.127038988760652
880.849578866890950.3008422662180990.15042113310905
890.821853456889770.3562930862204590.178146543110229
900.8107495016262360.3785009967475280.189250498373764
910.817239127425670.365521745148660.18276087257433
920.7887776135439070.4224447729121860.211222386456093
930.825961322459250.3480773550815020.174038677540751
940.8036786890122970.3926426219754050.196321310987703
950.7697932539231990.4604134921536020.230206746076801
960.8495450696012540.3009098607974920.150454930398746
970.872629843303530.2547403133929410.127370156696471
980.9220292531675510.1559414936648970.0779707468324487
990.908172569315270.1836548613694630.0918274306847313
1000.9160470104625380.1679059790749240.083952989537462
1010.8919706553334690.2160586893330630.108029344666531
1020.8677784280540880.2644431438918240.132221571945912
1030.890010638775990.2199787224480210.10998936122401
1040.931488893916310.1370222121673820.0685111060836908
1050.9465898445830450.106820310833910.0534101554169551
1060.9570837306470140.0858325387059720.042916269352986
1070.9429424119176550.114115176164690.0570575880823448
1080.944700164341590.1105996713168210.0552998356584106
1090.9247903291788460.1504193416423090.0752096708211543
1100.9045158531227520.1909682937544950.0954841468772476
1110.8773640914537790.2452718170924430.122635908546221
1120.8431260804398890.3137478391202230.156873919560111
1130.8080611279630970.3838777440738050.191938872036903
1140.7578643121816570.4842713756366860.242135687818343
1150.7578843521448970.4842312957102060.242115647855103
1160.7203210774792320.5593578450415360.279678922520768
1170.7163170649914210.5673658700171580.283682935008579
1180.7176002602274670.5647994795450650.282399739772533
1190.7681033889409150.463793222118170.231896611059085
1200.7782044467393620.4435911065212760.221795553260638
1210.7187490569251780.5625018861496440.281250943074822
1220.6519457504639720.6961084990720570.348054249536028
1230.5741083329770320.8517833340459360.425891667022968
1240.4951771786081470.9903543572162950.504822821391853
1250.4209434139652190.8418868279304370.579056586034781
1260.4259980504063910.8519961008127820.574001949593609
1270.4128635091881150.825727018376230.587136490811885
1280.3311045074828550.662209014965710.668895492517145
1290.2548457332642430.5096914665284860.745154266735757
1300.1940105366919980.3880210733839970.805989463308001
1310.5041537952679430.9916924094641140.495846204732057
1320.4771543139429140.9543086278858280.522845686057086
1330.8545100301788750.2909799396422510.145489969821125


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level40.0327868852459016OK
10% type I error level180.147540983606557NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/10n2301290533022.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/10n2301290533022.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/49tnr1290533022.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/49tnr1290533022.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/59tnr1290533022.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/59tnr1290533022.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/62k4u1290533022.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290533999ffoaestihubyjj0/62k4u1290533022.ps (open in new window)


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


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


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