Home » date » 2010 » Dec » 14 »

WS 10 - MR: Concern over mistakes

*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, 14 Dec 2010 10:55:32 +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/Dec/14/t1292324072bloqux0ch52txml.htm/, Retrieved Tue, 14 Dec 2010 11:54:32 +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/Dec/14/t1292324072bloqux0ch52txml.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 «
0 25 11 7 8 25 23 0 17 6 17 8 30 25 0 18 8 12 9 22 19 0 16 10 12 7 22 29 0 20 10 11 4 25 25 0 16 11 11 11 23 21 0 18 16 12 7 17 22 0 17 11 13 7 21 25 0 30 12 16 10 19 18 0 23 8 11 10 15 22 0 18 12 10 8 16 15 0 21 9 9 9 22 20 0 31 14 17 11 23 20 0 27 15 11 9 23 21 0 21 9 14 13 19 21 0 16 8 15 9 23 24 0 20 9 15 6 25 24 0 17 9 13 6 22 23 0 25 16 18 16 26 24 0 26 11 18 5 29 18 0 25 8 12 7 32 25 0 17 9 17 9 25 21 0 32 12 18 12 28 22 0 22 9 14 9 25 23 0 17 9 16 5 25 23 0 20 14 14 10 18 24 0 29 10 12 8 25 23 0 23 14 17 7 25 21 0 20 10 12 8 20 28 0 11 6 6 4 15 16 0 26 13 12 8 24 29 0 22 10 12 8 26 27 0 14 15 13 8 14 16 0 19 12 14 7 24 28 0 20 11 11 8 25 25 0 28 8 12 7 20 22 0 19 9 9 7 21 23 0 30 9 15 9 27 26 0 29 15 18 11 23 23 0 26 9 15 6 25 25 0 23 10 12 8 20 21 0 21 12 14 9 22 24 0 28 11 13 6 25 22 0 23 14 13 10 25 27 0 18 6 11 8 17 26 0 20 8 16 10 25 24 0 21 10 11 5 26 24 0 28 12 16 14 27 22 0 10 5 8 6 19 24 0 22 10 15 6 22 20 0 31 10 21 12 32 26 0 29 13 18 12 21 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
CM[t] = -1.97558860391637 -0.584520417545623Gender[t] + 0.825198555334064D[t] + 0.240632907570932PE[t] + 0.182865509202120PC[t] + 0.556669097802935PS[t] -0.0951728207275587O[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-1.975588603916373.057456-0.64620.5191540.259577
Gender-0.5845204175456230.791394-0.73860.4612920.230646
D0.8251985553340640.1321156.246100
PE0.2406329075709320.1337331.79940.0739460.036973
PC0.1828655092021200.1686831.08410.2800460.140023
PS0.5566690978029350.0967955.75100
O-0.09517282072755870.106862-0.89060.3745410.187271


Multiple Linear Regression - Regression Statistics
Multiple R0.639761924721091
R-squared0.409295320322835
Adjusted R-squared0.385978030335578
F-TEST (value)17.5532971690331
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value2.22044604925031e-15
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.48437540723029
Sum Squared Residuals3056.66266453172


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
12521.97670249971143.02329750028864
21722.8500386463099-5.85003864630991
31819.5978208702674-1.59782087026737
41619.9307587552557-3.93075875525567
52021.1922278963974-1.19222789639742
61622.5648381034507-6.5648381034507
71822.7648143433383-4.76481434333829
81720.8206124032680-3.82061240326797
93022.46917775840827.53082224159177
102315.35785132509537.64214867490467
111819.2751604633523-1.27516046335227
122119.60594788216111.39405211783892
133126.57940403560604.42059596439397
142725.49990130638271.50009869361730
152119.77539434268791.22460565731214
161620.4005245871453-4.40052458714531
172021.7904648104789-1.79046481047888
181719.7343645226558-2.73436452265577
192530.6740776103543-5.67407761035427
202626.7776084502348-0.777608450234776
212524.22774390552710.772256094472872
221723.1058456154098-6.10584561540978
233227.94550518927054.05449481072949
242222.1936012512419-0.193601251241868
251721.9434050295753-4.94340502957525
262022.5106030317662-2.51060303176620
272922.35466848223196.64533151776805
282326.8661073736759-3.86610737367586
292019.09545888957950.904541110420521
301111.9781335457252-0.978133545725176
312623.70255812606592.29744187393415
322222.5306462971246-0.530646297124649
331421.2641438357338-7.26414383573383
341923.2709326973991-4.27093269739909
352022.7488884885400-2.74888848853996
362817.833233194074610.1667668059254
371918.39802930377120.601970696228773
383023.2620538922366.73794610776401
392927.35971703632841.64028296367165
402621.69529198975134.30470801024868
412319.76166863467243.23833136532761
422122.9040168031077-1.90401680310770
432823.14994174746034.85005825253974
442325.8811353466331-2.88113534663314
451814.07437010871863.9256298912814
462021.9373611995242-1.93736119952423
472122.0269353241300-1.02693532413003
482827.27330129473000.726698705270044
491013.4652256493285-3.46522564932849
502221.32634735531440.673652644685626
513128.86299190961672.13700809038331
522924.96919288071164.03080711928841
532219.07930898809262.92069101190743
542322.51930566919820.480694330801768
552021.4624955543769-1.46249555437688
561819.6603975421967-1.66039754219667
572521.17426305178793.8257369482121
582116.71449328696464.28550671303536
592419.55720183187594.44279816812408
602525.4462963019337-0.446296301933674
611314.7787370694396-1.77873706943965
622818.40640853330799.59359146669207
632528.0091946916564-3.00919469165641
64920.8666155494301-11.8666155494301
651618.0744585395891-2.07445853958909
661921.1135941852984-2.11359418529838
672921.89708238143347.10291761856663
681419.2098584910333-5.20985849103332
692227.0660163292267-5.06601632922667
701515.9210517772642-0.921051777264193
711517.7263634054771-2.72636340547711
722022.0970465700095-2.09704657000947
731820.5066049531815-2.50660495318152
743325.78115325234517.21884674765491
752223.8882914785782-1.88829147857816
761616.7097936881266-0.709793688126585
771615.3542269274220.645773072578004
781821.4100370051950-3.41003700519496
791823.153615825737-5.15361582573698
802224.8359669666564-2.83596696665641
813024.85964668099975.14035331900031
823027.41454454595642.58545545404359
832429.7480139830914-5.74801398309136
842125.5638598388168-4.56385983881685
852927.71766126313951.28233873686053
863123.29619125686497.7038087431351
872019.16481358109580.835186418904233
881614.31402717633161.68597282366844
892219.05344117827792.94655882172207
902020.4731473363914-0.473147336391438
912827.61654952598960.383450474010433
923826.818337163348711.1816628366513
932219.35189116482102.64810883517896
942025.7481072085238-5.74810720852381
951718.2547028707021-1.25470287070208
962224.3430594166699-2.34305941666993
973126.2853799206094.71462007939099
982424.7195838552745-0.719583855274521
991819.5992647733950-1.59926477339498
1002322.02328417509370.976715824906306
1011521.3365483375711-6.33654833757115
1021217.4468675105543-5.44686751055433
1031514.80265899861810.197341001381876
1042019.37486986853440.625130131465627
1053426.77257544069367.2274245593064
1063120.692992786260210.3070072137398
1071919.095504119797-0.0955041197969886
1082117.93326051858013.06673948141986
1092221.53367755103520.466322448964825
1102420.11148139920393.88851860079606
1113227.57486758460274.42513241539726
1123323.27289699303979.72710300696028
1131321.8145629073884-8.81456290738843
1142525.4643560573641-0.464356057364075
1152926.77093010256242.22906989743756
1161816.93972363593221.06027636406781
1172021.8455513473474-1.84555134734740
1181520.2062211373137-5.20622113731373
1193327.78482340879855.21517659120147
1202623.09693599055232.90306400944772
1211818.6231002974130-0.623100297412962
1222828.2705959064922-0.270595906492178
1231719.7737894736804-2.77378947368044
1241215.2140544269744-3.21405442697439
1251720.3808002792963-3.38080027929633
1262120.99320803532250.00679196467747714
1271822.8142356910764-4.81423569107642
1281017.6409040426914-7.64090404269142
1292923.99865621142595.00134378857407
1303118.113937932310912.8860620676891
1311922.4892662539842-3.48926625398418
132919.8683866688697-10.8683866688697
1331322.5288221425224-9.52882214252242
1341921.2549042402414-2.25490424024137
1352120.41633631683530.583663683164666
1362319.83910825840473.16089174159535
1372120.49649443135980.503505568640237
1381522.6646684433386-7.66466844333857
1391917.32427541451581.67572458548416
1402621.00368249801344.99631750198659
1411616.8714985872778-0.871498587277751
1421918.46267994606360.537320053936405
1433124.96844868836786.03155131163216
1441917.05574595698471.94425404301529
1451515.7791524349174-0.779152434917398
1462321.84165798347591.15834201652414
1471719.3288659310441-2.32886593104411
1482119.67529812329151.32470187670850
1491719.1050626727989-2.10506267279891
1502524.21052640380110.789473596198866
1512015.17305198656854.82694801343146
1521925.3463762502684-6.34637625026839
1532021.5718347666633-1.57183476666331
1541718.7568634163864-1.75686341638642
1552116.76012618445994.23987381554009
1562627.1883799281907-1.18837992819071
1571717.9807672512810-0.980767251281018
1582121.8225305639563-0.822530563956327
1592824.17846745992123.82153254007884


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.9168654122836380.1662691754327230.0831345877163616
110.9238192812736920.1523614374526150.0761807187263076
120.866963455605630.2660730887887410.133036544394370
130.8829943342280450.2340113315439090.117005665771955
140.8354297495020.3291405009959990.164570250498000
150.7766132198371360.4467735603257290.223386780162864
160.7352925868299220.5294148263401550.264707413170078
170.6604667395860660.6790665208278680.339533260413934
180.5780347046027160.8439305907945680.421965295397284
190.5587390429372250.882521914125550.441260957062775
200.477874488013980.955748976027960.52212551198602
210.4683818911604740.9367637823209480.531618108839526
220.4895053158355640.9790106316711270.510494684164436
230.5413980660956250.917203867808750.458601933904375
240.4696348061185680.9392696122371360.530365193881432
250.4279576805298280.8559153610596560.572042319470172
260.3630984754001660.7261969508003320.636901524599834
270.4841244961463070.9682489922926140.515875503853693
280.4338437164656960.8676874329313920.566156283534304
290.4014749648581750.802949929716350.598525035141825
300.3687354587061930.7374709174123850.631264541293807
310.3560543233849740.7121086467699490.643945676615026
320.2989834603082200.5979669206164390.70101653969178
330.3653429926865610.7306859853731210.634657007313439
340.3304391738203680.6608783476407360.669560826179632
350.2941511861002210.5883023722004430.705848813899779
360.5555700020367920.8888599959264150.444429997963208
370.4971827704151630.9943655408303250.502817229584837
380.5775283810336560.8449432379326870.422471618966344
390.549031228694660.9019375426106810.450968771305340
400.5643593388435610.8712813223128780.435640661156439
410.5346865961080210.9306268077839580.465313403891979
420.4859548735156820.9719097470313650.514045126484318
430.5116157459883370.9767685080233250.488384254011663
440.4722369705972810.9444739411945630.527763029402719
450.4414046074716850.882809214943370.558595392528315
460.40533807888240.81067615776480.5946619211176
470.3561395401495270.7122790802990540.643860459850473
480.3082178621930630.6164357243861270.691782137806937
490.3122996545099360.6245993090198720.687700345490064
500.2709147475840700.5418294951681390.72908525241593
510.2375774396773340.4751548793546690.762422560322666
520.2288196135534700.4576392271069410.77118038644653
530.2041346488330000.4082692976660000.795865351167
540.1698333163361790.3396666326723590.83016668366382
550.1470420977479250.2940841954958510.852957902252075
560.1270030852503970.2540061705007950.872996914749603
570.1250383571121970.2500767142243940.874961642887803
580.1161518577020090.2323037154040180.883848142297991
590.1069208253316190.2138416506632380.89307917466838
600.08585171061497080.1717034212299420.91414828938503
610.07253981866800130.1450796373360030.927460181331999
620.1441734665659040.2883469331318080.855826533434096
630.136458466816020.272916933632040.86354153318398
640.3470072113742990.6940144227485980.652992788625701
650.314002342649710.628004685299420.68599765735029
660.2862792037696250.5725584075392510.713720796230375
670.3785248803687810.7570497607375620.621475119631219
680.4002067995312630.8004135990625250.599793200468737
690.4080430884162950.816086176832590.591956911583705
700.3641497820749360.7282995641498720.635850217925064
710.3366582907834430.6733165815668870.663341709216557
720.3032541066615200.6065082133230410.69674589333848
730.2783622296960940.5567244593921880.721637770303906
740.3475944916567630.6951889833135260.652405508343237
750.3130943617406440.6261887234812870.686905638259356
760.2748218192174230.5496436384348460.725178180782577
770.2371153424247410.4742306848494820.762884657575259
780.2235779713189850.4471559426379690.776422028681016
790.2376587980257990.4753175960515980.762341201974201
800.2188588305492540.4377176610985080.781141169450746
810.2274945278412190.4549890556824390.77250547215878
820.2038316978985770.4076633957971540.796168302101423
830.2378312176545960.4756624353091920.762168782345404
840.2513180541194130.5026361082388270.748681945880587
850.2179175783412760.4358351566825520.782082421658724
860.2712019377301160.5424038754602320.728798062269884
870.2339729482999800.4679458965999610.76602705170002
880.2018794170702490.4037588341404980.798120582929751
890.1801024887339720.3602049774679430.819897511266028
900.1524332227938730.3048664455877470.847566777206127
910.1274481650100700.2548963300201400.87255183498993
920.3000469211339840.6000938422679680.699953078866016
930.2752861982521670.5505723965043330.724713801747833
940.2979938840323540.5959877680647080.702006115967646
950.2607714383288690.5215428766577370.739228561671131
960.2447506459366980.4895012918733960.755249354063302
970.2276401782175210.4552803564350420.772359821782479
980.1967909517359350.393581903471870.803209048264065
990.1684712242021140.3369424484042280.831528775797886
1000.1409219059511500.2818438119022990.85907809404885
1010.1684098620526280.3368197241052560.831590137947372
1020.1573738738971250.314747747794250.842626126102875
1030.1352127771070840.2704255542141680.864787222892916
1040.1134976303666060.2269952607332120.886502369633394
1050.1549006453471820.3098012906943640.845099354652818
1060.3106643653788790.6213287307577580.689335634621121
1070.2693209633616090.5386419267232180.730679036638391
1080.2489212334406050.497842466881210.751078766559395
1090.2103175759192450.4206351518384890.789682424080755
1100.1986580510011640.3973161020023290.801341948998836
1110.1871486305546290.3742972611092590.81285136944537
1120.2921307270730600.5842614541461190.70786927292694
1130.4188175775359210.8376351550718420.581182422464079
1140.369583457623030.739166915246060.63041654237697
1150.3459624307350810.6919248614701620.654037569264919
1160.2984883326768570.5969766653537140.701511667323143
1170.2648322744932220.5296645489864450.735167725506778
1180.2717013256090620.5434026512181240.728298674390938
1190.2904511549624270.5809023099248530.709548845037573
1200.2859121346987270.5718242693974530.714087865301273
1210.2415972506636340.4831945013272690.758402749336366
1220.2212264721309950.4424529442619890.778773527869005
1230.1935960312800210.3871920625600420.806403968719979
1240.1673331138926190.3346662277852390.83266688610738
1250.1585592062464660.3171184124929330.841440793753534
1260.1257144308095530.2514288616191060.874285569190447
1270.1287042058069820.2574084116139630.871295794193018
1280.1794985132945820.3589970265891640.820501486705418
1290.305837076658180.611674153316360.69416292334182
1300.7477885386868790.5044229226262420.252211461313121
1310.6991914916503170.6016170166993650.300808508349683
1320.8936400156862470.2127199686275070.106359984313753
1330.9639119016657270.07217619666854560.0360880983342728
1340.9462618475248040.1074763049503910.0537381524751956
1350.9220912006898420.1558175986203160.0779087993101578
1360.9438328879979520.1123342240040960.0561671120020478
1370.9158882709294760.1682234581410480.0841117290705242
1380.9428559270696640.1142881458606710.0571440729303357
1390.9124234772503270.1751530454993460.087576522749673
1400.9081617318870060.1836765362259880.0918382681129941
1410.8620986264074620.2758027471850760.137901373592538
1420.8009884538321280.3980230923357440.199011546167872
1430.8991301987701170.2017396024597670.100869801229883
1440.842470187307810.3150596253843810.157529812692191
1450.7803456072361050.4393087855277890.219654392763895
1460.7108708323857270.5782583352285450.289129167614273
1470.6306165380285450.738766923942910.369383461971455
1480.4932720676666490.9865441353332980.506727932333351
1490.4748382631409470.9496765262818940.525161736859053


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 level10.00714285714285714OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/10az3x1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/10az3x1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/13go31292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/13go31292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/20suv1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/20suv1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/30suv1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/30suv1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/40suv1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/40suv1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/5bjuy1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/5bjuy1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/6bjuy1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/6bjuy1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/7hp4u1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/7hp4u1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/8hp4u1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/8hp4u1292324121.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/9az3x1292324121.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292324072bloqux0ch52txml/9az3x1292324121.ps (open in new window)


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