Home » date » 2010 » Dec » 03 »

Workshop 7 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: Fri, 03 Dec 2010 12:39: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/Dec/03/t1291379982dtk7hu55vzq0oqq.htm/, Retrieved Fri, 03 Dec 2010 13:39:54 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq.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:
Determistische Trend
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 5 2 2 1 1 1 1 4 1 3 1 4 1 1 7 3 3 1 5 1 1 7 2 2 1 2 2 2 5 2 1 1 1 2 2 5 1 1 1 1 2 1 4 1 3 1 2 2 2 4 3 3 2 1 1 1 6 1 1 1 1 1 2 5 1 1 1 1 2 1 1 1 1 1 3 2 2 5 1 1 1 1 1 1 4 2 1 2 1 1 2 6 3 1 1 1 1 2 7 2 2 1 2 1 2 7 3 3 1 4 2 1 2 2 1 1 1 2 1 6 1 1 1 1 1 1 3 1 1 1 2 1 2 6 1 1 1 3 2 2 6 1 3 1 1 1 1 5 1 1 1 1 2 2 6 3 2 1 1 1 2 4 1 3 2 1 2 2 3 3 1 2 2 1 2 4 1 1 1 1 1 2 5 1 1 2 1 1 2 6 1 1 2 1 2 1 6 3 3 2 1 2 1 4 1 1 1 1 2 2 6 1 3 1 1 1 1 6 1 1 1 1 2 2 5 1 3 1 1 1 2 6 3 1 1 1 1 2 4 1 1 1 1 2 1 6 1 1 1 1 1 2 7 1 3 1 1 2 1 5 2 3 1 1 1 1 6 1 3 1 1 2 2 6 1 1 2 1 1 1 5 2 2 2 4 2 2 7 2 3 1 1 1 2 6 2 2 1 1 1 1 3 1 1 1 4 2 1 4 1 1 1 2 1 2 5 2 3 1 2 1 2 4 2 3 2 1 1 1 3 1 1 1 1 2 2 5 3 1 1 2 1 2 5 1 1 1 1 2 1 4 1 2 1 1 2 1 5 1 1 1 1 1 2 1 2 2 1 1 1 2 2 1 1 2 1 1 2 3 3 3 1 1 2 1 4 2 2 1 2 1 1 3 3 3 1 1 2 1 7 1 1 1 1 2 1 2 1 1 1 1 1 1 4 3 1 1 2 1 1 2 1 1 1 1 2 2 5 1 1 1 2 1 2 6 1 2 1 4 2 2 6 1 2 1 1 2 2 6 1 1 1 1 1 1 6 2 2 1 1 1 2 6 3 3 1 2 1 2 6 1 1 1 3 1 1 6 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'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Member[t] = + 1.30465081631826 + 0.0640015744751596Provison[t] + 0.0595463954201537Mother[t] + 0.00440396071597927Father[t] + 0.0496845934749124Illness[t] -0.0440791315888167Tobacco[t] -0.130315178168314Gender[t] -3.27464775207176e-05t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.304650816318260.28144.63638e-064e-06
Provison0.06400157447515960.0286252.23580.0268490.013425
Mother0.05954639542015370.0542351.09790.2740060.137003
Father0.004403960715979270.0498190.08840.9296790.464839
Illness0.04968459347491240.1180930.42070.6745610.337281
Tobacco-0.04407913158881670.042284-1.04250.2988870.149444
Gender-0.1303151781683140.08317-1.56680.1192710.059636
t-3.27464775207176e-050.00088-0.03720.970370.485185


