Home » date » 2010 » Nov » 23 »

workshop 7.2

*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 16:02:49 +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/t1290528123w1mznyykyjyy1ou.htm/, Retrieved Tue, 23 Nov 2010 17:02:03 +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/t1290528123w1mznyykyjyy1ou.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 4 2 5 4 3 9 4 2 4 3 2 9 5 4 4 2 2 9 3 2 4 2 2 9 4 3 2 2 2 9 3 4 5 2 2 10 4 3 5 3 2 10 3 3 4 2 1 10 2 3 3 1 2 10 4 2 4 2 2 10 2 4 4 2 2 10 2 3 3 2 2 10 1 3 3 2 2 10 4 4 4 2 2 10 4 4 5 1 1 10 2 3 4 2 2 10 2 3 2 2 1 10 3 3 4 3 2 10 3 4 4 4 2 10 3 2 4 4 2 10 4 5 4 4 4 10 3 4 4 4 2 10 2 2 4 4 4 10 2 3 5 2 2 10 4 4 4 2 2 10 4 4 4 4 2 10 3 3 4 2 2 10 4 4 4 3 2 10 2 4 4 2 2 10 4 1 4 4 2 10 4 4 4 3 3 10 5 5 2 4 2 10 5 2 4 2 2 10 4 4 4 2 2 10 4 3 5 4 3 10 4 2 5 5 4 10 2 4 4 2 1 10 4 5 3 4 2 10 4 4 4 4 3 10 4 4 5 5 3 10 3 4 4 3 2 10 2 3 4 2 2 10 3 4 5 3 2 10 4 2 4 2 2 10 3 2 5 1 2 10 2 4 4 2 2 10 4 2 4 4 4 10 4 4 4 4 4 10 3 4 3 4 2 10 4 1 4 4 3 10 3 4 4 2 2 10 4 2 4 2 2 10 2 1 2 1 1 10 4 4 3 4 3 10 4 3 5 2 4 10 4 2 4 4 2 10 4 4 4 2 2 10 3 3 5 2 1 10 1 2 3 1 2 10 3 2 5 2 2 10 3 3 4 2 2 10 4 2 5 2 2 10 2 1 4 2 2 10 3 3 4 1 1 10 5 2 5 5 2 10 4 3 4 3 3 10 4 3 4 2 2 10 3 3 5 1 1 10 4 2 4 2 2 10 2 3 3 4 4 10 3 2 4 2 2 10 4 4 5 5 3 10 3 4 5 4 4 10 4 4 5 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 time18 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
YT[t] = + 8.33389075361305 -0.707921514339938T1[t] + 0.0765528746818012X1[t] + 0.247513466468539X2[t] + 0.36568320992491X3[t] -0.115580997002372X4[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)8.333890753613053.5874742.32310.0215110.010756
T1-0.7079215143399380.35828-1.97590.049990.024995
X10.07655287468180120.0730271.04830.2961860.148093
X20.2475134664685390.0818683.02330.0029380.001469
X30.365683209924910.0717685.09531e-061e-06
X4-0.1155809970023720.088948-1.29940.1957820.097891


