Home » date » 2010 » Dec » 03 »

include seasonal dummies

*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: Fri, 03 Dec 2010 14:40:13 +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/03/t1291387152aynsvh3jhq4tjus.htm/, Retrieved Fri, 03 Dec 2010 15:39:12 +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/03/t1291387152aynsvh3jhq4tjus.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 «
4 4 1 4 5 4 2 1 4 4 4 3 2 5 5 4 2 1 3 4 4 2 2 4 3 5 2 1 3 5 4 1 3 4 4 3 1 1 3 4 4 1 1 2 4 4 2 1 4 4 4 2 2 2 4 4 2 4 2 4 4 2 2 2 4 2 2 1 1 3 3 1 1 4 4 4 3 3 4 5 3 2 2 2 4 2 2 2 2 2 4 2 3 3 4 3 2 3 3 4 3 3 1 3 4 4 4 2 4 4 3 2 2 3 4 3 2 2 2 4 4 2 2 2 5 4 1 3 4 4 4 2 2 4 4 4 2 2 3 4 4 2 2 4 4 4 2 2 2 4 5 4 2 4 5 4 2 3 4 4 4 4 2 5 2 4 3 2 5 5 3 1 2 4 4 4 4 2 4 5 3 3 2 4 4 4 2 1 2 4 4 4 2 4 4 3 2 1 4 4 5 3 2 4 5 4 3 2 3 4 3 2 2 2 4 3 1 2 3 5 3 2 2 4 4 4 1 3 3 4 4 2 2 2 4 4 4 2 4 4 4 2 2 4 4 4 2 4 3 4 4 2 1 4 4 4 2 2 3 4 5 2 2 4 5 3 1 1 2 3 3 2 5 4 4 5 3 2 4 5 5 2 2 4 5 4 2 2 4 4 4 1 1 3 5 3 1 2 1 2 4 2 2 3 4 4 2 2 3 4 5 1 2 4 4 4 2 2 2 4 4 1 1 3 4 5 4 1 5 5 4 4 2 4 4 3 1 2 4 4 4 1 1 3 4 4 3 2 4 4 4 4 2 2 3 4 2 1 3 4 4 4 3 4 5 4 4 3 3 5 4 3 3 4 4 3 4 2 4 4 4 2 2 3 5 3 2 2 3 4 5 2 1 2 5 4 2 4 4 3 5 2 3 3 4 5 2 2 2 4 4 2 2 2 4 4 1 2 3 4 4 3 1 2 5 4 3 2 2 4 4 2 3 4 4 5 4 1 4 5 4 4 2 4 3 3 2 2 2 4 4 2 2 2 4 3 1 1 4 5 4 1 1 2 4 4 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
R Framework
error message
The field 'Names of X columns' contains a hard return which cannot be interpreted.
Please, resubmit your request without hard returns in the 'Names of X columns'.


