Home » date » 2010 » Nov » 23 »

Mini-Tutorial Multiple Regression

*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 23:58:00 +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/t1290472699ib9nrjd85lbyagf.htm/, Retrieved Tue, 23 Nov 2010 01:38:19 +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/t1290472699ib9nrjd85lbyagf.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 «
13 26 9 6 25 25 16 20 9 6 25 24 19 21 9 13 19 21 15 31 14 8 18 23 14 21 8 7 18 17 13 18 8 9 22 19 19 26 11 5 29 18 15 22 10 8 26 27 14 22 9 9 25 23 15 29 15 11 23 23 16 15 14 8 23 29 16 16 11 11 23 21 16 24 14 12 24 26 17 17 6 8 30 25 15 19 20 7 19 25 15 22 9 9 24 23 20 31 10 12 32 26 18 28 8 20 30 20 16 38 11 7 29 29 16 26 14 8 17 24 19 25 11 8 25 23 16 25 16 16 26 24 17 29 14 10 26 30 17 28 11 6 25 22 16 15 11 8 23 22 15 18 12 9 21 13 14 21 9 9 19 24 15 25 7 11 35 17 12 23 13 12 19 24 14 23 10 8 20 21 16 19 9 7 21 23 14 18 9 8 21 24 7 18 13 9 24 24 10 26 16 4 23 24 14 18 12 8 19 23 16 18 6 8 17 26 16 28 14 8 24 24 16 17 14 6 15 21 14 29 10 8 25 23 20 12 4 4 27 28 14 25 12 7 29 23 14 28 12 14 27 22 11 20 14 10 18 24 15 17 9 9 25 21 16 17 9 6 22 23 14 20 10 8 26 23 16 31 14 11 23 20 14 21 10 8 16 23 12 19 9 8 27 21 16 23 14 10 25 27 9 15 8 8 14 12 14 24 9 10 19 15 16 28 8 7 20 22 16 16 9 8 16 21 15 19 9 7 18 21 16 21 9 9 22 20 12 21 15 5 21 24 16 20 8 7 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 time7 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Selfconfidence[t] = + 12.9244692218402 + 0.0194062852882190ConcernMistakes[t] -0.292329496310611DoubtsActions[t] + 0.0742459719711945ParentalCriticism[t] + 0.0344516405357084PersonalStandards[t] + 0.152496856322935Organization[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)12.92446922184021.4248869.070500
ConcernMistakes0.01940628528821900.0371260.52270.6019810.300991
DoubtsActions-0.2923294963106110.069094-4.23094.1e-052.1e-05
ParentalCriticism0.07424597197119450.0686991.08070.2816180.140809
PersonalStandards0.03445164053570840.0491830.70050.4847620.242381
Organization0.1524968563229350.0499163.0550.0026820.001341


