Home » date » 2010 » Nov » 22 »

Mini-Tutorial FMPS

*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: Mon, 22 Nov 2010 11:26:18 +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/22/t129042550883vx5i4roau69p6.htm/, Retrieved Mon, 22 Nov 2010 12:33:04 +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/22/t129042550883vx5i4roau69p6.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 «
26 9 15 6 25 25 20 9 15 6 25 24 21 9 14 13 19 21 31 14 10 8 18 23 21 8 10 7 18 17 18 8 12 9 22 19 15 14 9 8 23 29 29 15 18 11 23 23 22 9 14 9 25 23 16 11 11 11 23 21 24 14 11 12 24 26 33 14 9 6 32 24 17 6 17 8 30 25 31 10 21 12 32 26 22 9 16 9 24 23 38 11 21 7 29 29 26 14 14 8 17 24 28 8 24 20 30 20 25 11 7 8 25 23 24 10 9 6 25 29 25 16 18 16 26 24 15 11 11 8 23 22 28 11 13 6 25 22 28 11 13 6 25 22 25 7 18 11 35 17 23 13 14 12 19 24 23 10 12 8 20 21 18 9 12 8 21 24 19 9 9 7 21 23 27 15 11 9 23 21 18 13 8 9 24 24 26 16 5 4 23 24 18 12 10 8 19 23 18 6 11 8 17 26 28 14 11 8 24 24 12 4 15 4 27 28 28 12 16 14 27 22 29 10 12 8 25 23 20 14 14 10 18 24 17 9 13 6 22 23 20 10 10 8 26 23 29 14 18 10 26 30 31 14 17 11 23 20 21 10 12 8 16 23 19 9 13 8 27 21 23 14 13 10 25 27 15 8 11 8 14 12 24 9 13 10 19 15 28 8 12 7 20 22 22 10 12 8 26 27 16 9 12 8 16 21 19 9 12 7 18 21 21 9 9 9 22 20 17 9 17 9 25 21 26 11 18 5 29 18 21 15 7 5 21 24 20 8 17 7 22 24 16 10 12 7 22 29 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
PS[t] = + 6.22294541070322 + 0.329668770012704CM[t] -0.307335861753657D[t] + 0.178919946656884PE[t] + 0.0935033736509635PC[t] + 0.407206747380311O[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)6.222945410703222.346762.65170.0088930.004447
CM0.3296687700127040.0572165.761900
D-0.3073358617536570.110252-2.78760.0060180.003009
PE0.1789199466568840.1025021.74550.0829980.041499
PC0.09350337365096350.1309890.71380.4764730.238236
O0.4072067473803110.0742765.482400