Multiple Linear Regression - Estimated Regression Equation
neat[t] = + 1.16440603291601 + 0.233139663569593fail[t] -0.187500338062230performance[t] + 0.0368726688412969goals[t] + 0.504275569488782`organized `[t] -0.103650819474029M1[t] -0.226062653000361M2[t] -0.0783105813127394M3[t] -0.0557740260137624M4[t] + 0.00511871995110706M5[t] -0.297902963614086M6[t] + 0.0502897975057321M7[t] -0.0686403005221799M8[t] + 0.408636087855733M9[t] + 0.451578435262287M10[t] + 0.129307371579808M11[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.164406032916010.5383322.1630.0322040.016102
fail0.2331396635695930.0776573.00220.0031650.001582
performance-0.1875003380622300.080182-2.33840.0207510.010375
goals0.03687266884129690.0819260.45010.6533390.326669
`organized `0.5042755694887820.0937935.376500
M1-0.1036508194740290.3483-0.29760.7664480.383224
M2-0.2260626530003610.345762-0.65380.5142840.257142
M3-0.07831058131273940.353381-0.22160.8249380.412469
M4-0.05577402601376240.354427-0.15740.875180.43759
M50.005118719951107060.3555620.01440.9885340.494267
M6-0.2979029636140860.353007-0.84390.4001340.200067
M70.05028979750573210.3566240.1410.8880550.444028
M8-0.06864030052217990.355554-0.19310.8471930.423596
M90.4086360878557330.3533821.15640.2494620.124731
M100.4515784352622870.3564921.26670.2073120.103656
M110.1293073715798080.3535460.36570.7150970.357548


Multiple Linear Regression - Regression Statistics
Multiple R0.559418807599365
R-squared0.312949402295896
Adjusted R-squared0.240881157781479
F-TEST (value)4.34240357045596
F-TEST (DF numerator)15
F-TEST (DF denominator)143
p-value1.20466221420479e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.895728514469576
Sum Squared Residuals114.733128743644


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
144.47468205246722-0.474682052467218
243.381715322312920.61828467768708
344.11625495783798-0.116254957837984
443.515131280458220.484868719541778
542.921120787713381.07887921228662
653.777277912346681.22272208765332
743.049927433124960.95007256687504
833.26912534238021-0.269125342380211
943.709529061916830.290470938083173
1044.05935641057557-0.0593564105755689
1143.475839671148270.524160328851734
1242.9715316234441.02846837655600
1343.242881480094430.757118519905572
1422.76682174630025-0.766821746300248
1533.29632773043095-0.296327730430949
1643.914418506233440.0855814937665648
1733.35165101951957-0.351651019519565
1822.04007819697681-0.0400781969768069
1943.246194427853260.753805572146743
2033.12726432982535-0.127264329825345
2134.21268105789731-1.21268105789731
2244.33813539965253-0.338135399652526
2333.51271233998956-0.512712339989562
2433.34653229956846-0.346532299568458
2543.747157049583210.252842950416789
2642.773574982618871.22642501738113
2743.341967055938310.658032944061688
2843.327630942395990.672369057604008
2943.425396357202160.574603642797842
3043.048629335954370.951370664045629
3154.441122331384750.558877668615247
3243.164136998666640.835863001333358
3343.323514582109700.676485417890296
3444.64614397441301-0.646143974413012
3533.31644534526127-0.316445345261266
3644.39083253387902-0.390832533879021
3733.54976648134662-0.549766481346616
3843.307969984630330.692030015369673
3943.80824638307750.191753616922501
4033.55200394929952-0.552003949299519
4154.162811590260530.837188409739466
4243.318641668365260.681358331634738
4333.39682209707419-0.39682209707419
4433.58590057380676-0.585900573806764
4533.82891372510678-0.828913725106785
4643.414343402040220.585656597959781
4743.475839671148270.524160328851735
4843.886556964390240.113443035609762
4943.316626817777020.683373182222978
5042.782341639284931.21765836071507
5143.529467394000540.470532605999458
5243.327630942395990.672369057604008
5353.929671926690941.07032807330906
5432.498714440958230.501285559041775
5532.908066420570090.0919335794299056
5654.089052569787250.910947430212752
5754.333189294595570.666810705404434
5843.871856072513340.128143927486661
5943.971348583970980.0286514160290192
6032.067968828180000.932031171819997
6143.279754148935730.720245851064275
6243.157342315409390.842657684590606
6353.108827392368721.89117260763128
6443.290758273554700.709241726445305
6543.34288436285350.657115637146501
6654.317302577168460.682697422831539
6743.936846761895970.0631532381040295
6833.11849767315928-0.118497673159278
6943.746401730758120.253598269241876
7044.10499573608293-0.104995736082932
7143.437843428798670.56215657120133
7243.570905306471980.429094693528015
7344.09968137634276-0.0996813763427617
7443.940396873975130.059603126024867
7543.387606381445680.612393618554324
7633.83078293837648-0.830782938376476
7743.892799257849640.107200742150356
7833.08550200479567-0.0855020047956682
7954.08859800462520.911401995374799
8042.472361091115631.52763890888437
8153.604540718203261.39545928179674
8253.798110734830751.20188926516925
8343.475839671148270.524160328851735
8443.150265304840160.849734695159838
8544.16779705121503-0.167797051215034
8643.353609310137690.64639068986231
8743.154466717876080.845533282123917
8854.522558845927490.477441154072512
8943.387400114852560.612599885147437
9033.04862933595437-0.0486293359543713
9143.396822097074190.60317790292581
9233.81027358071029-0.81027358071029
9343.709529061916830.290470938083173
9443.097568170613670.902431829386333
9544.01698790947834-0.0169879094783445
9643.586425199456670.413574800543329
9744.0171693819941-0.0171693819941009
9833.28549363526542-0.285493635265418
9933.49259472515925-0.492594725159245
10033.10325793549247-0.103257935492466
10133.89167568434135-0.891675684341345
10233.08550200479567-0.0855020047956682
10322.28328261438306-0.283282614383056
10433.12726432982535-0.127264329825345
10554.333189294595570.666810705404434
10623.4064665922133-1.4064665922133
10723.19593710856301-1.19593710856301
10832.571120824160490.428879175839513
10933.09225381087350-0.0922538108734954
11023.19421498425069-1.19421498425069
11123.07195472352742-1.07195472352742
11242.860228041748511.13977195825149
11332.041844542100130.958155457899865
11412.01872542112020-1.01872542112020
11512.7117994258418-1.71179942584180
11612.15558585968908-1.15558585968908
11723.61330737486932-1.61330737486932
11823.45998272754758-1.45998272754758
11932.353533531791070.646466468208935
12012.60911706651008-1.60911706651008
12132.204210908594190.795789091405813
12212.65306674592061-1.65306674592061
12323.15446671787608-1.15446671787608
12413.13136394766769-2.13136394766769
12523.42539635720216-1.42539635720216
12622.85123876771778-0.851238767717776
12732.899299763904030.100700236095972
12823.01350932944571-1.01350932944571
12923.49078571782362-1.49078571782362
13042.525176926252611.47482307374739
13123.36208467076863-1.36208467076863
13233.92455320673983-0.924553206739833
13322.74535914692427-0.745359146924266
13412.77357498261887-1.77357498261887
13523.34196705593831-1.34196705593831
13632.951506692763230.0484933072367657
13711.72506931067358-0.725069310673583
13822.86112899789214-0.861128997892141
13922.77879152720577-0.778791527205772
14032.586116091495270.413883908504734
14133.10026514871448-0.100265148714476
14231.984028687922531.01597131207747
14343.575884978829060.424115021170941
14443.691413543170240.308586456829760
14523.74603347607491-1.74603347607491
14632.314938738637450.685061261362551
14733.38760638144568-0.387606381445675
14822.67272770368628-0.672727703686277
14913.5022786887405-2.5022786887405
15023.04862933595437-1.04862933595437
15122.86242709506273-0.86242709506273
15243.480912230093190.519087769906806
15342.994153231492611.00584676850739
15423.29383516534196-1.29383516534196
15532.829703089104620.170296910895383
15623.23277729918882-1.23277729918882
15743.316626817777020.683373182222978
15822.31493873863745-0.314938738637449
15943.80824638307750.191753616922501


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
190.3894866938302130.7789733876604250.610513306169787
200.2491946794566890.4983893589133780.750805320543311
210.1688757407555790.3377514815111570.831124259244421
220.1276670438662610.2553340877325230.872332956133739
230.1631412311969630.3262824623939250.836858768803037
240.1231554302009230.2463108604018460.876844569799077
250.08544257948931990.1708851589786400.91455742051068
260.05753612226891490.1150722445378300.942463877731085
270.0578326831329740.1156653662659480.942167316867026
280.03715977919061580.07431955838123150.962840220809384
290.02181744474693660.04363488949387320.978182555253063
300.01338974902510560.02677949805021120.986610250974894
310.01300514327526640.02601028655053280.986994856724734
320.01111931038737730.02223862077475450.988880689612623
330.01189076738082890.02378153476165780.988109232619171
340.0118069214227880.0236138428455760.988193078577212
350.01272386974384930.02544773948769870.98727613025615
360.008051703181976840.01610340636395370.991948296818023
370.009653077288668830.01930615457733770.990346922711331
380.00881744009984130.01763488019968260.991182559900159
390.006096886006240390.01219377201248080.99390311399376
400.005245891886978370.01049178377395670.994754108113022
410.00382121710652050.0076424342130410.99617878289348
420.002403013285333010.004806026570666010.997596986714667
430.002046876480053150.00409375296010630.997953123519947
440.001726032777523680.003452065555047360.998273967222476
450.002610820690460320.005221641380920640.99738917930954
460.001709653835366420.003419307670732830.998290346164634
470.001477627888735980.002955255777471970.998522372111264
480.000920908787530870.001841817575061740.99907909121247
490.000626562640725340.001253125281450680.999373437359275
500.0004770377003463190.0009540754006926380.999522962299654
510.0003535014050944160.0007070028101888330.999646498594906
520.0002480061588587650.000496012317717530.999751993841141
530.0002182081466978950.0004364162933957910.999781791853302
540.0001360660076731950.000272132015346390.999863933992327
550.0002370914477654490.0004741828955308970.999762908552235
560.0003466060439562440.0006932120879124890.999653393956044
570.0002787658125741250.000557531625148250.999721234187426
580.0001661192124820540.0003322384249641080.999833880787518
599.54800918344141e-050.0001909601836688280.999904519908166
600.000116642088679680.000233284177359360.99988335791132
618.71007296529408e-050.0001742014593058820.999912899270347
626.80191745603982e-050.0001360383491207960.99993198082544
630.0003204479178127380.0006408958356254770.999679552082187
640.0002725025773168090.0005450051546336180.999727497422683
650.0002311995678559270.0004623991357118530.999768800432144
660.0001686456912742060.0003372913825484130.999831354308726
670.0001019174220468100.0002038348440936210.999898082577953
686.63092256175881e-050.0001326184512351760.999933690774382
694.23260735205411e-058.46521470410822e-050.99995767392648
702.43221562476849e-054.86443124953698e-050.999975677843752
712.40579473459002e-054.81158946918004e-050.999975942052654
721.67866214927207e-053.35732429854414e-050.999983213378507
731.07595194635430e-052.15190389270859e-050.999989240480537
747.21226994508636e-061.44245398901727e-050.999992787730055
754.77982837205004e-069.55965674410008e-060.999995220171628
765.92477760722104e-061.18495552144421e-050.999994075222393
774.92431114716134e-069.84862229432268e-060.999995075688853
785.33893024772167e-061.06778604954433e-050.999994661069752
791.03537031425204e-052.07074062850407e-050.999989646296857
802.25553382702842e-054.51106765405684e-050.99997744466173
815.24086790730982e-050.0001048173581461960.999947591320927
820.0001302599405136570.0002605198810273150.999869740059486
830.0001077041006287390.0002154082012574790.999892295899371
840.0001181305569940100.0002362611139880210.999881869443006
857.30537924276685e-050.0001461075848553370.999926946207572
869.10397751189378e-050.0001820795502378760.999908960224881
879.90043636553333e-050.0001980087273106670.999900995636345
880.0001015186726789620.0002030373453579240.999898481327321
899.97726549201909e-050.0001995453098403820.99990022734508
900.0001053576597843010.0002107153195686020.999894642340216
910.0001881224080869160.0003762448161738320.999811877591913
920.0001651114440928990.0003302228881857990.999834888555907
930.0002097584919398630.0004195169838797260.99979024150806
940.0003679324682706510.0007358649365413030.99963206753173
950.000317599287398960.000635198574797920.999682400712601
960.0002335671440649230.0004671342881298460.999766432855935
970.0001715566167439380.0003431132334878770.999828443383256
980.0001708339444276750.0003416678888553490.999829166055572
990.0001822126989238370.0003644253978476740.999817787301076
1000.0001840986673336360.0003681973346672720.999815901332666
1010.0002183592434604190.0004367184869208380.99978164075654
1020.0002613964162467970.0005227928324935950.999738603583753
1030.0002456583781669390.0004913167563338780.999754341621833
1040.0001792370518267980.0003584741036535960.999820762948173
1050.000972117405102890.001944234810205780.999027882594897
1060.001114365000011810.002228730000023610.998885634999988
1070.001202885972048190.002405771944096380.998797114027952
1080.0008520162018242130.001704032403648430.999147983798176
1090.0006466584600090510.001293316920018100.999353341539991
1100.001048727192116810.002097454384233620.998951272807883
1110.001663818584453550.003327637168907110.998336181415546
1120.006563123328729810.01312624665745960.99343687667127
1130.008469646600580850.01693929320116170.99153035339942
1140.01846631530942790.03693263061885570.981533684690572
1150.06871817191469420.1374363438293880.931281828085306
1160.1199036998865560.2398073997731120.880096300113444
1170.1414702232907840.2829404465815690.858529776709216
1180.1917306878387820.3834613756775640.808269312161218
1190.1911034690592850.3822069381185710.808896530940715
1200.2717764541318510.5435529082637020.728223545868149
1210.2424041580393660.4848083160787320.757595841960634
1220.2653280950530030.5306561901060060.734671904946997
1230.2657700097727560.5315400195455130.734229990227244
1240.308955977166630.617911954333260.69104402283337
1250.3232353797295010.6464707594590020.676764620270499
1260.2727714716905160.5455429433810310.727228528309484
1270.2616201320929660.5232402641859320.738379867907034
1280.3421053378545580.6842106757091150.657894662145442
1290.3830693239059370.7661386478118740.616930676094063
1300.4125526471298080.8251052942596170.587447352870192
1310.4602243764329940.9204487528659880.539775623567006
1320.3938393131377760.7876786262755510.606160686862224
1330.3666410572711850.7332821145423710.633358942728815
1340.5021308072897130.9957383854205750.497869192710287
1350.5597586930395680.8804826139208640.440241306960432
1360.5131883037511760.9736233924976480.486811696248824
1370.4189324062805010.8378648125610020.581067593719499
1380.3088805148075160.6177610296150320.691119485192484
1390.2027364947437680.4054729894875370.797263505256232
1400.3850209006560090.7700418013120190.61497909934399


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level710.581967213114754NOK
5% type I error level860.704918032786885NOK
10% type I error level870.71311475409836NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/10cubs1291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/10cubs1291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/15tey1291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/15tey1291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/2y2d11291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/2y2d11291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/3y2d11291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/3y2d11291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/4y2d11291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/4y2d11291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/5y2d11291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/5y2d11291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/69bcm1291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/69bcm1291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/7jlu71291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/7jlu71291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/8jlu71291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/8jlu71291387202.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/9cubs1291387202.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291387152aynsvh3jhq4tjus/9cubs1291387202.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Include Monthly Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly 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