Home » date » 2010 » Dec » 11 »

Workshop 10 - multiple regression

*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: Sat, 11 Dec 2010 13:56:28 +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/11/t1292075738j619b1wbs22l2ye.htm/, Retrieved Sat, 11 Dec 2010 14:55:48 +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/11/t1292075738j619b1wbs22l2ye.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0 24 14 11 12 24 26 0 25 11 7 8 25 23 0 17 6 17 8 30 25 1 18 12 10 8 19 23 1 18 8 12 9 22 19 1 16 10 12 7 22 29 1 20 10 11 4 25 25 1 16 11 11 11 23 21 1 18 16 12 7 17 22 1 17 11 13 7 21 25 0 23 13 14 12 19 24 0 30 12 16 10 19 18 1 23 8 11 10 15 22 1 18 12 10 8 16 15 1 15 11 11 8 23 22 1 12 4 15 4 27 28 0 21 9 9 9 22 20 1 15 8 11 8 14 12 1 20 8 17 7 22 24 0 31 14 17 11 23 20 0 27 15 11 9 23 21 1 34 16 18 11 21 20 1 21 9 14 13 19 21 1 31 14 10 8 18 23 1 19 11 11 8 20 28 0 16 8 15 9 23 24 1 20 9 15 6 25 24 1 21 9 13 9 19 24 1 22 9 16 9 24 23 1 17 9 13 6 22 23 1 24 10 9 6 25 29 0 25 16 18 16 26 24 0 26 11 18 5 29 18 1 25 8 12 7 32 25 1 17 9 17 9 25 21 1 32 16 9 6 29 26 1 33 11 9 6 28 22 1 13 16 12 5 17 22 1 32 12 18 12 28 22 1 25 12 12 7 29 23 1 29 14 18 10 26 30 1 22 9 14 9 25 23 1 18 10 15 8 14 17 1 17 9 16 5 25 23 0 20 10 10 8 26 23 1 15 12 11 8 20 25 1 20 14 14 10 18 24 1 33 14 9 6 32 24 0 29 10 12 8 25 23 1 23 14 17 7 25 21 0 26 16 5 4 23 24 1 18 9 12 8 21 2 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 time9 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Gender[t] = + 3.88078900333712 + 0.0273651683211434Concernovermistakes[t] + 0.421293104886232Doubtsaboutactions[t] + 0.00115024260981116Parentalexpectations[t] + 0.481242912513191Parentalcritism[t] + 0.0710155481385383Personalstandars[t] -0.598935405599315organization[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)3.880789003337122.7238011.42480.1562740.078137
Concernovermistakes0.02736516832114340.0886530.30870.7579910.378995
Doubtsaboutactions0.4212931048862320.1208793.48520.0006430.000321
Parentalexpectations0.001150242609811160.1272760.0090.9928010.496401
Parentalcritism0.4812429125131910.1015194.74045e-062e-06
Personalstandars0.07101554813853830.0906770.78320.4347470.217374
organization-0.5989354055993150.083351-7.185700