Multiple Linear Regression - Regression Statistics
Multiple R0.617279978710385
R-squared0.381034572116694
Adjusted R-squared0.359837125956307
F-TEST (value)17.9754942757563
F-TEST (DF numerator)5
F-TEST (DF denominator)146
p-value7.23865412055602e-14
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.40954750236372
Sum Squared Residuals1697.2520689477


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12525.4532988015174-0.453298801517387
22523.06807943406081.93192056593915
31922.6517316308325-3.65173163083251
41824.0429568620695-6.04295686206954
51820.0535404745316-2.05354047453161
62220.42379429986981.57620570013019
72321.03257707949131.96742292050875
82324.7881531544984-1.78815315449844
92523.4218004010021.57819959899801
102319.66494946998913.3350505300109
112423.50982915538230.49017084461772
123224.74357445551647.25642554448355
133023.95313409727976.04686590272026
143228.83605345905473.16394654094532
152423.77964029431580.220359705684247
162931.5905023612761-2.59050236127607
171723.5174995460139-6.51749954601387
183027.30326521742042.69673478257962
192522.45019198728362.54980801271637
202525.0419327093183-0.0419327093182908
212624.03686582832911.96313417167091
222319.46197732640383.53802267359619
232523.91850448258081.08149551741919
242523.91850448258081.08149551741919
253523.48492448419511.515075515805
261923.2098425923333-4.20984259233326
272022.1783765475357-2.17837654753568
282122.0589888013667-1.05898880136675
292121.3511876103775-0.351187610377524
302321.87495574581231.12504425418771
312420.20746894137553.79253105862445
322320.91853480799072.08146519200926
331920.3719345754117-1.37193457541170
341723.6164899347315-6.61648993473145
352423.64007724606860.359922753931377
362723.40922882494683.59077117505316
372724.89595545000552.10404454999448
382524.97080266237250.0291973376274716
391821.7264936732396-3.72649367323957
402221.31402648332870.685973516671312
412621.64594383894444.35405616105558
422627.8524328742633-1.85243287426331
432324.3542863674797-1.35428636747969
441622.3334525022709-6.33345250227089
452721.34595727589545.6540427241046
462523.75820027876171.24179972123827
471416.3119174378617-2.31191743786168
481920.738067388979-1.73806738897899
492024.7550954948359-4.75509549483586
502624.29194826180481.70805173819516
511620.1780310192004-4.1780310192004
521821.0735339555876-3.07353395558755
532220.97591165556391.02408834443607
542521.49580289614853.50419710385151
552922.43143631266766.56856368733238
562120.02887008664560.971129913354392
572223.8267585627793-1.82675856277927
582223.0348457628383-1.03484576283827
593224.98770942693877.01229057306132
602319.96301079262813.03698920737188
613126.69664407135754.30335592864250
621821.2132142294192-3.21321422941924
632323.1448438297063-0.144843829706266
642422.23003015238531.76996984761468
651917.72498653100241.27501346899761
662625.69562784351250.304372156487544
671415.8175645184084-1.81756451840838
682020.5239986732194-0.523998673219369
692221.05586166643080.944138333569198
702422.73257244900621.26742755099384
712522.26526378575812.73473621424193
722124.6819147568961-3.68191475689609
732124.6819147568961-3.68191475689609
742824.85116854601683.1488314539832
752421.47025426461952.52974573538049
761518.7840137331429-3.7840137331429
772123.6183646141654-2.61836461416543
782322.90214313480830.0978568651917416
792422.73914816598861.26085183401142
802123.0174097013384-2.01740970133844
812125.0518817936013-4.05188179360135
821316.5346871154700-3.53468711547003
831718.9997209006796-1.99972090067956
842919.17160104345849.82839895654158
852522.33194141860832.66805858139173
861617.1142805963692-1.11428059636921
872020.3762617067911-0.376261706791088
882521.75012946015453.24987053984549
892521.75728294964843.24271705035162
902121.6072716282330-0.607271628232959
912322.33725033671660.662749663283391
922226.4730987266287-4.47309872662868
931920.2760272253931-1.27602722539309
942624.27094834025011.72905165974987
952523.92834873707531.07165126292473
961918.60598667919100.394013320808964
972522.45019198728362.54980801271637
982423.92000525584570.0799947441542706
992023.2238928907365-3.22389289073650
1002116.93013031523024.06986968476979
1011419.4379655479216-5.43796554792157
1022222.42564060147-0.425640601470004
1031418.5884437025044-4.58844370250436
1042024.0398174691597-4.03981746915974
1052120.06850749304450.931492506955491
1062221.79125412281140.208745877188611
1071919.7482955543503-0.748295554350274
1082826.38546367606821.61453632393183
1092525.2967521815657-0.296752181565735
1101717.1643703033141-0.164370303314113
1112122.2756777556324-1.27567775563236
1122723.16806754527213.83193245472791
1132922.94395248516346.05604751483657
1141919.0138116175289-0.0138116175289485
1152222.0576735269149-0.057673526914894
1162022.6010193942657-2.60101939426567
1172422.37370406987351.62629593012651
1181718.7057000886548-1.70570008865482
1192122.1301592667587-1.13015926675866
1202220.64546496516471.35453503483533
1212622.43316799713293.56683200286707
1221918.24766596452140.752334035478633
1231719.5605028295302-2.56050282953017
1241716.77448464511520.225515354884836
1251922.3960836772225-3.39608367722249
1261720.7661980938339-3.7661980938339
1271515.9681278429511-0.96812784295114
1282727.4596907499014-0.459690749901438
1291921.4904939780402-2.49049397804015
1302122.5910476037890-1.59104760378895
1312520.44330085001444.55669914998562
1321923.5524525059058-4.55245250590583
1331826.7527056444788-8.75270564447884
1341523.2083418190683-8.20834181906835
1352023.0554998008741-3.05549980087412
1362925.00235954877023.99764045122981
1371918.66201605886570.337983941134325
1382024.2147738802086-4.21477388020858
1392924.61364745675714.38635254324295
1402425.5030292513553-1.50302925135531
1412420.77918174123823.22081825876184
1422322.08430345850490.915696541495112
1432319.46197732640383.53802267359619
1441923.3204184317127-4.32041843171271
1452222.5773307931086-0.57733079310862
1462218.95097657623503.04902342376504
1472521.75012946015453.24987053984549
1482120.81707603156310.182923968436935
1492223.460254096309-1.46025409630901
1502121.605396948799-0.605396948798987
1511820.3890070411402-2.38900704114018
1521017.0138804138089-7.01388041380888


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.1471139181337670.2942278362675350.852886081866233
100.1352049293877490.2704098587754980.864795070612251
110.1513226980059900.3026453960119790.84867730199401
120.8197119639161980.3605760721676030.180288036083802
130.8307477066922810.3385045866154380.169252293307719
140.7977279536369230.4045440927261540.202272046363077
150.7279061041786030.5441877916427940.272093895821397
160.7444515566207120.5110968867585750.255548443379288
170.8232751761393170.3534496477213650.176724823860683
180.7984857814933550.4030284370132900.201514218506645
190.7404559001646720.5190881996706550.259544099835328
200.7367983032041020.5264033935917960.263201696795898
210.7065172135834230.5869655728331540.293482786416577
220.6805854963934550.638829007213090.319414503606545
230.63251150631180.7349769873763990.367488493688200
240.5778505737760350.844298852447930.422149426223965
250.9196791925768480.1606416148463050.0803208074231523
260.9311412932868040.1377174134263920.0688587067131958
270.9262193381313260.1475613237373480.073780661868674
280.9136485078579640.1727029842840720.0863514921420358
290.8910383729520320.2179232540959360.108961627047968
300.8684744161869770.2630511676260450.131525583813023
310.8703423710297320.2593152579405360.129657628970268
320.8590640400543630.2818719198912730.140935959945637
330.8353885119529660.3292229760940670.164611488047034
340.9209106623994460.1581786752011080.079089337600554
350.8976115868296060.2047768263407890.102388413170395
360.890067331179370.2198653376412610.109932668820631
370.8698479304961380.2603041390077240.130152069503862
380.8377214839627260.3245570320745480.162278516037274
390.8500832205916150.2998335588167710.149916779408385
400.8172545582248860.3654908835502280.182745441775114
410.8256964150841540.3486071698316910.174303584915846
420.7921721703018720.4156556593962560.207827829698128
430.7631647461663770.4736705076672450.236835253833623
440.8608637896724030.2782724206551930.139136210327597
450.8863718626669660.2272562746660680.113628137333034
460.8660321506204820.2679356987590370.133967849379518
470.8762280884999460.2475438230001080.123771911500054
480.8615262973065540.2769474053868930.138473702693446
490.8858616902993870.2282766194012250.114138309700613
500.8650577613957040.2698844772085930.134942238604296
510.883081417015920.2338371659681590.116918582984080
520.879060217649740.241879564700520.12093978235026
530.8538049645005720.2923900709988560.146195035499428
540.8502787070297250.2994425859405510.149721292970275
550.9043712879057320.1912574241885370.0956287120942685
560.8832823584563270.2334352830873460.116717641543673
570.8702839116961830.2594321766076330.129716088303817
580.8450769121132680.3098461757734630.154923087886732
590.9217304611888560.1565390776222870.0782695388111437
600.9142053209882040.1715893580235920.085794679011796
610.9270379706984230.1459240586031540.0729620293015768
620.9264103005146180.1471793989707630.0735896994853815
630.9079674466391980.1840651067216040.0920325533608019
640.8922624708219270.2154750583561460.107737529178073
650.8705267865047260.2589464269905490.129473213495274
660.8437220674713570.3125558650572860.156277932528643
670.8251525574783660.3496948850432680.174847442521634
680.7938773204021950.412245359195610.206122679597805
690.7613828035748830.4772343928502350.238617196425117
700.730375742433010.5392485151339790.269624257566989
710.7199705790524390.5600588418951220.280029420947561
720.7246301182876940.5507397634246130.275369881712306
730.7282094674453850.543581065109230.271790532554615
740.7307598921941870.5384802156116260.269240107805813
750.7125943677246360.5748112645507280.287405632275364
760.7229494162593380.5541011674813230.277050583740662
770.7071196972996620.5857606054006770.292880302700338
780.6656378095615580.6687243808768840.334362190438442
790.6284010399220270.7431979201559450.371598960077973
800.5974979949795510.8050040100408980.402502005020449
810.6100077138658650.779984572268270.389992286134135
820.6101917746196650.779616450760670.389808225380335
830.5883295791562920.8233408416874150.411670420843708
840.8953537589530120.2092924820939760.104646241046988
850.893910099713130.2121798005737400.106089900286870
860.8729648485147850.2540703029704300.127035151485215
870.8458319923171350.3083360153657300.154168007682865
880.842695734556560.314608530886880.15730426544344
890.8485948161299950.3028103677400090.151405183870005
900.818679032423690.3626419351526190.181320967576309
910.79934338463740.40131323072520.2006566153626
920.8162818060890010.3674363878219980.183718193910999
930.7887358662587670.4225282674824660.211264133741233
940.7635055915882130.4729888168235730.236494408411787
950.7521742562417930.4956514875164130.247825743758207
960.7299334626924750.5401330746150510.270066537307525
970.7148086991780560.5703826016438880.285191300821944
980.6749538866877930.6500922266244130.325046113312207
990.657272782511190.6854544349776200.342727217488810
1000.6673013159321730.6653973681356540.332698684067827
1010.7317322807415440.5365354385169120.268267719258456
1020.6895566287184280.6208867425631430.310443371281572
1030.7069108739673550.5861782520652910.293089126032645
1040.7037116480416870.5925767039166270.296288351958313
1050.6578745720488520.6842508559022960.342125427951148
1060.6088074234436180.7823851531127630.391192576556382
1070.5785912546254640.8428174907490710.421408745374536
1080.5430769989739980.9138460020520040.456923001026002
1090.4943971141622150.988794228324430.505602885837785
1100.4699360655358160.9398721310716330.530063934464184
1110.4225749894458450.845149978891690.577425010554155
1120.4075769985169810.8151539970339620.592423001483019
1130.5556553656028160.8886892687943680.444344634397184
1140.5023620793666270.9952758412667470.497637920633373
1150.4452741866670160.8905483733340310.554725813332984
1160.399632884236280.799265768472560.60036711576372
1170.3640428405940640.7280856811881280.635957159405936
1180.3580372413974220.7160744827948450.641962758602578
1190.31697451897280.63394903794560.6830254810272
1200.2990894366791190.5981788733582370.700910563320881
1210.5020078658783460.9959842682433070.497992134121653
1220.4496409623114860.8992819246229710.550359037688514
1230.418889918138590.837779836277180.581110081861409
1240.3601583819508020.7203167639016040.639841618049198
1250.4520133288351820.9040266576703640.547986671164818
1260.4425134384415930.8850268768831850.557486561558407
1270.3774377506919110.7548755013838230.622562249308088
1280.4427718132678660.8855436265357320.557228186732134
1290.4287909091695180.8575818183390360.571209090830482
1300.3598903921601900.7197807843203810.64010960783981
1310.3427257809424180.6854515618848350.657274219057582
1320.370908220156280.741816440312560.62909177984372
1330.3687272755534790.7374545511069570.631272724446521
1340.4654663976096440.9309327952192870.534533602390356
1350.42750897558330.85501795116660.5724910244167
1360.4575431955384080.9150863910768150.542456804461592
1370.3652293230534110.7304586461068220.634770676946589
1380.491317363729470.982634727458940.50868263627053
1390.4016429700206190.8032859400412380.598357029979381
1400.3712785192248220.7425570384496440.628721480775178
1410.47887652905020.95775305810040.5211234709498
1420.3469461800898480.6938923601796960.653053819910152
1430.2450041022956850.490008204591370.754995897704315


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


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/1zdf91290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/1zdf91290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/2amwt1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/2amwt1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/3amwt1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/3amwt1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/4amwt1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/4amwt1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/53dwf1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/53dwf1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/63dwf1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/63dwf1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/7d4dz1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/7d4dz1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/8d4dz1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/8d4dz1290425167.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/9oecl1290425167.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t129042550883vx5i4roau69p6/9oecl1290425167.ps (open in new window)


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