Home » date » 2010 » Dec » 14 »

WS10 multiple regression

*The author of this computation has been verified*
R Software Module: Patrick.Wessa/rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 14 Dec 2010 00:46:57 +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/14/t1292287549zbmg5iyitv3s9p3.htm/, Retrieved Tue, 14 Dec 2010 01:45:59 +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/14/t1292287549zbmg5iyitv3s9p3.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 «
2 3 3 1 2 4 3 4 4 4 2 1 2 2 2 2 3 2 3 2 4 3 2 2 3 2 1 1 3 3 3 3 3 3 2 4 2 3 2 2 4 3 3 2 4 4 2 4 3 2 2 4 3 2 2 2 4 1 3 3 4 1 1 2 3 3 3 1 3 2 2 2 3 2 3 2 4 3 4 4 2 4 2 3 5 4 3 4 4 3 5 1 2 2 2 4 3 3 2 2 4 4 3 2 4 3 2 2 3 2 2 3 4 1 2 3 4 3 2 2 1 2 3 3 4 4 4 3 5 4 1 2 2 5 3 2 4 2 3 1 3 4 2 4 2 4 1 4 4 2 1 1 5 4 2 5 4 4 2 3 4 2 2 2 4 3 1 2 3 2 2 2 4 4 1 3 2 3 2 1 2 1 2 2 4 2 4 4 2 5 2 5 4 2 2 2 4 4 2 3 1 4 1 2 4 2 2 4 2 2 2 2 1 2 1 1 4 4 5 3 3 3 2 4 2 4 2 2 4 2 2 3 3 3 1 2 2 2 3 1 2 2 1 1 3 3 1 2 2 2 2 1 1 3 3 2 3 2 2 1 2 4 2 4 3 2 2 4 3 5 4 3 3 1 1 1 2 3 2 3 3 2 2 2 2 2 2 2 4 3 2 3 4 4 2 3 4 4 1 4 2 2 2 2 3 3 2 1 4 4 2 2 3 2 2 2 4 2 1 4 2 4 4 1 3 2 2 2 3 4 3 2 4 2 2 1 2 3 1 4 4 4 2 2 2 3 2 2 2 1 1 1 4 3 2 4 3 2 1 2 4 2 2 4 2 1 1 1 2 3 2 2 3 2 2 4 3 3 3 3 5 5 4 4 2 3 1 4 3 3 4 4 2 1 2 3 2 1 2 4 3 2 2 3 2 1 2 3 2 3 2 2 2 2 3 3 3 2 2 2 5 1 4 3 2 2 4 2 3 2 2 4 3 1 2 2 1 2 2 4 1 2 1 4 3 4 4 1 4 3 1 5 5 2 4 etc...
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135
R Framework
error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.


Multiple Linear Regression - Estimated Regression Equation
verw/ouders[t] = + 2.40851027893910 + 0.0835274578394345`verw/student`[t] + 0.0488147689783496`begrip/ouders`[t] + 0.05902448979797`begrip/student`[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)2.408510278939100.3124927.707400
`verw/student`0.08352745783943450.0753921.10790.2696170.134808
`begrip/ouders`0.04881476897834960.0773470.63110.5288960.264448
`begrip/student`0.059024489797970.0719750.82010.4134330.206717