Multiple Linear Regression - Regression Statistics
Multiple R0.478227147881944
R-squared0.228701204971298
Adjusted R-squared0.203161509771673
F-TEST (value)8.9547350970206
F-TEST (DF numerator)5
F-TEST (DF denominator)151
p-value1.80539287630843e-07
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.858434433593512
Sum Squared Residuals111.273361193631


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
144.46926005495242-0.469260054952424
243.971644375561350.0283556244386497
353.759066915000041.24093308499996
433.60596116563644-0.605961165636439
543.187487107381160.812512892618836
634.00658038146858-1.00658038146858
743.587789202371750.412210797628248
833.09017352298067-0.0901735229806749
922.36139584958485-0.361395849584854
1042.89803965129651.10196034870350
1123.05114540066010-1.05114540066010
1222.72707905950976-0.727079059509764
1312.72707905950976-1.72707905950976
1443.051145400660100.948854599339896
1543.048556654206100.951443345793895
1622.9745925259783-0.974592525978303
1722.5951465900436-0.595146590043597
1833.34027573590321-0.340275735903213
1933.78251182050992-0.782511820509925
2033.62940607114632-0.629406071146322
2143.627902701186980.372097298813019
2233.78251182050992-0.782511820509925
2323.39824407714158-1.39824407714158
2423.22210599244684-1.22210599244684
2543.051145400660100.948854599339896
2643.782511820509920.217488179490076
2732.97459252597830.0254074740216973
2843.416828610585010.583171389414986
2923.05114540066010-1.05114540066010
3043.552853196464520.447146803535479
3143.301247613582640.698752386417358
3253.364037762254651.63596223774535
3352.89803965129652.1019603487035
3443.051145400660100.948854599339896
3543.837891415294290.162108584705710
3644.01144075353503-0.0114407535350267
3723.16672639766248-1.16672639766248
3843.611551228723190.388448771276813
3943.666930823507550.333069176492448
4044.280127499901-0.280127499901001
4133.41682861058501-0.416828610585014
4222.9745925259783-0.974592525978303
4333.66434207705355-0.664342077053553
4442.89803965129651.10196034870350
4532.779869907840130.22013009215987
4623.05114540066010-1.05114540066010
4743.398244077141580.601755922858422
4843.551349826505180.44865017349482
4933.53499835404139-0.534998354041386
5043.437272199462150.562727800537851
5133.05114540066010-0.0511454006601039
5242.89803965129651.10196034870350
5322.07635763075508-0.0763576307550847
5443.419417357039010.580582642960986
5542.990943998442101.00905600155790
5643.629406071146320.370593928853678
5743.051145400660100.948854599339896
5833.33768698944921-0.337686989449214
5912.28484297490305-1.28484297490305
6033.14555311776504-0.14555311776504
6132.97459252597830.0254074740216973
6243.145553117765040.85444688223496
6322.8214867766147-0.8214867766147
6432.724490313055760.275509686944235
6554.242602747539770.757397252460229
6643.224694738900840.77530526109916
6742.974592525978301.02540747402170
6832.972003779524300.0279962204756967
6942.89803965129651.10196034870350
7023.22728348535484-1.22728348535484
7132.89803965129650.101960348703499
7244.280127499901-0.280127499901001
7333.79886329297372-0.798863292973719
7443.664342077053550.335657922946447
7542.666877657291761.33312234270824
7633.09017352298067-0.0901735229806749
7733.29865886712864-0.298658867128643
7823.22210599244684-1.22210599244684
7943.551349826505180.44865017349482
8033.02997212076267-0.0299721207626679
8122.72707905950976-0.727079059509764
8223.70595894582812-1.70595894582812
8333.78251182050992-0.782511820509925
8422.78245865429413-0.78245865429413
8523.05114540066010-1.05114540066010
8643.263722861221410.736277138778588
8743.261134114767410.738865885232587
8843.782511820509920.217488179490076
8922.9745925259783-0.974592525978303
9023.55134982650518-1.55134982650518
9142.89545090484251.10454909515750
9222.65052618482796-0.650526184827963
9333.09276226943467-0.0927622694346742
9433.22210599244684-0.222105992446841
9553.875416167655521.12458383234448
9632.666877657291760.333122342708243
9743.224694738900840.77530526109916
9833.05114540066010-0.0511454006601039
9922.85901152897593-0.85901152897593
10043.051145400660100.948854599339896
10133.09017352298067-0.0901735229806749
10232.97459252597830.0254074740216973
10332.89803965129650.101960348703499
10443.587789202371750.412210797628248
10512.17185072435468-1.17185072435468
10632.97459252597830.0254074740216973
10723.01879814120687-1.01879814120687
10833.30124761358264-0.301247613582642
10923.14555311776504-1.14555311776504
11022.55352972126903-0.553529721269027
11122.81998340665536-0.81998340665536
11242.573973310146161.42602668985384
11354.224747905116640.775252094883364
11452.647937438373962.35206256162604
11532.97459252597830.0254074740216973
11642.556118467723031.44388153227697
11742.078946377209081.92105362279092
11833.01211727833953-0.0121172783395329
11922.84266005651214-0.842660056512136
12043.956061158750660.0439388412493387
12122.72707905950976-0.727079059509764
12232.611498062507390.388501937492608
12323.26113411476741-1.26113411476741
12422.8980396512965-0.898039651296502
12522.68805093718919-0.688050937189193
12643.166726397662480.833273602337524
12743.340275735903210.659724264096787
12842.974592525978301.02540747402170
12943.590377948825750.409622051174249
13033.53499835404139-0.534998354041386
13122.9745925259783-0.974592525978303
13243.782511820509920.217488179490076
13333.78251182050992-0.782511820509925
13422.8980396512965-0.898039651296502
13543.782511820509920.217488179490076
13632.90062839775050.0993716022494993
13733.05114540066010-0.0511454006601039
13832.97459252597830.0254074740216973
13932.729667805963760.270332194036237
14033.13437913820924-0.134379138209244
14143.629406071146320.370593928853678
14253.845301969181931.15469803081807
14323.01362064829887-1.01362064829887
14443.109113741898470.890886258101531
14533.70854769228212-0.708547692282123
14632.363984596038850.636015403961147
14712.47956559304123-1.47956559304123
14823.05114540066010-1.05114540066010
14942.803631934191571.19636806580843
15042.819983406655361.18001659334464
15154.032614033432460.967385966567537
15222.80622068064556-0.806220680645565
15343.375211741810440.624788258189556
15432.97459252597830.0254074740216973
15523.34027573590321-1.34027573590321
15643.301247613582640.698752386417358
15722.45688894318445-0.456888943184449


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.4785168085295340.9570336170590670.521483191470466
100.6995720518047810.6008558963904370.300427948195219
110.7805608935647020.4388782128705950.219439106435298
120.7682443346515710.4635113306968570.231755665348429
130.8752719626610180.2494560746779640.124728037338982
140.909776371747670.180447256504660.09022362825233
150.888346165263250.2233076694735010.111653834736751
160.8704928033754960.2590143932490070.129507196624504
170.8395166895817510.3209666208364980.160483310418249
180.7832543064188670.4334913871622670.216745693581134
190.7266564084857540.5466871830284930.273343591514246
200.6602118482109790.6795763035780420.339788151789021
210.6608475882702240.6783048234595520.339152411729776
220.6064812423148240.7870375153703530.393518757685176
230.5901152782907670.8197694434184660.409884721709233
240.6199493181798810.7601013636402390.380050681820119
250.6421921633292360.7156156733415270.357807836670764
260.5949396067649860.8101207864700270.405060393235014
270.5352354649131790.9295290701736420.464764535086821
280.5062163728457690.9875672543084620.493783627154231
290.5370691538893780.9258616922212440.462930846110622
300.5735105106800050.852978978639990.426489489319995
310.5806905754856960.8386188490286080.419309424514304
320.6579805656958030.6840388686083930.342019434304197
330.9086508619588640.1826982760822710.0913491380411355
340.9082660765304640.1834678469390730.0917339234695364
350.8867807279167990.2264385441664020.113219272083201
360.8626414238523920.2747171522952150.137358576147608
370.8868429048533280.2263141902933430.113157095146672
380.8604365248694580.2791269502610840.139563475130542
390.8307400364784420.3385199270431150.169259963521558
400.797717614157090.4045647716858190.202282385842909
410.7670014479842250.4659971040315510.232998552015775
420.7668809127043160.4662381745913670.233119087295684
430.743261163513560.5134776729728810.256738836486440
440.7811640774439320.4376718451121360.218835922556068
450.7479048510603340.5041902978793330.252095148939666
460.7626611501390350.474677699721930.237338849860965
470.739085139073840.521829721852320.26091486092616
480.7026323629573810.5947352740852380.297367637042619
490.6748121739056530.6503756521886940.325187826094347
500.6467772484940020.7064455030119950.353222751505998
510.5984837450678760.8030325098642470.401516254932124
520.6253914590579250.749217081884150.374608540942075
530.5798303289448670.8403393421102650.420169671055133
540.5456694628914950.908661074217010.454330537108505
550.5422123356753890.9155753286492230.457787664324611
560.505987687540510.988024624918980.49401231245949
570.512256373948260.975487252103480.48774362605174
580.4668370749672940.9336741499345890.533162925032705
590.5419740971303150.916051805739370.458025902869685
600.4939720160164170.9879440320328350.506027983983583
610.4454776878597660.8909553757195320.554522312140234
620.4476188436462860.8952376872925710.552381156353714
630.4408310377344510.8816620754689020.559168962265549
640.4008822152536980.8017644305073970.599117784746302
650.3975590418660310.7951180837320620.602440958133969
660.3834591543892340.7669183087784680.616540845610766
670.3992511968848780.7985023937697560.600748803115122
680.3544643820149670.7089287640299340.645535617985033
690.379850194668840.759700389337680.62014980533116
700.4379051998232530.8758103996465070.562094800176747
710.3922993209402430.7845986418804860.607700679059757
720.3522939675696520.7045879351393030.647706032430349
730.347125138708280.694250277416560.65287486129172
740.3107815801302040.6215631602604070.689218419869796
750.3623784456845240.7247568913690490.637621554315476
760.3193568084471070.6387136168942140.680643191552893
770.2833004052888260.5666008105776510.716699594711174
780.3218514237517790.6437028475035580.678148576248221
790.2910597794507060.5821195589014110.708940220549295
800.2532750244002890.5065500488005790.74672497559971
810.2443517343309510.4887034686619020.755648265669049
820.3512241318111360.7024482636222730.648775868188864
830.3416376454164350.6832752908328690.658362354583565
840.3357011502013240.6714023004026480.664298849798676
850.3581147433507720.7162294867015440.641885256649228
860.3472114919025110.6944229838050230.652788508097489
870.3370732407680940.6741464815361880.662926759231906
880.2981666865227280.5963333730454570.701833313477272
890.308525269033450.61705053806690.69147473096655
900.4031367341606160.8062734683212320.596863265839384
910.4363044032862270.8726088065724550.563695596713773
920.4122388972171480.8244777944342950.587761102782853
930.3671138062446870.7342276124893740.632886193755313
940.3252543689962990.6505087379925980.674745631003701
950.3495588247382670.6991176494765340.650441175261733
960.3179279592819610.6358559185639220.682072040718039
970.3131062202151920.6262124404303830.686893779784808
980.2717191767083630.5434383534167260.728280823291637
990.2656336914726070.5312673829452150.734366308527393
1000.2700027411312790.5400054822625590.72999725886872
1010.2314439316501960.4628878633003920.768556068349804
1020.1956784674079450.3913569348158900.804321532592055
1030.1646523917644190.3293047835288380.835347608235581
1040.1441299216531280.2882598433062550.855870078346872
1050.1625736367339190.3251472734678380.837426363266081
1060.1337918834181280.2675837668362560.866208116581872
1070.1485995680305540.2971991360611080.851400431969446
1080.1236578032607590.2473156065215170.876342196739241
1090.1341106645323460.2682213290646930.865889335467654
1100.1199958578365270.2399917156730540.880004142163473
1110.1161617240731330.2323234481462670.883838275926867
1120.1644947766122780.3289895532245560.835505223387722
1130.1530063337267710.3060126674535410.84699366627323
1140.4904043988975130.9808087977950250.509595601102487
1150.4393814822374350.878762964474870.560618517762565
1160.5133236136508730.9733527726982530.486676386349127
1170.838863886463530.322272227072940.16113611353647
1180.81280530205160.3743893958968010.187194697948401
1190.7868191617171920.4263616765656160.213180838282808
1200.7445503752056650.510899249588670.255449624794335
1210.7115090734425430.5769818531149140.288490926557457
1220.6810536780829170.6378926438341670.318946321917083
1230.684366803406940.6312663931861210.315633196593061
1240.654955413133430.6900891737331390.345044586866569
1250.6443108363960740.7113783272078530.355689163603926
1260.6513800117866890.6972399764266230.348619988213311
1270.6382897986384370.7234204027231250.361710201361563
1280.7166841755360150.566631648927970.283315824463985
1290.6643178215107820.6713643569784350.335682178489218
1300.642266389266560.7154672214668790.357733610733440
1310.6210888699345630.7578222601308750.378911130065437
1320.5531763441188750.893647311762250.446823655881125
1330.5971495507474230.8057008985051550.402850449252577
1340.54457558075650.9108488384870.4554244192435
1350.4743167211883730.9486334423767470.525683278811627
1360.4153465160102570.8306930320205140.584653483989743
1370.3422745818213340.6845491636426670.657725418178666
1380.2773471936065450.5546943872130890.722652806393455
1390.2284883274687490.4569766549374990.77151167253125
1400.1848619086838870.3697238173677740.815138091316113
1410.1769745194046510.3539490388093020.82302548059535
1420.1825972274419290.3651944548838570.817402772558071
1430.1315443708162650.2630887416325300.868455629183735
1440.1099431672229180.2198863344458360.890056832777082
1450.07419428992001130.1483885798400230.925805710079989
1460.1235529618095270.2471059236190540.876447038190473
1470.07764914811552550.1552982962310510.922350851884474
1480.09882863518400170.1976572703680030.901171364815998


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


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


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/28v6w1290528147.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/28v6w1290528147.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/38v6w1290528147.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/38v6w1290528147.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/48v6w1290528147.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/48v6w1290528147.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/58v6w1290528147.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/58v6w1290528147.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/6145h1290528147.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528123w1mznyykyjyy1ou/6145h1290528147.ps (open in new window)


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


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


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


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