Home » date » 2010 » Nov » 23 »

Tutorial WS7

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 19:46:06 +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/t1290541492yxt5q9y8yvk8lsn.htm/, Retrieved Tue, 23 Nov 2010 20:45:02 +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/t1290541492yxt5q9y8yvk8lsn.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 «
11 12 24 7 8 25 17 8 30 10 8 19 12 9 22 12 7 22 11 4 25 11 11 23 12 7 17 13 7 21 14 12 19 16 10 19 11 10 15 10 8 16 11 8 23 15 4 27 9 9 22 11 8 14 17 7 22 17 11 23 11 9 23 18 11 21 14 13 19 10 8 18 11 8 20 15 9 23 15 6 25 13 9 19 16 9 24 13 6 22 9 6 25 18 16 26 18 5 29 12 7 32 17 9 25 9 6 29 9 6 28 12 5 17 18 12 28 12 7 29 18 10 26 14 9 25 15 8 14 16 5 25 10 8 26 11 8 20 14 10 18 9 6 32 12 8 25 17 7 25 5 4 23 12 8 21 12 8 20 6 4 15 24 20 30 12 8 24 12 8 26 14 6 24 7 4 22 13 8 14 12 9 24 13 6 24 14 7 24 8 9 24 11 5 19 9 5 31 11 8 22 13 8 27 10 6 19 11 8 25 12 7 20 9 7 21 15 9 27 18 11 23 15 6 25 12 8 20 13 6 21 14 9 22 10 8 23 13 6 25 13 10 25 11 8 17 13 8 19 16 10 25 8 5 19 16 7 20 11 5 26 9 8 23 16 14 27 12 7 17 14 8 17 8 6 19 9 5 17 15 6 22 11 10 21 21 12 32 14 9 21 18 12 21 12 7 18 13 8 18 15 10 23 12 6 19 19 10 20 15 10 21 11 10 20 11 5 17 10 7 18 13 10 19 15 11 22 12 6 15 12 7 14 16 12 18 9 11 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'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
PerStandards[t] = + 18.3823499874315 + 0.313043159644399ParExpectations[t] -0.0318454635433938ParCriticism[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)18.38234998743151.30823814.051200
ParExpectations0.3130431596443990.1180362.65210.0088260.004413
ParCriticism-0.03184546354339380.150234-0.2120.8324050.416202