Multiple Linear Regression - Regression Statistics
Multiple R0.131423474756780
R-squared0.0172721297171459
Adjusted R-squared-0.00174840970768342
F-TEST (value)0.908077806384337
F-TEST (DF numerator)3
F-TEST (DF denominator)155
p-value0.438658378154772
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.989373519883344
Sum Squared Residuals151.723294086186


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
122.86456144919041-0.86456144919041
223.12516237642376-1.12516237642376
342.899274138051501.10072586194850
422.79124371217060-0.791243712170603
532.840058481148950.159941518851047
642.874771170010041.12522882998996
732.683404453394280.316595546605716
832.982610428786360.0173895712136420
932.992820149605980.00717985039402151
1022.87477117001004-0.874771170010038
1142.923585938988391.07641406101161
1243.076347607445410.923652392554587
1332.909292691766540.0907073082334561
1432.791243712170600.208756287829396
1542.815555513107491.18444448689251
1642.658901485352821.34109851464718
1732.864561449190420.135438550809582
1832.791243712170600.208756287829396
1932.840058481148950.159941518851047
2043.090449687562680.909550312437322
2123.01732311764744-1.01732311764744
2253.125162376423761.87483762357624
2342.962190987147121.03780901285288
2422.90929269176654-0.909292691766544
2532.874771170010040.125228829989962
2643.007113396827820.992886603172177
2742.874771170010041.12522882998996
2832.850268201968570.149731798031426
2942.766740744129141.23325925587086
3042.874771170010041.12522882998996
3112.89908297094692-1.89908297094692
3243.114952655604140.885047344395858
3352.909483858871122.09051614112888
3423.09064085466726-1.09064085466726
3542.781033991350981.21896600864902
3633.07634760744541-0.0763476074454131
3723.02753283846706-1.02753283846706
3842.683404453394281.31659554660572
3953.135372097243381.86462790275662
4043.017323117647440.982676882352557
4142.791243712170601.20875628782940
4242.825956401031691.17404359896831
4332.791243712170600.208756287829396
4442.968508348669091.03149165133091
4522.81574668021207-0.815746680212068
4622.70771625433117-0.707716254331169
4743.006922229723240.993077770276757
4823.21889955508282-1.21889955508282
4942.791243712170601.20875628782940
5043.017323117647440.982676882352557
5112.90948385887112-1.90948385887112
5242.909292691766541.09070730823346
5322.79124371217060-0.791243712170604
5412.68340445339428-1.68340445339428
5543.163767424582490.836232575417508
5632.992820149605980.00717985039402151
5722.95829862784947-0.958298627849473
5842.850268201968571.14973179803143
5932.825956401031690.174043598968311
6022.78103399135098-0.781033991350983
6122.68340445339428-0.683404453394284
6232.825956401031690.174043598968311
6322.73221922237263-0.732219222372634
6412.92358593898839-1.92358593898839
6532.732219222372630.267780777627366
6623.07634760744541-1.07634760744541
6732.909292691766540.0907073082334561
6833.19848011344358-0.198480113443577
6932.599876995554850.400123004445150
7022.93379565980801-0.933795659808008
7132.791243712170600.208756287829396
7222.79124371217060-0.791243712170604
7342.933795659808011.06620434019199
7443.017323117647440.982676882352557
7543.027532838467060.972467161532936
7622.79124371217060-0.791243712170604
7732.815746680212070.184253319787932
7842.958298627849471.04170137215053
7932.791243712170600.208756287829396
8042.860477922788191.13952207721181
8122.9969036760082-0.996903676008202
8232.791243712170600.208756287829396
8333.00711339682782-0.00711339682782257
8442.732219222372631.26778077762737
8522.94400538062763-0.94400538062763
8642.958298627849471.04170137215053
8722.87477117001004-0.874771170010038
8822.59987699555485-0.59987699555485
8942.992820149605981.00717985039402
9032.742428943192250.257571056807746
9142.909292691766541.09070730823346
9222.59987699555485-0.59987699555485
9322.87477117001004-0.874771170010038
9432.909292691766540.0907073082334561
9532.982610428786360.0173895712136420
9653.257504603241551.74249539675845
9722.94400538062763-0.94400538062763
9833.09044968756268-0.0904496875626777
9922.76674074412914-0.766740744129139
10022.82576523392711-0.82576523392711
10132.850268201968570.149731798031426
10222.76674074412914-0.766740744129139
10322.87477117001004-0.874771170010038
10422.89908297094692-0.899082970946924
10532.791243712170600.208756287829396
10652.864370282085842.13562971791416
10722.88887325012730-0.888873250127303
10832.909292691766540.0907073082334561
10932.707716254331170.292283745668831
11012.90929269176654-1.90929269176654
11112.86047792278819-1.86047792278819
11232.99690367600820.00309632399179798
11343.00302987042560.9969701295744
11452.88887325012732.11112674987270
11533.05203580650853-0.052035806508528
11632.825765233927110.174234766072891
11732.683404453394280.316595546605716
11822.83597495474673-0.83597495474673
11932.947897739925270.0521022600747269
12022.86437028208584-0.864370282085839
12132.717925975150790.282074024849210
12222.80145343299022-0.801453432990224
12342.791243712170601.20875628782940
12422.74242894319225-0.742428943192254
12522.99282014960598-0.992820149605979
12642.909292691766541.09070730823346
12742.766740744129141.23325925587086
12832.850268201968570.149731798031426
12932.850268201968570.149731798031426
13033.09044968756268-0.0904496875626777
13142.947897739925271.05210226007473
13222.86047792278819-0.860477922788194
13312.86047792278819-1.86047792278819
13432.658901485352820.34109851464718
13523.00692222972324-1.00692222972324
13632.791243712170600.208756287829396
13722.95810746074489-0.958107460744894
13822.88498089082966-0.884980890829659
13932.766740744129140.233259255870861
14022.82595640103169-0.825956401031689
14143.055928165806170.944071834193828
14243.065946719521210.934053280478787
14323.09064085466726-1.09064085466726
14422.87458000290546-0.87458000290546
14532.850268201968570.149731798031426
14643.041634918584330.958365081415672
14723.04163491858433-1.04163491858433
14822.86456144919042-0.864561449190418
14933.00692222972324-0.00692222972324315
15023.00692222972324-1.00692222972324
15113.03142519776471-2.03142519776471
15222.9969036760082-0.996903676008202
15313.13945562364561-2.13945562364561
15422.93768801910565-0.937688019105653
15532.840058481148950.159941518851047
15622.89908297094692-0.899082970946924
15723.11495265560414-1.11495265560414
15822.94789773992527-0.947897739925273
15943.017323117647440.982676882352557


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
70.6299942522034630.7400114955930740.370005747796537
80.5232663415238340.9534673169523320.476733658476166
90.3828479342312290.7656958684624580.617152065768771
100.4044211515603450.808842303120690.595578848439655
110.4783889088154990.9567778176309980.521611091184501
120.4413311059733310.8826622119466610.55866889402667
130.3534223070129120.7068446140258230.646577692987088
140.2676733939179140.5353467878358280.732326606082086
150.3554554558746410.7109109117492820.64454454412536
160.3227545265528580.6455090531057160.677245473447142
170.2482619876091890.4965239752183780.751738012390811
180.1875296089638120.3750592179276240.812470391036188
190.1360781916862080.2721563833724150.863921808313792
200.1409476577092260.2818953154184530.859052342290774
210.1509118774876970.3018237549753950.849088122512303
220.300042205277160.600084410554320.69995779472284
230.2709568709827060.5419137419654120.729043129017294
240.3027215143234000.6054430286468010.6972784856766
250.2447586208423550.489517241684710.755241379157645
260.2243797822206630.4487595644413270.775620217779337
270.2228039828720650.445607965744130.777196017127935
280.1768340995572220.3536681991144440.823165900442778
290.1793748154060760.3587496308121510.820625184593924
300.1756733992559110.3513467985118230.824326600744089
310.3947370920763020.7894741841526040.605262907923698
320.3599304415677160.7198608831354320.640069558432284
330.4817694336205480.9635388672410960.518230566379452
340.5599564633403950.880087073319210.440043536659605
350.553439871093460.893120257813080.44656012890654
360.4994045340674370.9988090681348730.500595465932563
370.5104879200035360.9790241599929280.489512079996464
380.5068083336407860.9863833327184270.493191666359214
390.6481516284939440.7036967430121110.351848371506056
400.6300061825252320.7399876349495360.369993817474768
410.6258040904939920.7483918190120170.374195909506008
420.617136452701530.7657270945969390.382863547298470
430.5713983891086660.8572032217826690.428601610891334
440.5550717467851770.8898565064296450.444928253214823
450.5828585429179170.8342829141641660.417141457082083
460.5836053459313520.8327893081372960.416394654068648
470.5735613373109240.8528773253781520.426438662689076
480.6193117592276560.7613764815446890.380688240772344
490.6223422795594940.7553154408810130.377657720440506
500.6124394334029510.7751211331940990.387560566597049
510.7622582454444820.4754835091110360.237741754555518
520.7567030221490040.4865939557019920.243296977850996
530.7610723854232060.4778552291535880.238927614576794
540.8391333053424060.3217333893151880.160866694657594
550.8241995793040880.3516008413918240.175800420695912
560.7931681554731950.4136636890536100.206831844526805
570.7934536400388130.4130927199223740.206546359961187
580.7959593905624550.408081218875090.204040609437545
590.7621579233871390.4756841532257210.237842076612861
600.760503128669680.4789937426606410.239496871330320
610.7416305676925220.5167388646149550.258369432307478
620.7038697424843210.5922605150313580.296130257515679
630.6889982558729810.6220034882540370.311001744127019
640.8043739729820330.3912520540359350.195626027017968
650.7729552100248240.4540895799503520.227044789975176
660.7840734121952440.4318531756095120.215926587804756
670.7507709813264480.4984580373471040.249229018673552
680.7152078280469310.5695843439061380.284792171953069
690.680680665691970.638638668616060.31931933430803
700.6801105985676110.6397788028647770.319889401432389
710.6399256450800360.7201487098399280.360074354919964
720.628369621154160.743260757691680.37163037884584
730.6334464982989310.7331070034021370.366553501701069
740.6362945333936680.7274109332126640.363705466606332
750.6402330371501970.7195339256996070.359766962849803
760.628013138553060.743973722893880.37198686144694
770.58682504857560.8263499028488010.413174951424401
780.6041033550143470.7917932899713060.395896644985653
790.5621670386058380.8756659227883250.437832961394162
800.5772708587164020.8454582825671960.422729141283598
810.5702453665946950.859509266810610.429754633405305
820.5278519308572290.9442961382855410.472148069142771
830.4832812724232960.9665625448465910.516718727576704
840.522349141678750.95530171664250.47765085832125
850.5206850643314960.9586298713370070.479314935668504
860.5491061257466620.9017877485066760.450893874253338
870.5327353507779870.9345292984440250.467264649222013
880.5016945895200790.9966108209598430.498305410479921
890.5133794197435060.9732411605129870.486620580256494
900.4757386677889560.9514773355779120.524261332211044
910.4907996052713870.9815992105427750.509200394728613
920.4592940005440180.9185880010880370.540705999455982
930.4412268115292340.8824536230584670.558773188470767
940.4014473164117090.8028946328234180.598552683588291
950.3603573422093090.7207146844186170.639642657790691
960.5260362642571110.9479274714857780.473963735742889
970.5108749300101750.978250139979650.489125069989825
980.4747615323251330.9495230646502660.525238467674867
990.4648497279603110.9296994559206220.535150272039689
1000.4566648275561960.9133296551123930.543335172443804
1010.4133747888556500.8267495777113010.58662521114435
1020.40161804922670.80323609845340.5983819507733
1030.3816116248340170.7632232496680350.618388375165983
1040.3731231887405560.7462463774811130.626876811259444
1050.3302059643873320.6604119287746650.669794035612668
1060.4850377269343320.9700754538686630.514962273065668
1070.4794471311571620.9588942623143240.520552868842838
1080.4365965748630020.8731931497260030.563403425136998
1090.3897319065835420.7794638131670840.610268093416458
1100.5028550927350440.9942898145299130.497144907264956
1110.6097653612608190.7804692774783610.390234638739181
1120.5699914230220480.8600171539559040.430008576977952
1130.6200402740924260.7599194518151480.379959725907574
1140.80373370195080.3925325960984010.196266298049201
1150.7855078540329950.4289842919340090.214492145967005
1160.746205870691460.5075882586170790.253794129308540
1170.708285665753940.5834286684921210.291714334246060
1180.696016397068640.607967205862720.30398360293136
1190.6532912154336930.6934175691326130.346708784566307
1200.6491166179494120.7017667641011760.350883382050588
1210.5989875395248420.8020249209503160.401012460475158
1220.5715852315013710.8568295369972570.428414768498629
1230.6247444847737310.7505110304525370.375255515226269
1240.5908535196993690.8182929606012620.409146480300631
1250.5641278663568870.8717442672862270.435872133643113
1260.602969810524920.7940603789501610.397030189475081
1270.6462406294938620.7075187410122760.353759370506138
1280.6003925867277660.7992148265444690.399607413272234
1290.5540713922782270.8918572154435460.445928607721773
1300.5076129878358730.9847740243282530.492387012164127
1310.5848473047093830.8303053905812330.415152695290617
1320.5482326228339120.9035347543321760.451767377166088
1330.7208544743480630.5582910513038740.279145525651937
1340.669160099569920.6616798008601610.330839900430080
1350.6391892887870350.721621422425930.360810711212965
1360.5972581121055210.8054837757889580.402741887894479
1370.5767910690387880.8464178619224240.423208930961212
1380.5683329647065940.8633340705868110.431667035293406
1390.4998110006339380.9996220012678770.500188999366062
1400.4847441924922540.9694883849845090.515255807507746
1410.7514445107094440.4971109785811130.248555489290556
1420.8404081377738810.3191837244522370.159591862226119
1430.796729983310160.4065400333796810.203270016689840
1440.8020416576200820.3959166847598360.197958342379918
1450.7492242556682910.5015514886634180.250775744331709
1460.832762912172070.3344741756558600.167237087827930
1470.8090558106508940.3818883786982120.190944189349106
1480.7616720826902420.4766558346195170.238327917309758
1490.7986300290161450.4027399419677100.201369970983855
1500.7056230777412660.5887538445174680.294376922258734
1510.694990427693930.6100191446121410.305009572306070
1520.5313709579576780.9372580840846450.468629042042322


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


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/16ajy1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/16ajy1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/2zkij1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/2zkij1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/3zkij1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/3zkij1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/4zkij1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/4zkij1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/5zkij1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/5zkij1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/6rbh41292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/6rbh41292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/7kkzp1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/7kkzp1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/8kkzp1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/8kkzp1292287605.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/9kkzp1292287605.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/14/t1292287549zbmg5iyitv3s9p3/9kkzp1292287605.ps (open in new window)


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