Multiple Linear Regression - Regression Statistics
Multiple R0.921794407753777
R-squared0.849704930166137
Adjusted R-squared0.843772230041116
F-TEST (value)143.223981030584
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation4.28063629106381
Sum Squared Residuals2785.22475256862


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
102.35527674006072-2.35527674006072
201.05701173816767-1.05701173816767
30-2.099665777240432.09966577724043
410.864106103804110.135893896195891
512.27126534880483-1.27126534880483
61-3.89271865908454.8927186590845
71-2.619348699136443.61934869913644
813.31489464617775-2.31489464617775
912.52724040537770-1.52724040537770
101-1.118184069008592.11818406900859
1102.75286226518875-2.75286226518875
1205.15655243233965-5.15655243233965
1310.5942688065462530.405731193453747
1415.44254270418301-4.44254270418301
1511.24486533471772-0.244865334717718
161-7.016202825104598.0162028251046
1702.17226782522578-2.17226782522578
1815.33120014280533-4.33120014280533
191-1.625415954526752.62541595452675
2005.59508834691179-5.59508834691179
2104.33859809222888-4.33859809222888
2216.37888920798041-5.37888920798041
2313.29100863831267-2.29100863831267
2411.99142395361289-0.991423953612893
251-2.452333070009213.45233307000921
260-0.7036757398660270.703675739866027
271-1.474619602957722.47461960295772
281-0.4319194711478521.43191947114785
2910.5529095712947320.447090428705268
301-1.173126831957072.17312683195707
311-3.945444308442364.94544430844236
3206.4981533739515-6.4981533739515
3302.93204005820789-2.93204005820789
341-1.383121250184022.38312125018402
3511.68612033163599-0.686120331635993
3610.8821040767962810.117895923203719
3711.12772979494499-0.127729794944994
3811.42792873874559-0.427928738745594
3914.41946739007753-3.41946739007753
4011.28687533614392-0.286875336143922
411-0.7160420712114231.71604207121142
4210.6216246342136480.378375365786352
4313.26580579998389-2.26580579998389
441-1.437872372225222.43787237222522
4500.573359067643694-0.573359067643694
461-0.3436944216096121.34369442160961
4712.05855849194662-1.05855849194662
4811.47780049095921-0.47780049095921
4900.750930519615074-0.750930519615074
5012.99429104096763-1.99429104096763
5100.522603793771192-0.522603793771192
521-0.8543770349572111.85437703495721
530-2.845110763964492.84511076396449
541114.3332966653358-3.33329666533579
552829.4924126519392-1.49241265193924
562622.91053618735953.08946381264054
572223.0499600055460-1.04996000554602
581723.1168872333368-6.11688723333682
591219.0028419037980-7.00284190379797
601417.0519929723558-3.05199297235575
611721.9192281585312-4.91922815853123
622122.2934201557706-1.29342015577064
631923.0546560324631-4.05465603246312
641820.8714362697317-2.87143626973166
651019.5713889982832-9.57138899828318
662924.42925633836064.57074366163939
673121.03485367514849.96514632485156
681923.4990375657931-4.49903756579307
69918.7764373316480-9.77643733164795
702022.0327580601907-2.03275806019067
712820.35047961612147.6495203838786
721919.6662239304356-0.66622393043558
733025.29678716446744.70321283553265
742924.58913967980424.41086032019585
752624.2598350634731.740164936527
762319.73640924163563.26359075836436
771321.0301676396542-8.03016763965417
782121.8104085001022-0.810408500102204
791920.9604064911534-1.96040649115335
802822.65999714032795.34000285967211
812323.1017713564233-0.101771356423261
821818.7159398722173-0.715939872217272
832119.80220531878951.19779468121049
842023.9884130167395-3.98841301673948
852318.10209714386394.8979028561361
862121.6608432313075-0.660843231307518
872122.4121695284147-1.41216952841474
881520.5938437229094-5.59384372290941
892824.92292938921263.07707061078740
901918.29153026148630.708469738513742
912619.45777403156876.54222596843127
921018.2428496327671-8.24284963276712
931617.1947467262062-1.19474672620616
942221.88945834796260.110541652037439
951920.1973876549923-1.19738765499231
963130.26157625250130.738423747498724
973121.50964180901219.49035819098787
982923.43104266446825.56895733553179
991918.74540800567830.254591994321693
1002219.05318542521842.94681457478158
1012323.0452531846529-0.0452531846528508
1021519.7697057445387-4.76970574453872
1032022.3053185520451-2.30531855204505
1041821.5001171655234-3.50011716552340
1052319.99500168036193.00499831963808
1062517.55130405583387.44869594416625
1072117.59139443503053.40860556496945
1082419.22530146207594.77469853792407
1092522.07568578243472.92431421756527
1101717.4373548671346-0.437354867134640
1111316.6510400910273-3.65104009102732
1122821.22094851996616.77905148003393
1132120.27520642007830.724793579921674
1142529.7190399945621-4.71903999456207
115922.4184441855314-13.4184441855314
1161620.7938108389790-4.79381083897896
1171923.6425198183784-4.64251981837842
1181718.3555635138014-1.35556351380140
1192522.28643194163072.71356805836928
1202014.13717624727205.86282375272803
1212920.61118093830418.38881906169592
1221417.9638176891147-3.96381768911471
1232222.956090318811-0.956090318810997
1241518.0346173886098-3.03461738860982
1251918.12655754273330.873442457266693
1262023.0924493487775-3.09244934877753
1271520.0100241942237-5.01002419422365
1282021.622530695816-1.62253069581602
1291821.4164663472238-3.4164663472238
1303322.596096477667310.4039035223327
1312221.90044324830960.0995567516903947
1321617.7840724232617-1.78407242326173
1331721.0831067188311-4.0831067188311
1341618.1916792967454-2.19167929674543
1352118.55240409345932.44759590654073
1362626.1496230941262-0.149623094126236
1371819.2639458007277-1.26394580072772
1381820.1267014531789-2.12670145317886
1391720.3771187045320-3.37711870453198
1402220.36064849584331.63935150415672
1413020.12869614904059.87130385095954
1423025.45952113891354.54047886108649
1432424.615261967862-0.615261967861999
1442118.45760838790962.54239161209042
1452123.4431652845378-2.44316528453778
1462923.05875369346465.94124630653539
1473124.08084330664436.91915669335565
1482020.2957634957924-0.295763495792428
1491614.92857621128341.07142378871659
1502220.45555005184691.54444994815310
1512022.1926438976135-2.19264389761348
1522823.72379096557584.27620903442419
1533829.05250811464948.9474918853506
1542219.42894695210732.57105304789269
1552025.5927619696092-5.59276196960924
1561719.6467937804679-2.64679378046792
1572821.56259510450246.43740489549763
1582222.7171213252416-0.717121325241629
1593121.94304504656589.05695495343418


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.0004072909553349720.0008145819106699450.999592709044665
112.21216285477553e-054.42432570955105e-050.999977878371452
122.39273947302360e-064.78547894604719e-060.999997607260527
131.28786390163766e-072.57572780327531e-070.99999987121361
142.12200797744121e-084.24401595488241e-080.99999997877992
151.16750403185834e-092.33500806371668e-090.999999998832496
169.03007723211601e-111.80601544642320e-100.9999999999097
176.34810879683548e-111.26962175936710e-100.999999999936519
189.90855974658904e-121.98171194931781e-110.999999999990091
191.28329333087353e-122.56658666174706e-120.999999999998717
201.64055353635786e-133.28110707271571e-130.999999999999836
211.26466847709161e-142.52933695418322e-140.999999999999987
227.55567739798786e-141.51113547959757e-130.999999999999925
231.48946437617379e-142.97892875234758e-140.999999999999985
242.9687809724021e-155.9375619448042e-150.999999999999997
252.79786605926472e-165.59573211852944e-161
261.33664934149003e-162.67329868298007e-161
271.73201706905090e-173.46403413810179e-171
281.70133811953406e-183.40267623906812e-181
293.15072064864349e-196.30144129728698e-191
303.05351684333925e-206.1070336866785e-201
314.93302545509385e-219.8660509101877e-211
326.35950858808717e-221.27190171761743e-211
337.84623206141659e-231.56924641228332e-221
348.48732009581346e-231.69746401916269e-221
351.40143590689700e-232.80287181379401e-231
363.70687078747777e-247.41374157495554e-241
376.720108001447e-251.3440216002894e-241
386.92851755772221e-261.38570351154444e-251
396.01649224281799e-261.20329844856360e-251
409.28337847888918e-271.85667569577784e-261
411.25408906199576e-272.50817812399151e-271
421.64846677782877e-283.29693355565754e-281
431.75810544072036e-293.51621088144072e-291
442.07765787871273e-304.15531575742545e-301
456.0193853697616e-311.20387707395232e-301
467.93640272171126e-321.58728054434225e-311
478.2464631947364e-331.64929263894728e-321
481.54419615383412e-333.08839230766824e-331
497.92515739829067e-341.58503147965813e-331
501.06847272408618e-342.13694544817236e-341
511.18180445461706e-342.36360890923413e-341
521.24300706698948e-352.48601413397896e-351
531.9680276145169e-353.9360552290338e-351
548.23459297625284e-201.64691859525057e-191
553.97127543886718e-107.94255087773436e-100.999999999602872
565.61442384398846e-091.12288476879769e-080.999999994385576
572.50928254760876e-095.01856509521752e-090.999999997490717
586.60710071924501e-091.32142014384900e-080.9999999933929
598.91369180537533e-081.78273836107507e-070.999999910863082
601.28204226659671e-072.56408453319341e-070.999999871795773
618.33016391299592e-081.66603278259918e-070.99999991669836
625.67988494893083e-081.13597698978617e-070.99999994320115
633.40644055530201e-086.81288111060403e-080.999999965935594
642.66609803815739e-085.33219607631478e-080.99999997333902
655.14659591533309e-071.02931918306662e-060.999999485340408
663.13711131503367e-066.27422263006735e-060.999996862888685
670.001503861857944960.003007723715889920.998496138142055
680.001210163358067920.002420326716135830.998789836641932
690.006701337349550460.01340267469910090.99329866265045
700.004865290374897660.009730580749795330.995134709625102
710.03796777616553890.07593555233107780.962032223834461
720.02997288550999680.05994577101999350.970027114490003
730.04757965127032070.09515930254064140.95242034872968
740.08132847721015440.1626569544203090.918671522789846
750.07099782499046910.1419956499809380.929002175009531
760.08186471994985730.1637294398997150.918135280050143
770.1806623806524470.3613247613048940.819337619347553
780.1548993369594680.3097986739189360.845100663040532
790.1324755412818480.2649510825636970.867524458718152
800.1812864807381980.3625729614763950.818713519261802
810.1579248003367250.3158496006734500.842075199663275
820.1389515488323350.2779030976646710.861048451167665
830.1254660593427160.2509321186854320.874533940657284
840.1153339939718840.2306679879437680.884666006028116
850.1331598552184020.2663197104368050.866840144781598
860.1108026077920490.2216052155840990.88919739220795
870.09125653024425240.1825130604885050.908743469755748
880.1302531290383770.2605062580767530.869746870961623
890.1345576392557360.2691152785114710.865442360744264
900.1156649023041520.2313298046083030.884335097695848
910.1652673779633700.3305347559267390.83473262203663
920.2318482733524770.4636965467049540.768151726647523
930.2013505906126400.4027011812252790.79864940938736
940.1712894861326150.3425789722652290.828710513867385
950.1450982078757470.2901964157514950.854901792124253
960.1202102646170280.2404205292340560.879789735382972
970.2364954898808320.4729909797616630.763504510119168
980.2567552125941020.5135104251882030.743244787405898
990.2230794277499740.4461588554999480.776920572250026
1000.2166767878388840.4333535756777680.783323212161116
1010.1834918446901130.3669836893802260.816508155309887
1020.184766864589530.369533729179060.81523313541047
1030.1570536704185200.3141073408370390.84294632958148
1040.1372647533794590.2745295067589180.862735246620541
1050.1236394806581500.2472789613163010.87636051934185
1060.1719622584386820.3439245168773640.828037741561318
1070.1847411477890850.3694822955781710.815258852210915
1080.2288751375406310.4577502750812620.771124862459369
1090.2049658349766170.4099316699532350.795034165023383
1100.1822138196486260.3644276392972520.817786180351374
1110.1594832135715740.3189664271431490.840516786428426
1120.2883843096980820.5767686193961640.711615690301918
1130.2954419916619810.5908839833239620.704558008338019
1140.3133350349296170.6266700698592340.686664965070383
1150.57598724329790.84802551340420.4240127567021
1160.5545043474123580.8909913051752850.445495652587642
1170.5469333324819720.9061333350360560.453066667518028
1180.505789659180610.988420681638780.49421034081939
1190.4658382788479490.9316765576958990.534161721152051
1200.5387067045940690.9225865908118620.461293295405931
1210.6437101315068260.7125797369863490.356289868493174
1220.6230908597383400.7538182805233210.376909140261660
1230.6142029653007690.7715940693984620.385797034699231
1240.5822820770858050.835435845828390.417717922914195
1250.5958522803550230.8082954392899530.404147719644976
1260.6155655540896310.7688688918207380.384434445910369
1270.6060062208570020.7879875582859950.393993779142998
1280.5603236212644160.8793527574711670.439676378735584
1290.5165643344313260.9668713311373490.483435665568674
1300.6757898345626010.6484203308747980.324210165437399
1310.6142174825857740.7715650348284530.385782517414226
1320.5518994147727510.8962011704544980.448100585227249
1330.5318723719580750.936255256083850.468127628041925
1340.5040321341071410.9919357317857180.495967865892859
1350.4415947012485980.8831894024971960.558405298751402
1360.3954733457016470.7909466914032940.604526654298353
1370.3710261620747860.7420523241495730.628973837925214
1380.3890670951867210.7781341903734410.610932904813279
1390.3203871455822740.6407742911645490.679612854417726
1400.25272943014770.50545886029540.7472705698523
1410.3126642520032630.6253285040065260.687335747996737
1420.2728806009707190.5457612019414370.727119399029281
1430.2056927998608230.4113855997216450.794307200139177
1440.1494126447316990.2988252894633980.850587355268301
1450.2022785508691150.404557101738230.797721449130885
1460.1417598131995750.2835196263991510.858240186800425
1470.1808173688146830.3616347376293660.819182631185317
1480.1076887890967900.2153775781935810.89231121090321
1490.05777675298437760.1155535059687550.942223247015622


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level600.428571428571429NOK
5% type I error level610.435714285714286NOK
10% type I error level640.457142857142857NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/10y1xh1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/10y1xh1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/190i51292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/190i51292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/2krhq1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/2krhq1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/3krhq1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/3krhq1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/4krhq1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/4krhq1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/5u0yb1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/5u0yb1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/6u0yb1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/6u0yb1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/7nrxe1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/7nrxe1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/8nrxe1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/8nrxe1292075777.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/9y1xh1292075777.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/11/t1292075738j619b1wbs22l2ye/9y1xh1292075777.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