Home » date » 2010 » Nov » 23 »

Workshop7, Mini-tutorial, 3

*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 00:12:30 +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/t1290471129rwgpf9w1a213esj.htm/, Retrieved Tue, 23 Nov 2010 01:12:09 +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/t1290471129rwgpf9w1a213esj.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 «
9 5.5 6 5.33 12 9 3.5 4 5.56 11 9 8.5 4 3.78 14 9 5 4 4.00 12 9 6 4.5 4.00 21 9 6 3.5 3.56 12 9 5.5 2 4.44 22 9 5.5 5.5 3.56 11 9 6 3.5 4.00 10 9 6.5 3.5 3.78 13 9 7 6 5.11 10 9 8 5 6.67 8 9 5.5 5 5.11 15 9 5 4 4.00 14 9 5.5 4 3.33 10 9 7.5 2 2.67 14 9 4.5 4.5 4.67 14 9 5.5 4 3.33 11 9 8.5 3.5 4.44 10 9 8.5 5.5 6.89 13 9 5.5 4.5 6.00 7 9 9 5.5 7.56 14 9 7 6.5 4.67 12 9 5 4 6.89 14 9 5.5 4 4.22 11 9 7.5 4.5 3.56 9 9 7.5 3 4.44 11 9 6.5 4.5 4.67 15 9 8 4.5 4.89 14 9 6.5 3 3.78 13 9 4.5 3 5.33 9 9 9 8 5.56 15 9 9 2.5 5.78 10 9 6 3.5 5.56 11 9 8.5 4.5 3.78 13 9 4.5 3 7.11 8 9 4.5 3 7.33 20 9 6 2.5 2.89 12 9 9 6 7.11 10 9 6 3.5 5.56 10 9 9 5 6.44 9 9 7 4.5 4.89 14 9 7.5 4 4.00 8 9 8 2.5 3.78 14 9 5 4 4.44 11 9 5.5 4 3.33 13 9 7 5 4.44 9 9 4.5 3 7.33 11 9 6 4 6.44 15 9 8.5 3.5 5.11 11 9 2.5 2 5.78 10 9 6 4 4.00 14 9 6 4 4.44 18 10 3 2 2.44 14 10 12 10 6.22 11 10 6 4 5.78 12 10 6 4 4.89 13 10 7 3 3.78 9 10 3.5 2 2.67 10 10 6.5 4 3.11 15 10 6 4.5 3.78 20 10 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 time6 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Depression[t] = + 9.24355550579304 + 0.493286378792209Month[t] -0.00260207016403223Expect[t] -0.0557478262810437Criticism[t] -0.214965647664329Concerns[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)9.243555505793043.3058742.79610.0058320.002916
Month0.4932863787922090.309081.5960.1125420.056271
Expect-0.002602070164032230.183669-0.01420.9887150.494357
Criticism-0.05574782628104370.232612-0.23970.8109120.405456
Concerns-0.2149656476643290.210983-1.01890.309860.15493


