Home » date » 2010 » Nov » 23 »

WS7 - Multiple regression model (incl. month)

*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 20:19:24 +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/t12905436462ra742ajwpssq04.htm/, Retrieved Tue, 23 Nov 2010 21:20:57 +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/t12905436462ra742ajwpssq04.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
13 13 14 13 3 2 9 12 12 8 13 5 1 9 15 10 12 16 6 0 9 12 9 7 12 6 3 9 10 10 10 11 5 3 9 12 12 7 12 3 1 9 15 13 16 18 8 3 9 9 12 11 11 4 1 9 12 12 14 14 4 4 9 11 6 6 9 4 0 9 11 5 16 14 6 3 9 11 12 11 12 6 2 9 15 11 16 11 5 4 9 7 14 12 12 4 3 9 11 14 7 13 6 1 9 11 12 13 11 4 1 9 10 12 11 12 6 2 9 14 11 15 16 6 3 9 10 11 7 9 4 1 9 6 7 9 11 4 1 9 11 9 7 13 2 2 9 15 11 14 15 7 3 9 11 11 15 10 5 4 9 12 12 7 11 4 2 9 14 12 15 13 6 1 9 15 11 17 16 6 2 9 9 11 15 15 7 2 9 13 8 14 14 5 4 9 13 9 14 14 6 2 9 16 12 8 14 4 3 9 13 10 8 8 4 3 9 12 10 14 13 7 3 9 14 12 14 15 7 4 9 11 8 8 13 4 2 9 9 12 11 11 4 2 9 16 11 16 15 6 4 9 12 12 10 15 6 3 9 10 7 8 9 5 4 9 13 11 14 13 6 2 9 16 11 16 16 7 5 9 14 12 13 13 6 3 9 15 9 5 11 3 1 9 5 15 8 12 3 1 9 8 11 10 12 4 1 9 11 11 8 12 6 2 9 16 11 13 14 7 3 9 17 11 15 14 5 9 9 9 15 6 8 4 0 9 9 11 12 13 5 0 9 13 12 16 16 6 2 9 10 12 5 13 6 2 9 6 9 15 11 6 3 10 12 12 12 14 5 1 10 8 12 8 13 4 2 10 14 13 13 13 5 0 10 12 11 14 13 5 5 10 1 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 time12 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Popularity[t] = + 2.39535698605526 + 0.108109507398842FindingFriends[t] + 0.211437082159555KnowingPeople[t] + 0.366476681384955Liked[t] + 0.601540871476521Celebrity[t] + 0.213410758679599Sum_friends[t] -0.255965716461004Month[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2.395356986055263.6242850.66090.5096850.254843
FindingFriends0.1081095073988420.095711.12960.2604780.130239
KnowingPeople0.2114370821595550.0637323.31760.0011410.000571
Liked0.3664766813849550.0968943.78220.0002240.000112
Celebrity0.6015408714765210.1557823.86140.0001688.4e-05
Sum_friends0.2134107586795990.1202351.77490.0779490.038974
Month-0.2559657164610040.361236-0.70860.479690.239845


Multiple Linear Regression - Regression Statistics
Multiple R0.71491764765422
R-squared0.511107242927444
Adjusted R-squared0.491420286266804
F-TEST (value)25.9617193118173
F-TEST (DF numerator)6
F-TEST (DF denominator)149
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.09424916265587
Sum Squared Residuals653.49605373744


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11311.45284927411811.54715072588193
21211.06578825803540.934211741964616
31513.18287772882771.81712227117231
41211.19190836113010.808091638869943
51010.9663115621461-0.966311562146098
6129.284792751537842.71520724846216
71516.9292219614242-1.92922196142420
8910.3656052702676-1.36560527026762
91212.7395788369399-0.739578836939947
10117.713398693627293.28660130637271
111113.3953574337406-2.39535743374061
121112.1485744532852-1.14857445328522
131512.55645432118192.44354567881813
14711.5865595659690-4.58655956596901
151111.6721110621500-0.67211106215004
161110.78847943458670.211520565413267
171012.1485744532852-2.14857445328522
181414.565530758744-0.565530758744012
19108.678794071460651.32120592853935
2069.4021835689543-3.40218356895430
21118.938810797929342.06118920207066
221514.58915786667600.410842133323976
231111.9785405576374-0.978540557637362
24129.7332677003092.26673229969100
251413.14738870462880.852611295371206
261514.77499416438350.225005835616476
27914.5871841901560-5.58718419015598
281312.90868167882110.0913183211789004
291313.1915105403373-0.191510540337265
301611.25754558530304.74245441469698
31138.84246648219564.15753351780439
321213.7480949965073-1.74809499650727
331414.9106781327545-0.910678132754465
341110.24522011564310.754779884356902
35910.5790160289472-1.57901602894722
361614.62390191819821.37609808180179
371213.2499781739601-1.24997817396013
38109.699566271540150.300433728459845
391313.04125287375-0.0412528737499953
401615.80533022973930.194669770260715
411413.15133605766890.848663942331119
42158.171113383637246.82888661636275
4359.82055835589392-4.82055835589392
44810.4125353620942-2.41253536209418
451111.4061536994077-0.406153699407712
461614.01124410313151.98875589686849
471714.51150107657522.48849892342483
4898.319907578831910.680092421168087
49911.5900163205952-2.59001632059517
501314.6716665896228-1.67166658962281
511011.2464286417128-1.24642864171284
52612.2609626205605-6.26096262056055
531212.0220475515976-0.0220475515975586
54810.4216924287775-2.42169242877746
551411.76170670109142.2382932989086
561212.8239785618513-0.823978561851266
571110.57663555383420.423364446165799
581614.51819386832451.48180613167552
59810.4797394641942-2.47973946419419
601514.50593782781230.4940621721877
6179.02685335855679-2.02685335855679
621614.10956902775111.89043097224890
631413.04636611322450.953633886775472
641613.30482976137932.6951702386207
65910.3363754497126-1.33637544971259
661412.08041871105181.91958128894824
671113.1651785828216-2.16517858282163
681310.23190877802992.76809122197012
691513.10878109988751.89121890011252
7055.65726792090425-0.657267920904248
711512.82397856185132.17602143814873
721312.50724022841100.492759771589045
731112.3427332380780-1.34273323807796
741114.1374678631938-3.13746786319380
751212.6811250029302-0.681125002930237
761213.318244505527-1.31824450552699
771212.2468993779048-0.246899377904798
781211.86139144013600.138608559864013
791410.78816911016243.21183088983758
8067.8493724000558-1.84937240005580
8179.63036790655335-2.63036790655335
821412.30705813278911.69294186721093
831414.1001016366435-0.100101636643497
841011.07484885055-1.07484885055001
85139.032774388116923.96722561188308
861212.2121553263826-0.212155326382611
8799.21415287722376-0.214152877223756
881211.84995037250830.150049627491654
891614.72132226301191.27867773698806
901010.3719540808328-0.371954080832819
911413.03896887280560.961031127194365
921013.5202141965789-3.52021419657894
931615.44406326199750.555936738002475
941513.31346257288891.68653742711114
951211.39636911662840.60363088337155
96109.261917548648360.738082451351644
97810.0250675474185-2.02506754741848
9888.61739393838537-0.617393938385365
991112.5923711263859-1.59237112638585
1001312.47249617688880.527503823111233
1011615.54739083675820.452609163241762
1021614.86614949845301.13385050154698
1031415.3628995742094-1.36289957420936
104118.96962129602462.03037870397541
10547.05721329823365-3.05721329823365
1061414.6716803892360-0.67168038923596
107910.4516545476615-1.45165454766152
1081415.1461701038511-1.14617010385110
109810.1798726295277-2.17987262952772
110810.6121245780331-2.61212457803312
1111111.8058285367999-0.805828536799874
1121213.0605258300489-1.06052583004894
1131110.98651557221180.0134844277882477
1141413.20150218661860.798497813381411
1151514.38490417467970.615095825320293
1161613.36517459735352.63482540264646
1171612.83305182871363.16694817128641
1181112.7242042158854-1.72420421588537
1191414.1115427042711-0.111542704271138
1201410.79285456863193.20714543136811
1211211.48085151609530.51914848390472
1221412.45355452742621.54644547257378
123810.7987755981920-2.79877559819202
1241314.0062414529904-1.00624145299038
1251613.89813194559152.10186805440846
1261210.54001429996061.45998570003937
1271615.40931921047530.590680789524662
1281212.6780122294882-0.678012229488191
1291111.3801461163627-0.380146116362679
13045.8412685850392-1.84126858503920
1311616.0495514865141-0.0495514865141337
1321512.57582375164952.42417624835052
1331011.3077117142527-1.30771171425273
1341313.9537913230963-0.953791323096314
1351513.04843626391321.95156373608677
1361210.41971875225741.58028124774258
1371413.57661167951310.423388320486901
138710.2974495280342-3.29744952803416
1391913.83778710961735.1622128903827
1401212.8689349771578-0.86893497715778
1411211.79166881997550.20833118002454
1421313.2598733460728-0.259873346072788
1431512.36292344853052.63707655146954
14488.703243084643-0.703243084643001
1451210.84456659309661.15543340690343
1461010.6737245918115-0.673724591811528
147811.1762992229593-3.17629922295934
1481014.5889371491730-4.58893714917302
1491513.78804876167271.21195123832735
1501613.97973608873252.02026391126752
1511313.177364623126-0.177364623126001
1521615.01921542115840.980784578841628
15399.73172180479402-0.731721804794023
1541412.98725684834091.01274315165905
1551413.05904275194280.940957248057168
1561210.11128910628921.88871089371080


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.1278914352084840.2557828704169680.872108564791516
110.1487861606256160.2975723212512330.851213839374384
120.07809752211031430.1561950442206290.921902477889686
130.5657695760871150.868460847825770.434230423912885
140.8345514723696170.3308970552607660.165448527630383
150.7653979771927530.4692040456144930.234602022807247
160.6826405775169710.6347188449660570.317359422483029
170.6278627665083550.7442744669832910.372137233491645
180.5411470439206110.9177059121587790.458852956079389
190.4593125507532350.918625101506470.540687449246765
200.742803998934360.5143920021312810.257196001065641
210.6842969964043430.6314060071913140.315703003595657
220.6524968797002310.6950062405995380.347503120299769
230.5846365696804950.830726860639010.415363430319505
240.5642013957166130.8715972085667750.435798604283387
250.5230006492044380.9539987015911240.476999350795562
260.4597019430122360.9194038860244720.540298056987764
270.717192424535840.5656151509283190.282807575464160
280.6630694013288210.6738611973423570.336930598671179
290.6040444396878150.791911120624370.395955560312185
300.7354506159061140.5290987681877710.264549384093886
310.8233720157905880.3532559684188240.176627984209412
320.7888852378841240.4222295242317520.211114762115876
330.7459288306001790.5081423387996420.254071169399821
340.7042306843874940.5915386312250120.295769315612506
350.6947582348701790.6104835302596420.305241765129821
360.6936765706629870.6126468586740260.306323429337013
370.664900322016470.6701993559670610.335099677983531
380.6143754060285530.7712491879428940.385624593971447
390.5674553471119860.8650893057760280.432544652888014
400.526587272190480.946825455619040.47341272780952
410.4918658617235460.9837317234470920.508134138276454
420.8132251779991720.3735496440016570.186774822000828
430.9502306452693950.09953870946120930.0497693547306046
440.9552553146568350.08948937068633040.0447446853431652
450.9421467217381180.1157065565237640.057853278261882
460.9486581963739850.1026836072520300.0513418036260152
470.952684836851150.09463032629769870.0473151631488494
480.9467346666251330.1065306667497340.0532653333748668
490.939075602812030.121848794375940.06092439718797
500.9238357115464060.1523285769071880.076164288453594
510.9170455763737460.1659088472525070.0829544236262537
520.9609440943852910.0781118112294180.039055905614709
530.975076926149460.04984614770107930.0249230738505397
540.9718371594252160.05632568114956770.0281628405747839
550.9889823815551780.02203523688964480.0110176184448224
560.9852109609431650.029578078113670.014789039056835
570.9810106844219460.03797863115610710.0189893155780536
580.9806333917426660.03873321651466810.0193666082573340
590.9852532081636030.02949358367279500.0147467918363975
600.9855554384724690.02888912305506160.0144445615275308
610.9845384820964260.03092303580714720.0154615179035736
620.9864424205334830.02711515893303420.0135575794665171
630.985098940130970.02980211973806230.0149010598690312
640.9886871930317250.02262561393654930.0113128069682746
650.9867947781676440.02641044366471280.0132052218323564
660.9864999679889420.02700006402211670.0135000320110583
670.9866340751044350.02673184979112920.0133659248955646
680.9897047455329940.02059050893401270.0102952544670063
690.9892021943903460.02159561121930810.0107978056096541
700.9858675309357570.02826493812848530.0141324690642427
710.986282202829730.02743559434054080.0137177971702704
720.9817692661036380.03646146779272420.0182307338963621
730.97851605965160.04296788069679930.0214839403483997
740.9851619440247660.02967611195046780.0148380559752339
750.980529196077030.03894160784594080.0194708039229704
760.9773110331044890.04537793379102270.0226889668955113
770.9704579322019940.0590841355960120.029542067798006
780.9615021579506960.0769956840986080.038497842049304
790.9751228418542850.04975431629142950.0248771581457147
800.9733729745939850.05325405081203080.0266270254060154
810.9765602916522050.04687941669559050.0234397083477953
820.976047241438450.04790551712310110.0239527585615505
830.9683880460654080.06322390786918430.0316119539345921
840.9611920973839560.07761580523208890.0388079026160445
850.98712121226980.02575757546040110.0128787877302006
860.9829159987821780.03416800243564420.0170840012178221
870.9772529927120760.04549401457584820.0227470072879241
880.9705500903059630.05889981938807420.0294499096940371
890.9648255717676840.0703488564646320.035174428232316
900.9548333852326670.09033322953466580.0451666147673329
910.9463822853504170.1072354292991660.053617714649583
920.9684594161694270.06308116766114660.0315405838305733
930.9595988229735570.08080235405288610.0404011770264430
940.9547199845947650.09056003081046940.0452800154052347
950.9435358785804190.1129282428391630.0564641214195815
960.9303705515340340.1392588969319320.0696294484659659
970.9234598037512260.1530803924975480.0765401962487741
980.9048819033103750.1902361933792500.0951180966896251
990.8981005795833680.2037988408332640.101899420416632
1000.876195105326840.247609789346320.12380489467316
1010.8501794250984820.2996411498030370.149820574901518
1020.825906868612140.3481862627757190.174093131387860
1030.8385541708630190.3228916582739630.161445829136981
1040.8828167306378040.2343665387243910.117183269362196
1050.8829925940970980.2340148118058040.117007405902902
1060.8576555866366670.2846888267266660.142344413363333
1070.8336779754009390.3326440491981220.166322024599061
1080.827560986979270.3448780260414610.172439013020730
1090.8230489187687990.3539021624624020.176951081231201
1100.848709810020750.3025803799584980.151290189979249
1110.8347267926308150.330546414738370.165273207369185
1120.8797075486575490.2405849026849020.120292451342451
1130.8497315507482740.3005368985034510.150268449251726
1140.8188034970572660.3623930058854680.181196502942734
1150.7801872656628480.4396254686743040.219812734337152
1160.780552901422370.4388941971552580.219447098577629
1170.7961343451799270.4077313096401460.203865654820073
1180.7832857293160270.4334285413679460.216714270683973
1190.7372809144726180.5254381710547640.262719085527382
1200.804883376779090.390233246441820.19511662322091
1210.7714221960679940.4571556078640130.228577803932006
1220.7418153757850390.5163692484299210.258184624214961
1230.7375831535085970.5248336929828050.262416846491403
1240.6914008873725850.617198225254830.308599112627415
1250.6870116480504970.6259767038990070.312988351949503
1260.6687336148610580.6625327702778850.331266385138942
1270.6093459523972730.7813080952054540.390654047602727
1280.5752836861544360.8494326276911280.424716313845564
1290.5909362793226170.8181274413547670.409063720677383
1300.5816198573322990.8367602853354020.418380142667701
1310.5125338933303910.9749322133392180.487466106669609
1320.4984658361913230.9969316723826460.501534163808677
1330.4636117422821130.9272234845642260.536388257717887
1340.3949575926294500.7899151852588990.605042407370550
1350.3680375450366760.7360750900733530.631962454963324
1360.3605434839510510.7210869679021030.639456516048948
1370.2907907980571170.5815815961142350.709209201942883
1380.3637061405090170.7274122810180340.636293859490983
1390.7189874456702850.562025108659430.281012554329715
1400.7396645315016080.5206709369967840.260335468498392
1410.6840940921373040.6318118157253930.315905907862697
1420.5844214761240330.8311570477519330.415578523875967
1430.5303791054277880.9392417891444230.469620894572212
1440.4053528230364980.8107056460729970.594647176963502
1450.3718906746069710.7437813492139420.628109325393029
1460.5073890476363150.9852219047273710.492610952363685


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level290.211678832116788NOK
10% type I error level450.328467153284672NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905436462ra742ajwpssq04/10z15n1290543551.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905436462ra742ajwpssq04/10z15n1290543551.ps (open in new window)


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


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


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


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


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


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


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t12905436462ra742ajwpssq04/9oao21290543551.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t12905436462ra742ajwpssq04/9oao21290543551.ps (open in new window)


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





Copyright

Creative Commons License

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

Software written by Ed van Stee & Patrick Wessa


Disclaimer

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


Privacy Policy

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

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

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

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

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

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

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

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

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


FreeStatistics.org is powered by