Multiple Linear Regression - Regression Statistics
Multiple R0.438418729396901
R-squared0.192210982285993
Adjusted R-squared0.164162752504256
F-TEST (value)6.85287391688267
F-TEST (DF numerator)5
F-TEST (DF denominator)144
p-value9.15406172974365e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.07799929532179
Sum Squared Residuals621.803674275534


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11315.9172554258317-2.91725542583166
21615.64832085777940.351679142220559
31915.52324853468303.47675146531703
41514.15497611826630.84502388173371
51414.7256631333390-0.725663133338962
61315.2587364962054-2.25873649620540
71914.32867902912164.67132097087844
81516.0352380854922-1.03523808549217
91415.7573744879465-1.75737448794653
101514.21883016997140.781169830028633
111614.93171489427091.06828510572906
121614.83087273382111.16912726617891
131614.98031642131661.01968357868341
141716.94033749379050.0596625062095173
151512.43332309815442.56667690184562
161515.7229228474108-0.722922847410819
172016.56109152786223.43890847213777
181816.69761502137931.30238497862067
191616.3875118160749-0.387511816074863
201614.17598990761241.82401009238758
211915.15668837921883.84331162078123
221614.47595717029391.52404282970609
231715.60774661017851.39225338982155
241714.91391843481812.0860815651819
251614.74122538894221.25877461105777
261513.13998573248961.86001426751036
271415.683755215767-1.68375521576699
281515.9782795477943-0.97827954779427
291214.7759877170146-2.77598771701457
301414.9329533896285-0.93295338962853
311615.41285712599660.587142874003353
321415.6201936690026-1.62019366900256
33714.6284765773384-7.62847657733843
341013.5010568703207-3.50105687032067
351414.5218050426764-0.521805042676374
361616.6643693084374-0.664369308437427
371614.45596396193881.54403603806118
381613.32644754603582.67355245396416
391415.5266430166823-1.52664301668225
402017.48511681944752.51488318055249
411414.9279194730798-0.927919473079796
421415.2844599953485-1.28445999534846
431114.2424957803612-3.24249578036120
441515.3553493488596-0.355349348859563
451615.33425022398470.665749776015276
461415.386438089624-1.38643808962399
471614.09248166788961.90751833211039
481415.0613279695551-1.06132796955513
491215.3888192285362-3.38881922853622
501614.99936668894461.00063331105537
51913.7831805498233-4.78318054982334
521414.4437483366964-0.443748336696430
531615.69289469304260.307105306957414
541614.95163232677881.04836767322123
551515.0045084917437-0.00450849174365286
561615.17712271208240.822877287917622
571213.7016976310900-1.70169763108997
581615.91154140445410.0884585955458791
591616.0117415522947-0.0117415522946973
601416.5055860925752-2.50558609257523
611613.00960230072142.99039769927861
621716.28576344193290.714236558067145
631814.53965011062303.46034988937698
641815.59399902804502.40600097195496
651214.7743955257743-2.77439552577426
661615.93088513361560.0691148663844061
671014.2113207474753-4.21132074747527
681412.32745521565261.67254478434742
691815.82385758129332.17614241870665
701816.43587012783711.56412987216286
711615.34094600622130.65905399377866
721615.35999627384940.640003726150624
731614.50383814084651.49616185915350
741315.1143047828663-2.11430478286632
751615.68684743340680.313152566593205
761614.80303153999331.19696846000671
772016.24558246720203.75441753279803
781615.18480025517800.815199744821957
791512.82428481523502.17571518476495
801515.4826958812108-0.482695881210769
811615.7071038573090.292896142690989
821414.0529117318693-0.0529117318692575
831513.05684094806841.94315905193162
841214.7376000015362-2.73760000153625
851716.66837977421670.331620225783264
861615.36465066542350.635349334576457
871513.19847527048581.80152472951423
881313.8616476350934-0.861647635093433
891615.36335917362070.636640826379345
901615.09437927544490.905620724555142
911616.0168598477793-0.0168598477793425
921616.1992565145957-0.199256514595724
931415.4717480117765-1.47174801177651
941613.87130496931762.12869503068240
951614.62188240004091.37811759995907
962016.23763424197483.76236575802517
971515.6304767464256-0.630476746425586
981614.09408917194751.90591082805248
991314.0192246946814-1.01922469468144
1001715.94221252802441.05778747197558
1011614.68011656872321.31988343127681
1021213.0309795743121-1.03097957431206
1031614.68146158514641.31853841485360
1041615.24804483309470.751955166905341
1051715.32204363024881.67795636975124
1061312.81131757768490.188682422315101
1071215.7560213966097-3.75602139660969
1081815.75194646151802.24805353848196
1091413.84557423227060.154425767729449
1101414.4064506967452-0.406450696745218
1111313.6234930334546-0.623493033454569
1121615.4942011845810.505798815419014
1131312.56137399950420.438626000495795
1141614.93894460312911.06105539687087
1151314.9747728423161-1.97477284231606
1161615.96736285199610.0326371480038552
1171514.49574202396390.504257976036098
1181615.47196516928770.528034830712334
1191514.72847583707830.27152416292174
1201715.59177206209941.40822793790056
1211516.1851756942041-1.18517569420409
1221213.5258821505310-1.52588215053095
1231614.48368077142551.51631922857445
1241014.4214269858744-4.4214269858744
1251614.63766957923441.36233042076565
1261414.6777273548973-0.677727354897334
1271516.4390186202925-1.4390186202925
1281314.4275270422181-1.42752704221810
1291514.92185039063480.0781496093651607
1301113.8342315250441-2.83423152504412
1311214.1406881284627-2.14068812846272
132814.4030877969739-6.40308779697394
1331616.300214984473-0.300214984473012
1341515.1321021989120-0.132102198911953
1351715.64634297983651.35365702016347
1361614.98505591973911.01494408026091
1371015.0951919591115-5.09519195911154
1381813.65046130926644.34953869073359
1391314.2776900818525-1.27769008185249
1401514.52427151711730.475728482882688
1411614.74122538894221.25877461105777
1421614.91012164844231.08987835155771
1431413.72653194280670.27346805719333
1441013.5617106183983-3.56171061839826
1451716.66837977421670.331620225783264
1461314.8192844166996-1.81928441669964
1471516.1851756942041-1.18517569420409
1481615.65097267882310.349027321176853
1491215.3208749289219-3.32087492892189
1501313.5991936049522-0.599193604952239


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.8394065956198470.3211868087603060.160593404380153
100.8778920262260540.2442159475478920.122107973773946
110.8104672740398970.3790654519202060.189532725960103
120.7365841154756920.5268317690486150.263415884524308
130.6401844531979180.7196310936041650.359815546802082
140.5701073192499190.8597853615001620.429892680750081
150.4826802206945490.9653604413890980.517319779305451
160.3903121511621890.7806243023243770.609687848837811
170.3760847365294090.7521694730588180.623915263470591
180.3784852017814000.7569704035627990.6215147982186
190.2982006719864010.5964013439728030.701799328013599
200.2846951902003380.5693903804006760.715304809799662
210.3842850330036760.7685700660073510.615714966996325
220.3770202454906860.7540404909813710.622979754509315
230.3209338770620180.6418677541240360.679066122937982
240.2737901742624980.5475803485249960.726209825737502
250.2211761246073490.4423522492146980.778823875392651
260.1896943468465110.3793886936930220.810305653153489
270.1520380949187500.3040761898375010.84796190508125
280.2049391242124550.409878248424910.795060875787545
290.3001925594655840.6003851189311670.699807440534416
300.2553999577894710.5107999155789420.744600042210529
310.2211415181746180.4422830363492350.778858481825382
320.1875029496807780.3750058993615550.812497050319222
330.9074609096014880.1850781807970250.0925390903985125
340.959633415290590.08073316941881880.0403665847094094
350.9457687629718580.1084624740562840.0542312370281419
360.9333011864698340.1333976270603320.0666988135301659
370.9191056574948330.1617886850103330.0808943425051667
380.9293640276070190.1412719447859620.070635972392981
390.922848821354160.1543023572916810.0771511786458406
400.9513416595623480.09731668087530410.0486583404376521
410.9420311857005850.1159376285988300.0579688142994148
420.9352836511520390.1294326976959230.0647163488479613
430.9529938996649850.09401220067002960.0470061003350148
440.9390191550779050.1219616898441910.0609808449220953
450.9238165795357250.1523668409285500.0761834204642748
460.9126009983046440.1747980033907130.0873990016953565
470.9032776064689520.1934447870620950.0967223935310476
480.8838090255468290.2323819489063430.116190974453171
490.9171137035096340.1657725929807320.0828862964903662
500.9006526091622640.1986947816754720.099347390837736
510.9558015921195830.08839681576083450.0441984078804173
520.9433566484001620.1132867031996760.0566433515998382
530.9286727072240730.1426545855518530.0713272927759266
540.920392071388180.1592158572236380.0796079286118192
550.9013918555794540.1972162888410910.0986081444205456
560.8829864611685530.2340270776628940.117013538831447
570.8739462454171150.2521075091657710.126053754582885
580.8472828194712140.3054343610575710.152717180528786
590.8166719551067880.3666560897864240.183328044893212
600.8321400114634280.3357199770731450.167859988536572
610.854844806822110.2903103863557780.145155193177889
620.828178817718330.3436423645633390.171821182281669
630.8771627535916110.2456744928167770.122837246408389
640.8877357415752250.2245285168495490.112264258424775
650.9080972488378350.1838055023243310.0919027511621654
660.8866490137579770.2267019724840460.113350986242023
670.9391529204276610.1216941591446780.0608470795723389
680.9339130728451680.1321738543096650.0660869271548323
690.9372981534387620.1254036931224750.0627018465612377
700.932238910452510.135522179094980.06776108954749
710.9167379319332170.1665241361335660.0832620680667829
720.8985747871318020.2028504257363970.101425212868198
730.889769456366650.2204610872667010.110230543633350
740.8905266544793950.2189466910412100.109473345520605
750.8667444216320860.2665111567358290.133255578367914
760.8486586971860310.3026826056279370.151341302813969
770.906623203592260.186753592815480.09337679640774
780.8890129154519970.2219741690960050.110987084548003
790.8889383419832810.2221233160334370.111061658016719
800.8652969939363070.2694060121273860.134703006063693
810.8382846759628510.3234306480742980.161715324037149
820.809817250093180.380365499813640.19018274990682
830.8119897557965980.3760204884068040.188010244203402
840.8350484082367780.3299031835264440.164951591763222
850.8040737261166090.3918525477667820.195926273883391
860.772330847514840.4553383049703210.227669152485161
870.7651679524851390.4696640950297220.234832047514861
880.7318955437564560.5362089124870880.268104456243544
890.6925414153992910.6149171692014170.307458584600709
900.6580802326989740.6838395346020510.341919767301026
910.6112166017039690.7775667965920630.388783398296031
920.5630257912075770.8739484175848460.436974208792423
930.5431258585666320.9137482828667360.456874141433368
940.5705786533858970.8588426932282060.429421346614103
950.554153429684060.891693140631880.44584657031594
960.6688880710255690.6622238579488630.331111928974431
970.6234846034746480.7530307930507030.376515396525352
980.6501081833802170.6997836332395660.349891816619783
990.6119163756571390.7761672486857220.388083624342861
1000.5898631926791750.820273614641650.410136807320825
1010.5801653389749370.8396693220501250.419834661025063
1020.5435224278068660.9129551443862690.456477572193134
1030.5131685862722880.9736628274554250.486831413727712
1040.5054398634862210.9891202730275590.494560136513779
1050.5216291218152570.9567417563694860.478370878184743
1060.4687106084620150.937421216924030.531289391537985
1070.5832956042746850.833408791450630.416704395725315
1080.5960031171238030.8079937657523930.403996882876197
1090.5900627305226750.819874538954650.409937269477325
1100.541520639190270.916958721619460.45847936080973
1110.4869942549180510.9739885098361020.513005745081949
1120.4362352241933840.8724704483867680.563764775806616
1130.4040280082318010.8080560164636020.595971991768199
1140.3903080064994490.7806160129988990.60969199350055
1150.3764130052292040.7528260104584070.623586994770796
1160.321439862170740.642879724341480.67856013782926
1170.3064198006058390.6128396012116780.693580199394161
1180.3088645998734350.617729199746870.691135400126565
1190.2572651578399810.5145303156799630.742734842160019
1200.2255930731741120.4511861463482240.774406926825888
1210.1904730495533680.3809460991067360.809526950446632
1220.1720081438603310.3440162877206620.82799185613967
1230.1598032695074590.3196065390149170.840196730492542
1240.2254216210995170.4508432421990340.774578378900483
1250.1843509411759640.3687018823519290.815649058824036
1260.1462506846216070.2925013692432150.853749315378393
1270.1133169693906730.2266339387813460.886683030609327
1280.08783896606189430.1756779321237890.912161033938106
1290.06391229784787060.1278245956957410.93608770215213
1300.05395776934316550.1079155386863310.946042230656834
1310.04082307174784880.08164614349569760.959176928252151
1320.2144151563059620.4288303126119240.785584843694038
1330.1646448525560130.3292897051120260.835355147443987
1340.1194907646756100.2389815293512190.88050923532439
1350.1866362568279030.3732725136558070.813363743172097
1360.2009954743236220.4019909486472430.799004525676378
1370.234708424590430.469416849180860.76529157540957
1380.597487513367960.8050249732640810.402512486632040
1390.4953918202725490.9907836405450980.504608179727451
1400.4400473361974410.8800946723948820.559952663802559
1410.3563468889421060.7126937778842130.643653111057894


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 level50.037593984962406OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/10110v1290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/10110v1290470269.ps (open in new window)


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/4nr3m1290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/4nr3m1290470269.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/5nr3m1290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/5nr3m1290470269.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/6fi271290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/6fi271290470269.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/78rjs1290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/78rjs1290470269.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/88rjs1290470269.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290472699ib9nrjd85lbyagf/88rjs1290470269.ps (open in new window)


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