Multiple Linear Regression - Regression Statistics
Multiple R0.244201249146055
R-squared0.0596342500844937
Adjusted R-squared0.0475782789317307
F-TEST (value)4.94644930125161
F-TEST (DF numerator)2
F-TEST (DF denominator)156
p-value0.00826324483165364
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.11541833268082
Sum Squared Residuals2642.1202162626


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12421.44367918099912.55632081900086
22520.31888839659514.68111160340486
33023.44931999303916.55068000696088
41921.2580178755283-2.25801787552833
52221.85225873127370.147741268726262
62221.91594965836050.0840503416394744
72521.69844288934633.30155711065369
82321.47552464454261.52447535545745
91721.9159496583605-4.91594965836053
102122.2289928180049-1.22899281800492
111922.3828086599324-3.38280865993235
121923.0725859063079-4.07258590630794
131521.5073701080859-6.50737010808595
141621.2580178755283-5.25801787552833
152321.57106103517271.42893896482727
162722.95061552792394.0493844720761
172220.91312925234051.08687074765946
181421.5710610351727-7.57106103517273
192223.4811654565825-1.48116545658252
202323.3537836024089-0.353783602408943
212321.53921557162931.46078442837066
222123.6668267620533-2.66682676205334
231922.3509631963890-3.35096319638896
241821.2580178755283-3.25801787552833
252021.5710610351727-1.57106103517273
262322.79138821020690.208611789793066
272522.88692460083712.11307539916289
281922.1653018909181-3.16530189091814
292423.10443136985130.895568630148668
302222.2608382815483-0.260838281548318
312521.00866564297073.99133435702928
322623.50759944433642.49240055566363
332923.85789954331375.1421004566863
343221.915949658360510.0840503416395
352523.41747452949571.58252547050427
362921.00866564297077.99133435702928
372821.00866564297076.99133435702928
381721.9796405854473-4.97964058544731
392823.63498129850994.36501870149005
402921.91594965836057.08405034163947
412623.69867222559672.30132777440326
422522.47834505056252.52165494943746
431422.8232336737503-8.82323367375033
442523.23181322402491.76818677597509
452621.25801787552834.74198212447167
462021.5710610351727-1.57106103517273
471822.4464995870191-4.44649958701914
483221.008665642970710.9913343570293
492521.88410419481713.11589580518287
502523.48116545658251.51883454341748
512319.82018393147993.17981606852008
522121.8841041948171-0.884104194817132
532021.8841041948171-1.88410419481713
541520.1332270911243-5.13322709112431
553025.25847654802924.74152345197081
562421.88410419481712.11589580518287
572621.88410419481714.11589580518287
582422.57388144119271.42611855880728
592220.44627025076871.55372974923129
601422.1971473544615-8.19714735446153
612421.85225873127372.14774126872626
622422.26083828154831.73916171845168
632422.54203597764931.45796402235068
642420.60008609269613.39991390730386
651921.6665974258029-2.66659742580291
663121.04051110651419.95948889348588
672221.57106103517270.428938964827266
682722.19714735446154.80285264553847
691921.3217088026151-2.32170880261512
702521.57106103517273.42893896482727
712021.9159496583605-1.91594965836053
722120.97682017942730.0231798205726697
732722.79138821020694.20861178979307
742323.6668267620533-0.666826762053342
752522.88692460083712.11307539916289
762021.8841041948171-1.88410419481713
772122.2608382815483-1.26083828154832
782222.4783450505625-0.478345050562535
792321.25801787552831.74198212447166
802522.26083828154832.73916171845168
812522.13345642737472.86654357262526
821721.5710610351727-4.57106103517273
831922.1971473544615-3.19714735446153
842523.07258590630791.92741409369206
851920.7274679468697-1.72746794686972
862023.1681222969381-3.16812229693812
872621.66659742580294.33340257419709
882320.94497471588392.05502528411606
892722.94520405213444.05479594786564
901721.9159496583605-4.91594965836053
911722.5101905141059-5.51019051410593
921920.6956224833263-1.69562248332633
931721.0405111065141-4.04051110651412
942222.8869246008371-0.886924600837115
952121.5073701080859-0.507370108085946
963224.57411077744317.42588922255686
972122.4783450505625-1.47834505056254
982123.6349812985099-2.63498129850995
991821.9159496583605-3.91594965836053
1001822.1971473544615-4.19714735446153
1012322.75954274666350.24045725333646
1021921.9477951219039-2.94779512190392
1032024.0117153852411-4.01171538524113
1042122.7595427466635-1.75954274666354
1052021.5073701080859-1.50737010808595
1061721.6665974258029-4.66659742580291
1071821.2898633390717-3.28986333907173
1081922.1334564273747-3.13345642737474
1092222.7276972831201-0.727697283120146
1101521.9477951219039-6.94779512190392
1111421.9159496583605-7.91594965836053
1121823.0088949792212-5.00889497922115
1132420.84943832525383.15056167474624
1143523.666826762053311.3331732379467
1152920.53639516560948.46360483439064
1162122.2926837450917-1.29268374509171
1172523.44931999303911.55068000696088
1182021.0086656429707-1.00866564297072
1192222.7913882102069-0.791388210206934
1201320.7593134104131-7.75931341041311
1212620.44627025076875.55372974923129
1221721.9159496583605-4.91594965836053
1232522.41465412347572.58534587652425
1242020.0695361640375-0.0695361640375286
1251920.6637770197829-1.66377701978293
1262123.4493199930391-2.44931999303912
1272221.38539972970190.614600270298090
1282421.57106103517272.42893896482727
1292122.4783450505625-1.47834505056254
1302621.57106103517274.42893896482727
1312422.10161096383131.89838903616865
1321621.8841041948171-5.88410419481713
1332321.66659742580291.33340257419709
1341821.0723565700575-3.07235657005751
1351621.8841041948171-5.88410419481713
1362624.32475854488551.67524145511447
1371921.9477951219039-2.94779512190392
1382122.1653018909181-1.16530189091814
1392121.8522587312737-0.852258731273738
1402221.72487687710020.275123122899836
1412320.91312925234052.08687074765946
1422922.75954274666356.24045725333646
1432125.2584765480292-4.25847654802919
1442120.41442478722530.585575212774679
1452323.3537836024089-0.353783602408943
1462721.63475196225955.36524803774048
1472523.41747452949571.58252547050427
1482121.6029064987161-0.602906498716127
1491021.8522587312737-11.8522587312737
1502022.4464995870191-2.44649958701914
1512621.53921557162934.46078442837066
1522423.13627683339470.863723166605274
1532924.73333809516014.26666190483989
1541922.5738814411927-3.57388144119272
1552424.2292221542553-0.229222154255351
1561922.2608382815483-3.26083828154832
1572421.57106103517272.42893896482727
1582222.7595427466635-0.75954274666354
1591723.8206426039808-6.82064260398077


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
60.5680826324963410.8638347350073170.431917367503659
70.4227398078028730.8454796156057460.577260192197127
80.2816038402750790.5632076805501580.718396159724921
90.5195521125193620.9608957749612760.480447887480638
100.4438823037860130.8877646075720260.556117696213987
110.4579360955863420.9158721911726830.542063904413658
120.4443180941687480.8886361883374950.555681905831252
130.5676268051999360.8647463896001290.432373194800064
140.6083619828562470.7832760342875070.391638017143753
150.5365397018954510.9269205962090980.463460298104549
160.4819019853744830.9638039707489650.518098014625517
170.4141488968483050.828297793696610.585851103151695
180.584351473168920.8312970536621610.415648526831081
190.5216997678621120.9566004642757760.478300232137888
200.4515285538320580.9030571076641160.548471446167942
210.4001409520056030.8002819040112060.599859047994397
220.3409487876121270.6818975752242540.659051212387873
230.2863840020972540.5727680041945080.713615997902746
240.2584247367645970.5168494735291950.741575263235403
250.2098719532097550.4197439064195090.790128046790245
260.1669823780417190.3339647560834380.833017621958281
270.1346943922965940.2693887845931880.865305607703406
280.1143566147216880.2287132294433770.885643385278312
290.08974905146819260.1794981029363850.910250948531807
300.06714961792264340.1342992358452870.932850382077357
310.06621341572564360.1324268314512870.933786584274356
320.08447055689490690.1689411137898140.915529443105093
330.08506183234299930.1701236646859990.914938167657001
340.2785026813761760.5570053627523520.721497318623824
350.2358878041086050.4717756082172090.764112195891395
360.3528763555945250.7057527111890490.647123644405476
370.416340748471290.832681496942580.58365925152871
380.5006992351654760.9986015296690490.499300764834524
390.5236690756152410.9526618487695190.476330924384759
400.5989928850085780.8020142299828430.401007114991422
410.5596320920763710.8807358158472590.440367907923629
420.5220165281336280.9559669437327450.477983471866373
430.723447443427450.5531051131450990.276552556572550
440.6846610159402930.6306779681194140.315338984059707
450.6896459737637870.6207080524724270.310354026236213
460.6539553380122370.6920893239755260.346044661987763
470.658849435892860.6823011282142810.341150564107141
480.8468883579281270.3062232841437460.153111642071873
490.8293931075719880.3412137848560230.170606892428012
500.8003985133032480.3992029733935040.199601486696752
510.775915863306070.4481682733878590.224084136693929
520.7424624436350480.5150751127299040.257537556364952
530.7152849087927070.5694301824145860.284715091207293
540.7727375971059280.4545248057881440.227262402894072
550.8051827546026590.3896344907946820.194817245397341
560.7779243033860320.4441513932279360.222075696613968
570.7730059669568460.4539880660863090.226994033043154
580.7401523449913320.5196953100173360.259847655008668
590.7050854128152070.5898291743695860.294914587184793
600.8193420288875060.3613159422249890.180657971112494
610.7947229109550690.4105541780898630.205277089044931
620.7659089150373570.4681821699252870.234091084962643
630.7333796905276240.5332406189447510.266620309472376
640.7189928862216460.5620142275567070.281007113778354
650.7012963408082720.5974073183834550.298703659191728
660.856859417743160.2862811645136810.143140582256840
670.8299251806837210.3401496386325570.170074819316279
680.8395392255168720.3209215489662560.160460774483128
690.8226899409522320.3546201180955350.177310059047768
700.8133690614209710.3732618771580580.186630938579029
710.7905675622032990.4188648755934030.209432437796701
720.757344164232690.4853116715346190.242655835767309
730.7594463154304480.4811073691391050.240553684569552
740.7239272917417980.5521454165164050.276072708258202
750.6989995026832210.6020009946335570.301000497316779
760.6684744137212430.6630511725575140.331525586278757
770.6334648578459390.7330702843081230.366535142154061
780.5911621085528930.8176757828942130.408837891447107
790.555635879839160.8887282403216790.444364120160839
800.5363004040595190.9273991918809620.463699595940481
810.5142200620080050.971559875983990.485779937991995
820.5263270746637360.9473458506725280.473672925336264
830.5088030336966160.9823939326067680.491196966303384
840.475037766139130.950075532278260.52496223386087
850.4391928458467070.8783856916934140.560807154153293
860.4210967891974130.8421935783948270.578903210802587
870.4378660937856850.875732187571370.562133906214315
880.407029443080290.814058886160580.59297055691971
890.4052834811580340.8105669623160670.594716518841966
900.4211157351187910.8422314702375830.578884264881209
910.4526643815344320.9053287630688640.547335618465568
920.4142389077322860.8284778154645720.585761092267714
930.4071124394695180.8142248789390370.592887560530482
940.3655468196509870.7310936393019750.634453180349013
950.3232882187962770.6465764375925530.676711781203723
960.433200620728730.866401241457460.56679937927127
970.3926697196201150.785339439240230.607330280379885
980.3643247835349990.7286495670699980.635675216465001
990.3541244885243280.7082489770486560.645875511475672
1000.3496038258488760.6992076516977510.650396174151124
1010.3080751206901060.6161502413802110.691924879309894
1020.2833298981697490.5666597963394980.716670101830251
1030.2743853333514480.5487706667028970.725614666648552
1040.2410234155653030.4820468311306060.758976584434697
1050.2089134608384590.4178269216769170.791086539161541
1060.210812152727950.42162430545590.78918784727205
1070.1949389843644580.3898779687289150.805061015635542
1080.1786605895186790.3573211790373580.821339410481321
1090.1490528449030370.2981056898060730.850947155096963
1100.1958856007305390.3917712014610770.804114399269461
1110.2879671390716110.5759342781432220.712032860928389
1120.3043587105220820.6087174210441640.695641289477918
1130.2831137883909370.5662275767818740.716886211609063
1140.6149410788969980.7701178422060040.385058921103002
1150.7805491460926310.4389017078147370.219450853907369
1160.7440173418864150.511965316227170.255982658113585
1170.7075420215450960.5849159569098080.292457978454904
1180.6614693455872120.6770613088255760.338530654412788
1190.611623495577870.776753008844260.38837650442213
1200.7473755374660070.5052489250679850.252624462533993
1210.7801481912346820.4397036175306370.219851808765318
1220.7970638836270580.4058722327458840.202936116372942
1230.7856763616630440.4286472766739120.214323638336956
1240.7415104141775510.5169791716448980.258489585822449
1250.69787412089080.60425175821840.3021258791092
1260.6650480265328120.6699039469343760.334951973467188
1270.6100536481354070.7798927037291850.389946351864593
1280.5802535364843370.8394929270313250.419746463515663
1290.5247498353235430.9505003293529130.475250164676457
1300.5539729683522120.8920540632955760.446027031647788
1310.5320510529010960.9358978941978070.467948947098904
1320.5743608956486560.8512782087026870.425639104351344
1330.5150378181797260.9699243636405490.484962181820274
1340.4962104554921360.9924209109842710.503789544507864
1350.5562478178673340.8875043642653310.443752182132666
1360.4996390237759850.999278047551970.500360976224015
1370.4849936433676190.9699872867352370.515006356632381
1380.4187616868644930.8375233737289860.581238313135507
1390.3514034475296550.7028068950593090.648596552470345
1400.3071353873262620.6142707746525240.692864612673738
1410.2818324286966360.5636648573932720.718167571303364
1420.4123940771512420.8247881543024830.587605922848758
1430.3551635018731820.7103270037463640.644836498126818
1440.2825554019554090.5651108039108180.717444598044591
1450.2194332173343860.4388664346687730.780566782665614
1460.2608638953774650.521727790754930.739136104622535
1470.2038599533141220.4077199066282440.796140046685878
1480.1445681462167940.2891362924335880.855431853783206
1490.5720578144274820.8558843711450360.427942185572518
1500.4714205575112830.9428411150225660.528579442488717
1510.6118784906663380.7762430186673230.388121509333662
1520.4748408706437460.9496817412874920.525159129356254
1530.4846018219355820.9692036438711640.515398178064418


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/23/t1290541492yxt5q9y8yvk8lsn/10bf5l1290541556.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541492yxt5q9y8yvk8lsn/10bf5l1290541556.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541492yxt5q9y8yvk8lsn/14e7s1290541556.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541492yxt5q9y8yvk8lsn/14e7s1290541556.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541492yxt5q9y8yvk8lsn/24e7s1290541556.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290541492yxt5q9y8yvk8lsn/24e7s1290541556.ps (open in new window)


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


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


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


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


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


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


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