Multiple Linear Regression - Regression Statistics
Multiple R0.161389265252687
R-squared0.0260464949388022
Adjusted R-squared0.000749001300848984
F-TEST (value)1.02960772761003
F-TEST (DF numerator)4
F-TEST (DF denominator)154
p-value0.393886977846912
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation3.1442247281482
Sum Squared Residuals1522.46696772919


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11212.1885676692836-0.188567669283605
21112.2558253632110-1.25582536321096
31412.62545386523331.37454613476669
41212.5872686683213-0.587268668321266
52112.55679268501678.44320731498329
61212.7071253962701-0.70712539627006
72212.60287840082909.39712159917097
81112.59693077879-1.59693077878999
91012.6125405112978-2.61254051129776
101312.65853191870190.341468081298108
111012.2319570065237-2.23195700652371
12811.9497563522844-3.94975635228437
131512.29160793805082.7083920619492
141412.58726866832131.41273133167873
151012.7299946171744-2.72999461717435
161412.97816345686681.02183654313317
171412.41666880632771.58333119367234
181112.7299946171744-1.72999461717435
191012.5114504509154-2.51145045091537
201311.87328896157571.12671103842432
21712.1281624247701-5.12816242477007
221411.72796094255862.27203905744144
231212.2986679783555-0.298667978355491
241411.96601794657142.03398205342865
251112.5386751907531-1.53867519075310
26912.6474744647430-3.64747446474297
271112.5419264342199-1.54192643421992
281512.41146466599962.58853533400041
291412.36026911826741.63973088173261
301312.68640583184240.313594168157586
31912.3584132182908-3.35841321829077
321512.01852267218462.98147732781539
331012.2778432742442-2.27784327424420
341112.2771941009414-1.27719410094140
351312.59757995209280.402420047907216
36811.9757743654483-3.97577436544826
372011.92848192296218.0715180770379
381212.9069002064862-0.906900206486205
391011.7968215708670-1.79682157086698
401012.2771941009414-2.2771941009414
41911.9965963810831-2.99659638108313
421412.36287118843141.63712881156857
43812.5807634929112-4.58076349291118
441412.71037663973691.28962336026311
451112.4926837833490-1.49268378334896
461312.72999461717440.27000538282565
47912.4317318167399-3.43173181673985
481111.9284819229621-0.928481922962108
491512.06015041785632.93984958214373
501112.3674234669803-1.36742346698027
511012.3226306434509-2.32263064345093
521412.58466659815721.41533340184277
531812.49008171318495.50991828681507
541413.53260125036000.46739874964002
551112.2506298604642-1.25062986046418
561212.6953141241069-0.695314124106936
571312.88663355052820.113366449471811
58913.1783911755526-4.17839117555261
591013.4818581163152-3.48185811631517
601513.26797136828871.73202863171132
612013.09737150629516.90262849370493
621212.9883727842134-0.98837278421337
631213.0559323774398-1.05593237743978
641413.05528320413700.944716795863015
651313.5455146042955-0.545514604295531
661112.6409616413161-1.64096164131609
671712.45800329028154.54199670971845
681213.0293594993813-1.02935949938127
691313.5662341687232-0.566234168723177
701412.98466912705921.01533087294085
711312.62860315227520.371396847724847
721513.06243755284991.93756244715014
731312.47221767929910.527782320700887
741012.4620088467348-2.46200884673482
751112.7471588451419-1.74715884514193
761912.83934110804206.16065889195796
771313.3710116370559-0.371011637055876
781712.90345000970984.09654999029021
791313.0332626046273-0.0332626046273222
80912.6551760303337-3.65517603033366
811112.7822922466790-1.78229224667898
821013.0792540120315-3.07925401203146
83912.9326249579323-3.93262495793233
841212.9224161253680-0.92241612536803
851212.9281669877917-0.928166987791667
861312.95659576582680.0434042341732009
871313.0188487675179-0.0188487675179233
881213.2258830661306-1.22588306613059
891512.42828161996342.57171838003656
902213.05853444760388.94146555239619
911312.69271205394290.307287946057096
921513.52154379640111.47845620359894
931313.2600627065894-0.260062706589361
941512.93847827156322.06152172843681
951012.9762137432643-2.97621374326426
961112.3334972868993-1.33349728689930
971612.42622627189503.57377372810502
981112.4341349335943-1.43413493359429
991113.0585344476038-2.05853444760381
1001012.8853325154462-2.88533251544617
1011012.7796901765149-2.77969017651495
1021613.27772778716562.72227221283441
1031212.9185130201220-0.918513020121981
1041113.0183020454224-2.01830204542235
1051612.7848943168433.21510568315699
1061912.82752934109676.17247065890333
1071112.9644019763189-1.96440197631890
1081612.73499980419283.26500019580718
1091513.14836810071771.85163189928232
1102413.674279624508810.3257203754912
1111413.83772513778960.162274862210421
1121512.97731582503672.02268417496331
1131113.3474937376310-2.34749373763103
1141513.14446499547161.85553500452836
1151213.9227530519768-1.92275305197681
1161013.7481449450535-3.74814494505351
1171413.51744173784540.482558262154581
1181313.6781827297549-0.678182729754896
119913.2041159269987-4.20411592699873
1201513.59335426365951.4066457363405
1211513.16472400341291.83527599658714
1221413.79043269530340.209567304696573
1231113.2936961197348-2.2936961197348
124813.7788203764499-5.77882037644989
1251113.5570249667241-2.55702496672408
1261113.4701492953593-2.47014929535927
127813.8293640624029-5.82936406240287
1281013.4779555058514-3.47795550585136
1291113.5407633724371-2.54076337243710
1301312.85670478410150.143295215898550
1311113.2949971548168-2.29499715481682
1322013.66582424071406.33417575928604
1331013.7034545727314-3.70345457273139
1341513.78122299852211.21877700147791
1351213.4272123718066-1.42721237180655
1361413.12244439596200.877555604038027
1372313.62698718202279.3730128179773
1381413.54206440751910.457935592480886
1391613.59065788508732.40934211491272
1401113.2405503636178-2.24055036361779
1411212.9733102685834-0.973310268583418
1421012.9376301449508-2.9376301449508
1431412.93523566567761.06476433432236
1441213.5173392866382-1.51733928663820
1451213.3370854569749-1.33708545697490
1461113.1037720368037-2.10377203680375
1471212.9156095454411-0.915609545441137
1481313.5058294189919-0.505829418991884
1491113.6379503275734-2.63795032757343
1501913.32157003287535.67842996712468
1511213.4500815927108-1.45008159271084
1521713.08881147759883.91118852240122
153912.6329564775144-3.63295647751441
1541213.4330656854374-1.43306568543741
1551913.32687662441065.67312337558939
1561813.67297858942684.32702141057317
1571513.09531665300891.90468334699114
1581413.32026899779330.679731002206694
1591112.7178900832935-1.71789008329345


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
80.9807716383459180.0384567233081650.0192283616540825
90.9876951778288520.02460964434229560.0123048221711478
100.9778016105866470.04439677882670520.0221983894133526
110.9635699942173620.07286001156527570.0364300057826378
120.9599843397747890.08003132045042260.0400156602252113
130.9545700212468070.09085995750638680.0454299787531934
140.9282524517589520.1434950964820950.0717475482410476
150.935662134448090.1286757311038180.0643378655519092
160.9151309118196630.1697381763606740.084869088180337
170.881399655300350.2372006893993000.118600344699650
180.8582284338356110.2835431323287780.141771566164389
190.8390598112450350.3218803775099290.160940188754965
200.8141401528493970.3717196943012060.185859847150603
210.8853711198333430.2292577603333130.114628880166657
220.8790513587899270.2418972824201450.120948641210073
230.8475878881764070.3048242236471870.152412111823593
240.8087671076349880.3824657847300240.191232892365012
250.7758530448392570.4482939103214860.224146955160743
260.7710377619932260.4579244760135470.228962238006774
270.7441055469952020.5117889060095960.255894453004798
280.7272512801673630.5454974396652730.272748719832637
290.6902397295644820.6195205408710360.309760270435518
300.6343534358742150.731293128251570.365646564125785
310.679448959670990.6411020806580210.320551040329010
320.6930707669845240.6138584660309530.306929233015476
330.673004362116430.653991275767140.32699563788357
340.6265872120021580.7468255759956840.373412787997842
350.5708137319116160.8583725361767680.429186268088384
360.5800830531465850.839833893706830.419916946853415
370.8267861086969560.3464277826060890.173213891303044
380.7914599186394520.4170801627210970.208540081360548
390.7631646649401060.4736706701197890.236835335059894
400.7433170491990770.5133659016018450.256682950800922
410.7318401769883170.5363196460233650.268159823011683
420.698858865101050.6022822697978990.301141134898949
430.7371771127665460.5256457744669080.262822887233454
440.7023696000463590.5952607999072830.297630399953641
450.6676597189870270.6646805620259460.332340281012973
460.6196048896622890.7607902206754220.380395110337711
470.6241591265217680.7516817469564640.375840873478232
480.5831529493392760.8336941013214480.416847050660724
490.5703328558749960.8593342882500080.429667144125004
500.5300257721002590.9399484557994810.469974227899741
510.5184820201821860.9630359596356280.481517979817814
520.4777777140880250.955555428176050.522222285911975
530.5687725113746070.8624549772507860.431227488625393
540.5198159218780110.9603681562439780.480184078121989
550.4762570491930740.9525140983861470.523742950806926
560.4291544808916070.8583089617832130.570845519108394
570.3819696050850210.7639392101700430.618030394914978
580.4020609659036140.8041219318072270.597939034096386
590.3947948139025350.789589627805070.605205186097465
600.3792359081131090.7584718162262170.620764091886891
610.5672474077670170.8655051844659660.432752592232983
620.5241341308126790.9517317383746420.475865869187321
630.4815029330962190.9630058661924380.518497066903781
640.4374482691155260.8748965382310520.562551730884474
650.3930252376919860.7860504753839710.606974762308014
660.3582296756746720.7164593513493430.641770324325328
670.4063858407895080.8127716815790150.593614159210492
680.3668276224861750.7336552449723490.633172377513825
690.3259031839900470.6518063679800930.674096816009953
700.2878654901090790.5757309802181580.712134509890921
710.249472451953720.498944903907440.75052754804628
720.2246873857564750.449374771512950.775312614243525
730.1917934314762970.3835868629525940.808206568523703
740.1797489423967550.359497884793510.820251057603245
750.1597421070433930.3194842140867860.840257892956607
760.2465074287461440.4930148574922890.753492571253856
770.2130075854384180.4260151708768360.786992414561582
780.2312021944911930.4624043889823860.768797805508807
790.1981860953099010.3963721906198020.801813904690099
800.2110563808012440.4221127616024870.788943619198756
810.1905084304535580.3810168609071160.809491569546442
820.1920851887905090.3841703775810180.807914811209491
830.2137014145578440.4274028291156880.786298585442156
840.1861521737129030.3723043474258070.813847826287097
850.1598148332348880.3196296664697760.840185166765112
860.1356540477582870.2713080955165730.864345952241714
870.1127559338048640.2255118676097270.887244066195136
880.09649273969806050.1929854793961210.90350726030194
890.08864493804555490.1772898760911100.911355061954445
900.275190743214180.550381486428360.72480925678582
910.2375852288597890.4751704577195780.762414771140211
920.2082641119203280.4165282238406560.791735888079672
930.1766616229648740.3533232459297470.823338377035126
940.1572889635776900.3145779271553790.84271103642231
950.1544766001748840.3089532003497690.845523399825115
960.1349953016279340.2699906032558680.865004698372066
970.1395561212244310.2791122424488610.86044387877557
980.1204140156380870.2408280312761740.879585984361913
990.1096297052819640.2192594105639290.890370294718036
1000.1111586581380690.2223173162761380.88884134186193
1010.1157947648702870.2315895297405730.884205235129713
1020.1020180433639880.2040360867279750.897981956636012
1030.09556489326963740.1911297865392750.904435106730363
1040.1074628010119490.2149256020238980.89253719898805
1050.09413347971981060.1882669594396210.90586652028019
1060.1281709350623230.2563418701246450.871829064937677
1070.1274085407518610.2548170815037220.872591459248139
1080.1108365602335730.2216731204671450.889163439766427
1090.09570103419226420.1914020683845280.904298965807736
1100.4169827505309480.8339655010618950.583017249469052
1110.3694246301781390.7388492603562780.630575369821861
1120.3407676554119770.6815353108239540.659232344588023
1130.3184310281573050.636862056314610.681568971842695
1140.2834845215059190.5669690430118380.716515478494081
1150.2558027075852520.5116054151705050.744197292414748
1160.2844719433736890.5689438867473770.715528056626311
1170.2414561597015190.4829123194030380.758543840298481
1180.2041497160248030.4082994320496060.795850283975197
1190.232114698683130.464229397366260.76788530131687
1200.2052185562413900.4104371124827810.79478144375861
1210.2103392721451490.4206785442902980.789660727854851
1220.1727325644310270.3454651288620540.827267435568973
1230.1545213003184960.3090426006369910.845478699681504
1240.2148148670895280.4296297341790550.785185132910472
1250.1926994449136500.3853988898273010.80730055508635
1260.1923518751613540.3847037503227090.807648124838646
1270.350040814255520.700081628511040.64995918574448
1280.3705989715922710.7411979431845430.629401028407729
1290.3968293662848670.7936587325697350.603170633715133
1300.3783597175768740.7567194351537490.621640282423126
1310.3515852092433460.7031704184866920.648414790756654
1320.4391215502277460.8782431004554930.560878449772254
1330.563410023230290.873179953539420.43658997676971
1340.503483738048520.993032523902960.49651626195148
1350.4684680292223880.9369360584447750.531531970777612
1360.4026585868725250.8053171737450510.597341413127475
1370.768458119523340.4630837609533210.231541880476660
1380.7097308434636070.5805383130727870.290269156536393
1390.6531012998362270.6937974003275460.346898700163773
1400.6100718837923120.7798562324153750.389928116207688
1410.546308465474530.907383069050940.45369153452547
1420.4920270839530530.9840541679061060.507972916046947
1430.4181325241619460.8362650483238920.581867475838054
1440.3372767735418770.6745535470837530.662723226458123
1450.3303527112221660.6607054224443320.669647288777834
1460.2483972161023460.4967944322046930.751602783897654
1470.1750156400064780.3500312800129550.824984359993522
1480.1207472820106730.2414945640213460.879252717989327
1490.2253276506243110.4506553012486210.77467234937569
1500.2508217649231870.5016435298463740.749178235076813
1510.2570209650744540.5140419301489080.742979034925546


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level30.0208333333333333OK
10% type I error level60.0416666666666667OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290471129rwgpf9w1a213esj/102jn51290471139.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290471129rwgpf9w1a213esj/102jn51290471139.ps (open in new window)


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


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


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290471129rwgpf9w1a213esj/92jn51290471139.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290471129rwgpf9w1a213esj/92jn51290471139.ps (open in new window)


 
Parameters (Session):
par1 = 5 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 5 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
colnames(x1) <- mycolnames #colnames(x)[par1]
x <- x1
if (par3 == 'First Differences'){
x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
for (i in 1:n-1) {
for (j in 1:k) {
x2[i,j] <- x[i+1,j] - x[i,j]
}
}
x <- x2
}
if (par2 == 'Include Monthly Dummies'){
x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
for (i in 1:11){
x2[seq(i,n,12),i] <- 1
}
x <- cbind(x, x2)
}
if (par2 == 'Include Quarterly Dummies'){
x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
for (i in 1:3){
x2[seq(i,n,4),i] <- 1
}
x <- cbind(x, x2)
}
k <- length(x[1,])
if (par3 == 'Linear Trend'){
x <- cbind(x, c(1:n))
colnames(x)[k+1] <- 't'
}
x
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
if (n > n25) {
kp3 <- k + 3
nmkm3 <- n - k - 3
gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
numgqtests <- 0
numsignificant1 <- 0
numsignificant5 <- 0
numsignificant10 <- 0
for (mypoint in kp3:nmkm3) {
j <- 0
numgqtests <- numgqtests + 1
for (myalt in c('greater', 'two.sided', 'less')) {
j <- j + 1
gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
}
if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
}
gqarr
}
bitmap(file='test0.png')
plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
points(x[,1]-mysum$resid)
grid()
dev.off()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
lines(lowess(z))
abline(lm(z))
grid()
dev.off()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
a<-table.row.end(a)
myeq <- colnames(x)[1]
myeq <- paste(myeq, '[t] = ', sep='')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') {
myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
}
}
myeq <- paste(myeq, ' + e[t]')
a<-table.row.start(a)
a<-table.element(a, myeq)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Variable',header=TRUE)
a<-table.element(a,'Parameter',header=TRUE)
a<-table.element(a,'S.D.',header=TRUE)
a<-table.element(a,'T-STAT<br />H0: parameter = 0',header=TRUE)
a<-table.element(a,'2-tail p-value',header=TRUE)
a<-table.element(a,'1-tail p-value',header=TRUE)
a<-table.row.end(a)
for (i in 1:k){
a<-table.row.start(a)
a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
a<-table.element(a,mysum$coefficients[i,1])
a<-table.element(a, round(mysum$coefficients[i,2],6))
a<-table.element(a, round(mysum$coefficients[i,3],4))
a<-table.element(a, round(mysum$coefficients[i,4],6))
a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable2.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R',1,TRUE)
a<-table.element(a, sqrt(mysum$r.squared))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'R-squared',1,TRUE)
a<-table.element(a, mysum$r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-squared',1,TRUE)
a<-table.element(a, mysum$adj.r.squared)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (value)',1,TRUE)
a<-table.element(a, mysum$fstatistic[1])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[2])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
a<-table.element(a, mysum$fstatistic[3])
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'p-value',1,TRUE)
a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
a<-table.element(a, mysum$sigma)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
a<-table.element(a, sum(myerror*myerror))
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable3.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Time or Index', 1, TRUE)
a<-table.element(a, 'Actuals', 1, TRUE)
a<-table.element(a, 'Interpolation<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />Prediction Error', 1, TRUE)
a<-table.row.end(a)
for (i in 1:n) {
a<-table.row.start(a)
a<-table.element(a,i, 1, TRUE)
a<-table.element(a,x[i])
a<-table.element(a,x[i]-mysum$resid[i])
a<-table.element(a,mysum$resid[i])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable4.tab')
if (n > n25) {
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'p-values',header=TRUE)
a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'breakpoint index',header=TRUE)
a<-table.element(a,'greater',header=TRUE)
a<-table.element(a,'2-sided',header=TRUE)
a<-table.element(a,'less',header=TRUE)
a<-table.row.end(a)
for (mypoint in kp3:nmkm3) {
a<-table.row.start(a)
a<-table.element(a,mypoint,header=TRUE)
a<-table.element(a,gqarr[mypoint-kp3+1,1])
a<-table.element(a,gqarr[mypoint-kp3+1,2])
a<-table.element(a,gqarr[mypoint-kp3+1,3])
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable5.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'Description',header=TRUE)
a<-table.element(a,'# significant tests',header=TRUE)
a<-table.element(a,'% significant tests',header=TRUE)
a<-table.element(a,'OK/NOK',header=TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'1% type I error level',header=TRUE)
a<-table.element(a,numsignificant1)
a<-table.element(a,numsignificant1/numgqtests)
if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'5% type I error level',header=TRUE)
a<-table.element(a,numsignificant5)
a<-table.element(a,numsignificant5/numgqtests)
if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'10% type I error level',header=TRUE)
a<-table.element(a,numsignificant10)
a<-table.element(a,numsignificant10/numgqtests)
if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
a<-table.element(a,dum)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by