Home » date » 2010 » Nov » 24 »

Workshop 7

*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: Wed, 24 Nov 2010 00:07:56 +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/24/t12905572671xw8og12apuht1z.htm/, Retrieved Wed, 24 Nov 2010 01:07:58 +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/24/t12905572671xw8og12apuht1z.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 12 53 18 11 86 11 14 66 12 12 67 16 21 76 18 12 78 14 22 53 14 11 80 15 10 74 15 13 76 17 10 79 19 8 54 10 15 67 16 14 54 18 10 87 14 14 58 14 14 75 17 11 88 14 10 64 16 13 57 18 7 66 11 14 68 14 12 54 12 14 56 17 11 86 9 9 80 16 11 76 14 15 69 15 14 78 11 13 67 16 9 80 13 15 54 17 10 71 15 11 84 14 13 74 16 8 71 9 20 63 15 12 71 17 10 76 13 10 69 15 9 74 16 14 75 16 8 54 12 14 52 12 11 69 11 13 68 15 9 65 15 11 75 17 15 74 13 11 75 16 10 72 14 14 67 11 18 63 12 14 62 12 11 63 15 12 76 16 13 74 15 9 67 12 10 73 12 15 70 8 20 53 13 12 77 11 12 77 14 14 52 15 13 54 10 11 80 11 17 66 12 12 73 15 13 63 15 14 69 14 13 67 16 15 54 15 13 81 15 10 69 13 11 84 12 19 80 17 13 70 13 17 69 15 13 77 13 9 54 15 11 79 16 10 30 15 9 71 16 12 73 15 12 72 14 13 77 15 13 75 14 12 69 13 15 54 7 22 70 17 13 73 13 15 54 15 13 77 14 15 82 13 10 80 16 11 80 12 16 69 14 11 78 17 11 81 15 10 76 17 10 76 12 16 73 16 12 85 11 11 66 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'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Belonging[t] = + 65.5915982474038 + 0.889722068030321Happiness[t] -0.570504968361378Depression[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)65.59159824740388.5983157.628400
Happiness0.8897220680303210.4110342.16460.0319110.015955
Depression-0.5705049683613780.303472-1.87990.0619470.030974