Multiple Linear Regression - Regression Statistics
Multiple R0.284283161782614
R-squared0.0808169160731198
Adjusted R-squared0.0376338181705147
F-TEST (value)1.87149417245131
F-TEST (DF numerator)7
F-TEST (DF denominator)149
p-value0.0780617191575274
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.489177752690995
Sum Squared Residuals35.654936185444


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
121.627816938206540.372183061793461
211.37640278778327-0.37640278778327
311.64338842398272-0.64338842398272
411.58132753796720-0.581327537967204
521.49296681341220.507033186587799
621.433387671514530.566612328485474
711.33408214040499-0.334082140404989
821.677221087999820.322778912000182
911.62760618472544-0.627606184725438
1021.433256685604440.566743314395556
1111.08905937804865-0.0890593780486509
1221.563506370817720.436493629182283
1311.6087030387601-0.608703038760102
1421.746535243178140.253464756821858
1521.711282504882790.28871749511721
1621.556726673195450.443273326804545
1711.30056913225647-0.300569132256473
1811.62731146642775-0.627311466427752
1911.39119486493594-0.391194864935936
2021.408772532126760.591227467873237
2121.636021148427150.363978851572851
2211.43286372787420-0.432863727874195
2321.750644485596430.249355514403565
2421.427289175350860.572710824649135
2521.559775770386030.440224229613969
2621.499046345657270.500953654342733
2721.612699767129820.387300232870182
2821.546353416959140.453646583040857
2911.67422138275389-0.674221382753888
3011.36860018157887-0.36860018157887
3121.635693683651940.364306316348059
3211.49653783757415-0.496537837574148
3321.571626616221740.42837338377826
3421.745880313627730.254119686372272
3521.368436449191270.631563550808734
3611.62672202983238-0.626722029832379
3721.569183601093660.430816398906337
3811.63100927925429-0.63100927925429
3911.50511653366346-0.505116533663461
4021.676275637397210.323724362602791
4111.41363909964590-0.413639099645897
4221.758881442294530.241118557705473
4321.690443160625870.309556839374133
4411.17190276165197-0.17190276165197
4511.45434503099556-0.454345030995557
4621.586668175845310.413331824154692
4721.616397579956360.383602420043644
4811.30400917050834-0.304009170508337
4921.637308410400940.362691589599059
5021.431946826503620.568053173496385
5111.37231646626691-0.372316466266914
5211.56219651171689-0.562196511716888
5321.370107823474860.629892176525139
5421.419810888811280.58018911118872
5521.431680657437960.568319342562042
5611.51793517587896-0.517935175878962
5711.43161516448292-0.431615164482916
5811.55968800363377-0.559688003633769
5911.36996256294876-0.369962562948764
6011.57294662467305-0.572946624673053
6111.23958189182541-0.239581891825408
6221.517789915352860.482210084647136
6321.367689262720540.632310737279465
6421.499893911009460.500106088990536
6521.625772381984280.374227618015722
6611.68968999164289-0.68968999164289
6721.709528469712690.290471530287314
6821.537515879374080.462484120625917
6911.50413413933784-0.50413413933784
7011.56155585678249-0.561555856782488
7111.43120793213665-0.431207932136653
7221.689442294438740.310557705561261
7311.69386472701623-0.693864727016225
7411.62547766368659-0.625477663686592
7511.68262806507220-0.682628065072203
7611.69376648758366-0.693766487583663
7721.68387193916090.316128060839099
7811.58567150690367-0.585671506903672
7921.492855603293660.507144396706337
8021.629633927198420.37036607280158
8121.693602755196060.306397244803941
8221.435251681599900.564748318400095
8311.68908208318601-0.689082083186011
8421.748646950467670.251353049532329
8521.689067808570000.310932191430003
8611.31157272579451-0.311572725794508
8721.649327144742120.350672855257882
8821.561017638526140.438982361473858
8911.49467128835547-0.494671288355467
9011.36663539292763-0.366635392927627
9121.618153765295740.381846234704261
9221.624837008752190.375162991247808
9321.644726705161010.355273294838986
9411.55845791210400-0.558457912103996
9521.516827778155500.483172221844497
9611.73844340913121-0.738443409131208
9721.693078811555730.306921188444273
9811.55832692619391-0.558326926193913
9911.70848058243202-0.708480582432023
10021.624626255271050.375373744728947
10121.280428947715260.71957105228474
10211.36624243519738-0.366242435197378
10321.494110400992120.505889599007877
10421.692849586213080.307150413786918
10511.60020339750292-0.600203397502922
10611.74352256724624-0.743522567246236
10711.62880099064439-0.628800990644388
10811.28772740085685-0.287727400856847
10921.752283467584660.247716532415341
11011.17837970066771-0.178379700667712
11111.49626289506801-0.496262895068006
11211.19818543225999-0.198185432259987
11311.6440717756106-0.6440717756106
11421.555880765955450.444119234044554
11511.56025198019390-0.560251980193905
11621.752054242242010.247945757757986
11711.63287748658516-0.63287748658516
11821.496033669725360.503966330274639
11921.623901635520110.376098364479894
12011.49173393095419-0.491733930954189
12111.72871438908318-0.728714389083178
12221.687907407240760.312092592759243
12321.365554759169440.634445240830557
12411.55978754699637-0.559787546996369
12521.469284508123220.530715491876779
12621.676554034002670.323445965997333
12721.429425347734520.57057465226548
12821.616890927288450.383109072711555
12911.47475898409923-0.474758984099234
13021.619307178451250.380692821548753
13121.627963856844860.372036143155137
13221.643500810876730.356499189123267
13321.493128006666500.506871993333498
13411.63898013886669-0.638980138866686
13511.75138084083009-0.751380840830094
13621.663241049513970.336758950486033
13721.576921038117920.423078961882078
13821.707203469808710.292796530191285
13921.563751528888560.436248471111435
14011.48854603894690-0.488546038946904
14121.384887765460410.615112234539587
14221.691605220067300.308394779932705
14321.747916409464070.252083590535935
14411.70160036805336-0.701600368053356
14511.36923829737997-0.369238297379966
14621.556755095272920.443244904727081
14721.512643217206580.487356782793419
14821.687055998825220.312944001174781
14911.57894254628372-0.578942546283721
15021.691394466586160.308605533413844
15121.549041590158070.450958409841931
15221.627327399155960.372672600844045
15311.49247307711609-0.492473077116087
15411.3645396183663-0.364539618366301
15521.805919564322880.194080435677119
15611.49919326429555-0.499193264295553
15721.855538664842750.144461335157248


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
110.679825307655190.6403493846896210.320174692344810
120.6918552617414940.6162894765170110.308144738258506
130.6822125406123850.6355749187752290.317787459387615
140.5726131113675610.8547737772648770.427386888632439
150.5701783141328120.8596433717343760.429821685867188
160.545171965857650.90965606828470.45482803414235
170.7144411840292440.5711176319415120.285558815970756
180.7308736679653020.5382526640693960.269126332034698
190.6570564337300410.6858871325399180.342943566269959
200.7211610542850580.5576778914298840.278838945714942
210.6645944631185190.6708110737629620.335405536881481
220.7073617944362150.5852764111275690.292638205563785
230.6389536035783010.7220927928433980.361046396421699
240.6051385029980640.7897229940038730.394861497001936
250.5929494557097060.8141010885805880.407050544290294
260.5813391290252350.837321741949530.418660870974765
270.529401929734650.94119614053070.47059807026535
280.4752634898675340.9505269797350690.524736510132465
290.6995264683367590.6009470633264820.300473531663241
300.6999868421576240.6000263156847520.300013157842376
310.6596019966409570.6807960067180850.340398003359043
320.6806330438729820.6387339122540370.319366956127018
330.648426772143710.703146455712580.35157322785629
340.5975653846845990.8048692306308030.402434615315401
350.6044997864537630.7910004270924740.395500213546237
360.6612315900779650.677536819844070.338768409922035
370.6279103568682580.7441792862634830.372089643131741
380.6794201604795280.6411596790409440.320579839520472
390.6864928097359020.6270143805281960.313507190264098
400.6518604786521780.6962790426956440.348139521347822
410.6187105749757450.762578850048510.381289425024255
420.5799542710674650.840091457865070.420045728932535
430.5474339590752720.9051320818494570.452566040924728
440.4965146811027560.9930293622055130.503485318897244
450.474554095309170.949108190618340.52544590469083
460.4686532877535090.9373065755070170.531346712246491
470.4437469527551210.8874939055102420.556253047244879
480.4103498690547260.8206997381094530.589650130945274
490.390463044509240.780926089018480.60953695549076
500.4038599913738330.8077199827476660.596140008626167
510.3860489693831530.7720979387663060.613951030616847
520.3999031247997020.7998062495994040.600096875200298
530.4244378344760180.8488756689520350.575562165523982
540.4513601513853840.9027203027707670.548639848614616
550.4530048437981060.9060096875962110.546995156201894
560.4593105099332420.9186210198664830.540689490066758
570.4667435356255790.9334870712511590.53325646437442
580.4665162394164570.9330324788329140.533483760583543
590.4400064204878650.880012840975730.559993579512135
600.4375578278704500.8751156557408990.562442172129550
610.3951743901064450.790348780212890.604825609893555
620.420818548666550.84163709733310.57918145133345
630.4880749648561360.9761499297122710.511925035143864
640.4963797366252340.9927594732504680.503620263374766
650.4812270044977570.9624540089955150.518772995502243
660.5220625667702660.9558748664594690.477937433229734
670.4960891578092470.9921783156184950.503910842190753
680.5012446358074740.9975107283850520.498755364192526
690.499052183622820.998104367245640.50094781637718
700.5022665027609860.9954669944780280.497733497239014
710.4782967875927640.9565935751855280.521703212407236
720.4577904600508030.9155809201016060.542209539949197
730.488727374547820.977454749095640.51127262545218
740.501584764400010.996830471199980.49841523559999
750.5214654530549060.9570690938901880.478534546945094
760.5489261519432950.9021476961134110.451073848056705
770.5458853437279910.9082293125440180.454114656272009
780.5491026839687620.9017946320624760.450897316031238
790.5703648998698580.8592702002602840.429635100130142
800.563549379739780.872901240520440.43645062026022
810.5455171842122830.9089656315754330.454482815787717
820.5807339565507150.838532086898570.419266043449285
830.6032629752564900.7934740494870190.396737024743510
840.5774621591818180.8450756816363630.422537840818182
850.5596566689133520.8806866621732950.440343331086648
860.5215985790386240.9568028419227520.478401420961376
870.510647082078090.978705835843820.48935291792191
880.5169672465275830.9660655069448350.483032753472417
890.5052348377691390.9895303244617220.494765162230861
900.4752785966977040.9505571933954080.524721403302296
910.4638094036272540.9276188072545080.536190596372746
920.4605212316852680.9210424633705370.539478768314732
930.4517567715217070.9035135430434140.548243228478293
940.4517703614670370.9035407229340750.548229638532963
950.4619886320826280.9239772641652560.538011367917372
960.4837889454209640.9675778908419270.516211054579036
970.4704247323557870.9408494647115740.529575267644213
980.4791521618564160.9583043237128310.520847838143584
990.5082143896453770.9835712207092470.491785610354623
1000.496750683288390.993501366576780.50324931671161
1010.6421580568310070.7156838863379860.357841943168993
1020.6181176596819280.7637646806361430.381882340318072
1030.6236396314136690.7527207371726620.376360368586331
1040.6058270935780870.7883458128438260.394172906421913
1050.59786860020260.8042627995947990.402131399797400
1060.6444962375142390.7110075249715220.355503762485761
1070.6702583295538320.6594833408923360.329741670446168
1080.6262480828436010.7475038343127970.373751917156399
1090.5855765913457660.8288468173084680.414423408654234
1100.5338437341154180.9323125317691640.466156265884582
1110.516440163063750.96711967387250.48355983693625
1120.4634471669624410.9268943339248820.536552833037559
1130.5070230082263570.9859539835472870.492976991773643
1140.5147696111738350.970460777652330.485230388826165
1150.5110728329378480.9778543341243050.488927167062153
1160.4636326320127310.9272652640254620.536367367987269
1170.5687530579571140.8624938840857730.431246942042886
1180.5807669524016190.8384660951967630.419233047598381
1190.5717982475352980.8564035049294040.428201752464702
1200.5637121081099740.8725757837800530.436287891890026
1210.583945520873130.832108958253740.41605447912687
1220.5362669554158610.9274660891682780.463733044584139
1230.5518836612509120.8962326774981760.448116338749088
1240.5736142145432650.852771570913470.426385785456735
1250.5517123920552190.8965752158895610.448287607944781
1260.5025900745441070.9948198509117870.497409925455893
1270.4801793144436060.9603586288872120.519820685556394
1280.4250428871702080.8500857743404150.574957112829792
1290.4395325948772360.8790651897544720.560467405122764
1300.3971600779086240.7943201558172480.602839922091376
1310.3598556093831330.7197112187662670.640144390616867
1320.3071882382659350.614376476531870.692811761734065
1330.3229923067083150.645984613416630.677007693291685
1340.382363718899310.764727437798620.61763628110069
1350.5861829583357720.8276340833284550.413817041664228
1360.5094164228024840.9811671543950310.490583577197516
1370.4454048221776740.8908096443553480.554595177822326
1380.3680574386319440.7361148772638880.631942561368056
1390.3123953518248330.6247907036496660.687604648175167
1400.519883702575570.960232594848860.48011629742443
1410.5329911823050240.9340176353899520.467008817694976
1420.4248334204721750.849666840944350.575166579527825
1430.3263726465908540.6527452931817070.673627353409146
1440.7028634065583440.5942731868833110.297136593441656
1450.6596910018090130.6806179963819750.340308998190988
1460.5008988622235950.998202275552810.499101137776405


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/Dec/03/t1291379982dtk7hu55vzq0oqq/10zedd1291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/10zedd1291379952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/1bdg21291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/1bdg21291379952.ps (open in new window)


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


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/33nxn1291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/33nxn1291379952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/43nxn1291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/43nxn1291379952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/53nxn1291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/53nxn1291379952.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/6weep1291379952.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/03/t1291379982dtk7hu55vzq0oqq/6weep1291379952.ps (open in new window)


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


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


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


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