Multiple Linear Regression - Regression Statistics
Multiple R0.318675284277338
R-squared0.101553936809242
Adjusted R-squared0.0902527284672199
F-TEST (value)8.98611314257667
F-TEST (DF numerator)2
F-TEST (DF denominator)159
p-value0.000200731161597245
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation10.2279857720870
Sum Squared Residuals16633.2591796883


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
15371.2016475794921-18.2016475794921
28675.331040819974410.6689591800256
36667.391471438678-1.39147143867804
46769.4222034434311-2.42220344343110
57667.84654700038.15345299970001
67874.7605358516133.23946414838697
75365.496597895878-12.4965978958780
88071.77215254785318.22784745214688
97473.23237958424480.767620415755177
107671.52086467916074.47913532083931
117975.01182372030553.98817627969454
125477.9322777930889-23.9322777930889
136765.93124440228631.06875559771367
145471.8400817788296-17.8400817788296
158775.901545788335811.0984542116642
165870.060637642769-12.060637642769
177570.0606376427694.93936235723101
188874.441318751944113.5586812480559
196472.3426575162145-8.3426575162145
205772.410586747191-15.410586747191
216677.6130606934199-11.6130606934199
226867.3914714386780.608528561321973
235471.2016475794917-17.2016475794917
245668.2811935067083-12.2811935067083
258674.441318751944111.5586812480559
268068.464552144424311.5354478555757
277673.55159668391382.44840331608623
286969.4901326744076-0.490132674407613
297870.95035971079937.04964028920069
306767.9619764070394-0.961976407039405
318074.69260662063655.30739337936348
325468.6004106063773-14.6004106063773
337175.0118237203055-4.01182372030546
348472.661874615883411.3381253841166
357470.63114261113043.36885738886963
367175.2631115889979-4.2631115889979
376362.18899749244910.811002507550883
387172.091369647522-1.09136964752207
397675.01182372030550.988176279694535
406971.4529354481842-2.45293544818418
417473.80288455260620.197115447393799
427571.84008177882963.15991822117037
435475.2631115889979-21.2631115889979
445268.2811935067083-16.2811935067083
456969.9927084117925-0.992708411792482
466867.96197640703940.038023592960595
476573.8028845526062-8.8028845526062
487572.66187461588342.33812538411655
497472.15929887849861.84070112150142
507570.88243047982284.1175695201772
517274.1221016522751-2.12210165227514
526770.060637642769-3.06063764276899
536365.1094515652325-2.10945156523252
546268.2811935067083-6.28119350670835
556369.9927084117925-6.99270841179248
567672.0913696475223.90863035247793
577472.4105867471911.58941325280899
586773.8028845526062-6.8028845526062
597370.56321338015392.43678661984614
607067.7106885383472.28931146165303
615361.2992754244188-8.2992754244188
627770.31192551146146.68807448853858
637768.53248137540088.46751862459922
645270.060637642769-18.060637642769
655471.5208646791607-17.5208646791607
668068.213264275731811.7867357242682
676665.67995653359390.320043466406106
687369.42220344343113.57779655656890
696371.5208646791607-8.52086467916069
706970.9503597107993-1.95035971079931
716770.6311426111304-3.63114261113037
725471.2695768104683-17.2695768104683
738171.52086467916079.4791353208393
746973.2323795842448-4.23237958424482
758470.882430479822813.1175695201772
768065.428668664901514.5713313350985
777073.3003088152213-3.30030881522133
786967.45940066965451.54059933034546
797771.52086467916075.47913532083931
805472.0234404165456-18.0234404165456
817972.66187461588346.33812538411655
823074.1221016522751-44.1221016522751
837173.8028845526062-2.8028845526062
847372.98109171555240.0189082844476121
857272.091369647522-0.0913696475220673
867770.63114261113046.36885738886963
877571.52086467916073.47913532083931
886971.2016475794917-2.20164757949175
895468.6004106063773-14.6004106063773
907059.268543419665710.7314565803343
917373.3003088152213-0.300308815221332
925468.6004106063773-14.6004106063773
937771.52086467916075.47913532083931
948269.490132674407612.5098673255924
958071.45293544818428.54706455181582
968073.55159668391386.44840331608623
976967.14018356998561.85981643001441
987871.77215254785316.22784745214688
998174.44131875194416.55868124805591
1007673.23237958424482.76762041575518
1017675.01182372030550.988176279694535
1027367.14018356998565.8598164300144
1038572.981091715552412.0189082844476
1046669.1029863437622-3.10298634376216
1057969.80934977407669.19065022592344
1066862.75950246081055.2404975391895
1077673.55159668391382.44840331608623
1087169.80934977407661.19065022592344
1095465.9312444022863-11.9312444022863
1104660.7966996870339-14.7966996870339
1118270.950359710799311.0496402892007
1127466.82096647031667.17903352968335
1138870.882430479822817.1175695201772
1143869.4901326744076-31.4901326744076
1157674.7605358516131.23946414838697
1168674.122101652275111.8778983477249
1175470.060637642769-16.060637642769
1187070.6311426111304-0.631142611130368
1196972.9131624845759-3.91316248457588
1209069.490132674407620.5098673255924
1215467.710688538347-13.7106885383470
1227670.0606376427695.93936235723101
1238972.661874615883416.3381253841166
1247674.37338952096761.62661047903242
1257372.66187461588340.338125384116555
1267970.88243047982288.1175695201772
1279076.152833657028213.8471663429718
1287475.0118237203055-1.01182372030547
1298176.22076288800474.77923711199527
1307271.52086467916070.47913532083931
1317170.88243047982280.117569520177197
1326662.18899749244913.81100250755088
1337773.23237958424483.76762041575518
1346570.379854742438-5.37985474243793
1357472.0913696475221.90863035247793
1368271.840081778829610.1599182211704
1375462.2569267234256-8.25692672342563
1386370.060637642769-7.06063764276899
1395466.2504615019553-12.2504615019553
1406472.6618746158834-8.66187461588345
1416970.3119255114614-1.31192551146142
1425473.2323795842448-19.2323795842448
1438471.840081778829612.1599182211704
1448671.201647579491714.7983524205083
1457772.0913696475224.90863035247793
1468973.551596683913815.4484033160862
1477672.98109171555243.01890828444761
1486067.9619764070394-7.9619764070394
1497569.99270841179255.00729158820752
1507362.759502460810510.2404975391895
1518572.981091715552412.0189082844476
1527967.459400669654511.5405993303455
1537174.6926066206365-3.69260662063652
1547269.42220344343112.57779655656890
1556962.75950246081056.2404975391895
1567866.888895701293211.1111042987068
1575468.6004106063773-14.6004106063773
1586970.060637642769-1.06063764276899
1598176.22076288800474.77923711199527
1608472.023440416545611.9765595834544
1618465.999173633262818.0008263667372
1626968.02990563801590.970094361984086


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
60.6278006121635920.7443987756728160.372199387836408
70.6664062051556630.6671875896886740.333593794844337
80.6359184330899620.7281631338200750.364081566910038
90.510735794791630.978528410416740.48926420520837
100.4071480687652480.8142961375304970.592851931234752
110.3038650756015010.6077301512030030.696134924398499
120.8147696297892040.3704607404215920.185230370210796
130.7493150885644220.5013698228711560.250684911435578
140.8193582586462580.3612834827074840.180641741353742
150.840519975864390.3189600482712180.159480024135609
160.8319913296496910.3360173407006170.168008670350309
170.8003943529432460.3992112941135090.199605647056754
180.8337947124343330.3324105751313340.166205287565667
190.8053100401929380.3893799196141240.194689959807062
200.8374646318181430.3250707363637130.162535368181857
210.8307344790593940.3385310418812110.169265520940606
220.7881024530418170.4237950939163660.211897546958183
230.8276778536543290.3446442926913420.172322146345671
240.8161920377790360.3676159244419280.183807962220964
250.839239024897640.321521950204720.16076097510236
260.8679144372179620.2641711255640760.132085562782038
270.837439452000070.3251210959998610.162560547999930
280.79834711151030.4033057769793990.201652888489699
290.7837267582063160.4325464835873670.216273241793684
300.7376530161876780.5246939676246430.262346983812322
310.704499728504640.591000542990720.29550027149536
320.7287324506325130.5425350987349750.271267549367487
330.6839469898550470.6321060202899060.316053010144953
340.702177639203790.5956447215924210.297822360796210
350.6618511645938460.6762976708123070.338148835406154
360.6179771975535470.7640456048929060.382022802446453
370.5697733575588370.8604532848823250.430226642441163
380.5156309764945140.9687380470109710.484369023505486
390.4629711678785280.9259423357570550.537028832121472
400.411542635067210.823085270134420.58845736493279
410.3603838898087670.7207677796175350.639616110191233
420.3207453955010260.6414907910020520.679254604498974
430.4742634102501830.9485268205003670.525736589749817
440.532215094960570.935569810078860.46778490503943
450.4817571174696720.9635142349393450.518242882530328
460.4328053654365110.8656107308730230.567194634563489
470.4114680218539110.8229360437078220.588531978146089
480.3696249227944510.7392498455889010.630375077205549
490.3270496452536960.6540992905073930.672950354746304
500.2958838932211190.5917677864422380.704116106778881
510.2553347541985010.5106695083970010.744665245801499
520.2188380002902210.4376760005804410.781161999709779
530.1845810289208360.3691620578416710.815418971079164
540.1613987168112130.3227974336224250.838601283188787
550.1425255967777640.2850511935555270.857474403222236
560.12325160733540.24650321467080.8767483926646
570.1017038943467510.2034077886935030.898296105653249
580.0886273457868430.1772546915736860.911372654213157
590.07369647872976750.1473929574595350.926303521270232
600.06022646295470960.1204529259094190.93977353704529
610.05320241114075840.1064048222815170.946797588859242
620.04867118273120470.09734236546240930.951328817268795
630.04783978499880570.09567956999761140.952160215001194
640.07598861547506540.1519772309501310.924011384524935
650.1104892560372140.2209785120744270.889510743962787
660.1221967396980590.2443934793961180.877803260301941
670.1009575234600730.2019150469201460.899042476539927
680.08497601798991040.1699520359798210.91502398201009
690.07805553939480090.1561110787896020.921944460605199
700.06313981618987660.1262796323797530.936860183810123
710.05126378175617780.1025275635123560.948736218243822
720.07489509202724160.1497901840544830.925104907972758
730.07691698151433660.1538339630286730.923083018485663
740.06395248878712460.1279049775742490.936047511212875
750.0766977277888870.1533954555777740.923302272211113
760.1026743426310750.2053486852621500.897325657368925
770.08637859707895040.1727571941579010.91362140292105
780.07080207338931810.1416041467786360.929197926610682
790.06160227856924530.1232045571384910.938397721430755
800.09657388719886020.1931477743977200.90342611280114
810.08637814293854280.1727562858770860.913621857061457
820.7575276976508480.4849446046983040.242472302349152
830.7279708675325010.5440582649349980.272029132467499
840.6926991160785770.6146017678428460.307300883921423
850.6546497092930390.6907005814139230.345350290706961
860.628788360200550.74242327959890.37121163979945
870.591387708229020.817224583541960.40861229177098
880.5519950149347090.8960099701305820.448004985065291
890.607812424992660.784375150014680.39218757500734
900.6220234260183750.755953147963250.377976573981625
910.5845709386606330.8308581226787350.415429061339367
920.6419472639513870.7161054720972270.358052736048613
930.6103790994236350.779241801152730.389620900576365
940.6289045864054820.7421908271890350.371095413594518
950.6128010480336950.7743979039326090.387198951966305
960.5838206135123080.8323587729753840.416179386487692
970.5392242955753370.9215514088493250.460775704424662
980.5073998630845370.9852002738309260.492600136915463
990.4772057419406560.9544114838813120.522794258059344
1000.4346317437215340.8692634874430670.565368256278466
1010.3945803086263630.7891606172527260.605419691373637
1020.3633338974067540.7266677948135090.636666102593246
1030.3687734920217130.7375469840434270.631226507978287
1040.3302437396386880.6604874792773750.669756260361312
1050.3162602781308500.6325205562617010.68373972186915
1060.2896290828275810.5792581656551620.710370917172419
1070.2527928668563120.5055857337126250.747207133143688
1080.2164449489594990.4328898979189970.783555051040501
1090.228487894058310.456975788116620.77151210594169
1100.2622388112938220.5244776225876430.737761188706178
1110.2589368870933620.5178737741867250.741063112906638
1120.2363554029222660.4727108058445320.763644597077734
1130.2958994984781210.5917989969562430.704100501521879
1140.7436634505660940.5126730988678120.256336549433906
1150.7084290115612470.5831419768775050.291570988438753
1160.7075760140002580.5848479719994840.292423985999742
1170.8020725301372260.3958549397255490.197927469862774
1180.7674463255982470.4651073488035070.232553674401753
1190.7362810840153910.5274378319692180.263718915984609
1200.8291147024669170.3417705950661650.170885297533083
1210.8731351005512380.2537297988975230.126864899448762
1220.8476070238574860.3047859522850290.152392976142514
1230.8813708077406520.2372583845186960.118629192259348
1240.8514757991371230.2970484017257550.148524200862877
1250.8182231222792910.3635537554414170.181776877720709
1260.799377323329710.4012453533405820.200622676670291
1270.8192551275008340.3614897449983320.180744872499166
1280.783506663349140.4329866733017210.216493336650860
1290.7404060271931410.5191879456137180.259593972806859
1300.6927283064935560.6145433870128880.307271693506444
1310.6381978801082840.7236042397834310.361802119891716
1320.5841108251856050.831778349628790.415889174814395
1330.5272985965441290.9454028069117420.472701403455871
1340.5128958016362920.9742083967274150.487104198363708
1350.4511700608373660.9023401216747320.548829939162634
1360.4140316216131120.8280632432262240.585968378386888
1370.4901956312900960.9803912625801920.509804368709904
1380.496101777873430.992203555746860.50389822212657
1390.5952587824680670.8094824350638650.404741217531933
1400.6042847204129770.7914305591740460.395715279587023
1410.5410177213791690.9179645572416630.458982278620831
1420.803184203739780.393631592520440.19681579626022
1430.7663404371610360.4673191256779280.233659562838964
1440.7846462656150820.4307074687698350.215353734384918
1450.720716302134080.558567395731840.27928369786592
1460.7595920034339770.4808159931320460.240407996566023
1470.6863258972053680.6273482055892640.313674102794632
1480.7171614664768630.5656770670462740.282838533523137
1490.6341306387299120.7317387225401760.365869361270088
1500.549641360949370.900717278101260.45035863905063
1510.5269934148962470.9460131702075070.473006585103753
1520.4592518062287620.9185036124575230.540748193771238
1530.3718112146747540.7436224293495090.628188785325246
1540.2641066045529040.5282132091058070.735893395447096
1550.1674498892366020.3348997784732040.832550110763398
1560.1152868209599860.2305736419199710.884713179040014


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level00OK
10% type I error level20.0132450331125828OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/10bwf91290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/10bwf91290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/1mdix1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/1mdix1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/2e4hi1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/2e4hi1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/3e4hi1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/3e4hi1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/4e4hi1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/4e4hi1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/57vg31290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/57vg31290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/67vg31290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/67vg31290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/705go1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/705go1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/805go1290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/805go1290557264.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/9bwf91290557264.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t12905572671xw8og12apuht1z/9bwf91290557264.ps (open in new window)


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