Home » date » 2010 » Dec » 02 »

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: Thu, 02 Dec 2010 09:13:43 +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/02/t1291281403xys3fplft9v73nt.htm/, Retrieved Thu, 02 Dec 2010 10:16:43 +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/02/t1291281403xys3fplft9v73nt.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 «
4 2 5 2 3 1 4 2 2 4 2 3 4 4 3 4 4 2 2 1 5 2 2 4 2 2 2 3 2 3 2 2 3 2 4 2 4 5 1 2 2 3 1 3 5 1 1 1 4 1 3 4 3 3 3 3 1 3 3 2 2 4 2 2 2 4 1 2 2 4 2 4 4 4 3 2 2 2 4 3 2 2 4 2 2 3 3 3 2 4 2 2 3 3 2 2 2 1 1 4 4 1 3 3 4 3 4 5 1 1 2 4 2 3 4 2 3 1 2 2 3 2 2 2 2 2 2 3 4 2 3 2 3 2 4 4 2 4 4 3 3 2 4 1 2 3 3 4 5 4 2 3 4 4 2 4 4 4 5 1 3 2 2 4 2 2 4 2 2 3 5 2 2 2 2 1 4 4 2 3 2 4 2 4 4 2 2 2 4 2 3 4 2 2 3 3 2 4 4 3 2 3 4 2 4 4 2 2 2 2 4 1 4 1 3 3 4 2 4 4 4 4 3 4 4 5 2 1 1 2 5 3 2 4 2 3 2 5 1 4 4 2 3 1 4 4 3 5 2 2 4 4 3 2 5 2 1 4 4 2 4 4 2 1 1 2 4 5 3 2 2 5 4 2 4 4 2 2 3 4 3 4 5 2 2 2 4 3 4 4 2 1 2 3 2 3 4 2 2 2 2 1 4 5 2 1 3 3 2 2 4 2 2 1 4 1 2 5 1 2 2 3 2 4 4 2 4 4 2 4 2 4 1 2 5 4 2 4 4 2 2 2 4 2 4 3 1 2 3 3 2 1 4 1 1 2 4 2 4 4 2 2 4 3 2 2 4 2 2 2 4 1 1 2 1 1 1 2 2 4 3 5 5 3 4 3 3 5 2 2 4 4 2 2 4 2 2 2 4 2 4 4 1 2 3 4 1 3 5 1 1 2 3 1 2 3 2 3 1 1 2 2 5 2 1 1 3 2 3 4 1 1 2 3 1 2 5 1 2 1 4 2 1 4 2 3 2 2 1 3 4 1 2 1 3 4 2 5 1 2 4 5 4 3 4 2 2 4 4 1 3 4 1 4 3 4 1 3 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 time8 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Yt[t] = + 1.04779067010842 -0.0580797728659307X1[t] -0.0287868899563356X2[t] + 0.139832767583328X3[t] -0.0610909867704954X4[t] + 0.291585366512453X5[t] + 0.217252184272917X6[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.047790670108420.4540592.30760.022370.011185
X1-0.05807977286593070.077633-0.74810.4555390.227769
X2-0.02878688995633560.085238-0.33770.7360380.368019
X30.1398327675833280.0853541.63830.1034350.051718
X4-0.06109098677049540.082531-0.74020.4603120.230156
X50.2915853665124530.063714.57681e-055e-06
X60.2172521842729170.0748922.90090.0042740.002137


Multiple Linear Regression - Regression Statistics
Multiple R0.447149626952174
R-squared0.199942788883469
Adjusted R-squared0.168361583181500
F-TEST (value)6.33106888857657
F-TEST (DF numerator)6
F-TEST (DF denominator)152
p-value5.77565851023198e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.86648628101019
Sum Squared Residuals114.121368227188


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
142.044683353054161.95531664694584
222.94822634254786-0.948226342547861
332.235653868322050.764346131677947
422.20889441202053-0.208894412020534
522.36454961656970-0.364549616569695
621.924115208749010.0758847912509917
711.9689527861459-0.968952786145898
812.52114178647989-1.52114178647989
912.54552007786293-1.54552007786293
1022.28631382871012-0.286313828710122
1122.09405723041192-0.0940572304119174
1222.48744030499700-0.487440304996997
1322.68535284544626-0.685352845446256
1421.745097160565110.254902839434894
1512.40064866272022-1.40064866272022
1632.202458379792420.79754162020758
1721.580886101598740.419113898401262
1821.991136234794360.0088637652056422
1922.08972365238411-0.0897236523841077
2022.55372362577259-0.553723625772588
2132.360647010949660.639352989050342
2242.773987023950071.22601297604993
2321.897542074631390.102457925368610
2422.57481296077252-0.574812960772523
2521.904775564925350.095224435074649
2612.24889606379109-1.24889606379109
2722.30998705056159-0.309987050561589
2822.44240000566706-0.442400005667056
2922.74140518465737-0.74140518465737
3021.875482682015760.124517317984244
3142.574887981318011.42511201868199
3222.75905597869971-0.759055978699708
3342.447991461068411.55200853893159
3432.582307793795870.417692206204128
3511.95731069727864-0.95731069727864
3642.922450666496091.07754933350391
3733.04162142613252-0.0416214261325159
3821.644988302273800.355011697726202
3943.155450267189350.844549732810647
4022.60157241707404-0.601572417074042
4132.281200160605250.718799839394746
4232.153825853059170.846174146940832
4321.933562454881690.0664375451183134
4412.41662432961528-1.41662432961528
4522.13456122978100-0.134561229780997
4612.04027475448087-1.04027475448087
4722.33647144149967-0.336471441499671
4843.161069928247480.838930071752519
4922.30998705056159-0.309987050561589
5022.27327435517413-0.273274355174133
5122.40548458834655-0.405484588346548
5222.67590559931358-0.675905599313578
5322.42614659629345-0.42614659629345
5411.73696863320093-0.736968633200934
5522.86658464946888-0.866584649468876
5632.922450666496090.0775493335039101
5722.42614659629345-0.42614659629345
5822.46173964949071-0.461739649490714
5912.04328596838543-1.04328596838543
6011.45050058014809-0.450500580148088
6121.949613142322240.0503868576777594
6222.07207285834177-0.0720728583417701
6311.96594157224133-0.965941572241334
6421.988631013843050.0113689861569474
6511.71939650505882-0.719396505058822
6643.057949856051610.942050143948391
6742.951237556452431.04876244354757
6812.39763744881565-1.39763744881565
6911.75170060187298-0.751700601872982
7032.717731962805900.282268037194097
7141.822516577254692.17748342274531
7222.06906164443721-0.0690616444372054
7342.712618294701031.28738170529897
7442.495366110428121.50463388957188
7532.925461880400650.0745381195993453
7642.426146596293451.57385340370655
7721.719396505058820.280603494941178
7822.20378074391567-0.203780743915665
7921.904775564925350.095224435074649
8022.95424877035699-0.95424877035699
8121.766340182010750.233659817989246
8221.962349344838020.0376506551619778
8321.732638700527860.267361299472137
8412.08081503494288-1.08081503494288
8532.496071179959690.50392882004031
8631.735649914432431.26435008556757
8722.28631382871012-0.286313828710122
8842.027032559011831.97296744098817
8943.172823318753150.827176681246849
9021.994653441652180.00534655834781807
9122.45865341504066-0.458653415040662
9212.02703255901183-1.02703255901183
9311.88059635012062-0.880596350120624
9412.62293949455252-1.62293949455252
9522.49235489652355-0.492354896523553
9623.18102686666281-1.18102686666281
9733.13282166698259-0.132821666982592
9843.029979337265260.970020662734741
9922.15382585305917-0.153825853059168
10021.994653441652180.00534655834781807
10142.449819818144921.55018018185508
10222.07207285834177-0.0720728583417701
10332.229556419967440.770443580032564
10422.50047977853299-0.500479778532987
10522.33927993347118-0.339279933471184
10642.476225543182771.52377445681723
10722.73398537217951-0.733985372179509
10832.328881542826950.671118457173055
10922.29365862064250-0.293658620642496
11021.823022570207950.176977429792047
11121.472851437876310.52714856212369
11242.336471441499671.66352855850033
11332.020504138249440.97949586175056
11413.19216296257681-2.19216296257681
11512.16854045374243-1.16854045374243
11612.2119056259251-1.2119056259251
11722.07597546396181-0.0759754639618074
11822.2002598917031-0.200259891703102
11932.757658594030980.242341405969024
12012.46677829705010-1.46677829705010
12131.997739676102231.00226032389777
12211.67076397832557-0.67076397832557
12322.31943429669427-0.319434296694267
12411.67126997127883-0.671269971278829
12521.790718473393790.209281526606207
12621.904269571972090.0957304280279084
12732.231245269748760.768754730251244
12822.36806682342752-0.368066823427520
12922.22823405584419-0.228234055844191
13042.890146569681931.10985343031807
13122.84452525685324-0.844525256853242
13231.641977088369231.35802291163077
13321.878568916465810.121431083534192
13411.72240771896339-0.722407718963387
13522.57481296077252-0.574812960772523
13632.309987050561590.690012949438411
13712.38943390090599-1.38943390090599
13821.740058513005720.259941486994276
13922.35173839350843-0.351738393508427
14032.135377600950980.864622399049017
14132.727456951417120.27254304858288
14233.28898286448501-0.288982864485013
14343.05454395083220.945456049167802
14442.204485813447241.79551418655276
14522.04410233955542-0.04410233955542
14632.659652189939970.340347810060027
14732.471186895623390.528813104376608
14822.49997378557973-0.499973785579727
14911.57296029616762-0.572960296167617
15022.15514821718241-0.155148217182413
15122.69145029380087-0.691450293800873
15242.893157783586491.10684221641351
15343.602919088725690.397080911274312
15421.79322369434510.206776305654901
15532.441694936135480.558305063864516
15622.15081463915460-0.150814639154603
15742.516733187906591.48326681209341
15822.58965258572825-0.589652585728246
15942.644923866622661.35507613337734


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
100.7009043531372510.5981912937254980.299095646862749
110.5483507957656010.9032984084687970.451649204234399
120.6674452164615470.6651095670769050.332554783538453
130.6882690188289250.6234619623421510.311730981171075
140.5850042963145440.8299914073709110.414995703685456
150.5943307123083390.8113385753833220.405669287691661
160.663702829460780.672594341078440.33629717053922
170.5767461724098730.8465076551802530.423253827590127
180.4872440311734660.9744880623469310.512755968826534
190.3983454651610990.7966909303221980.601654534838901
200.3465890933513140.6931781867026280.653410906648686
210.3955430285544950.791086057108990.604456971445505
220.6698668253088290.6602663493823420.330133174691171
230.613739065688170.7725218686236590.386260934311830
240.5499296811389550.900140637722090.450070318861045
250.4769603818319640.9539207636639290.523039618168036
260.565709070240760.868581859518480.43429092975924
270.50308897677280.99382204645440.4969110232272
280.4387004342749910.8774008685499830.561299565725009
290.3856586766374060.7713173532748120.614341323362594
300.3242137139241650.648427427848330.675786286075835
310.4435662495467960.8871324990935910.556433750453204
320.3932987739826830.7865975479653670.606701226017317
330.5348594192513520.9302811614972960.465140580748648
340.4800351858731470.9600703717462930.519964814126853
350.5437741312145570.9124517375708860.456225868785443
360.6215503000272610.7568993999454770.378449699972739
370.5647764826698870.8704470346602270.435223517330113
380.5138549758862060.9722900482275880.486145024113794
390.5522401681141690.8955196637716620.447759831885831
400.5232587973186520.9534824053626950.476741202681348
410.495278954750440.990557909500880.50472104524956
420.4819090626767290.9638181253534590.518090937323271
430.4285596709006420.8571193418012830.571440329099358
440.5163747146431450.967250570713710.483625285356855
450.4715614012215630.9431228024431260.528438598778437
460.503703561023630.992592877952740.49629643897637
470.4605592111361620.9211184222723240.539440788863838
480.4621955435102160.9243910870204320.537804456489784
490.4199803639375730.8399607278751460.580019636062427
500.3767865962146040.7535731924292080.623213403785396
510.3490754849563140.6981509699126280.650924515043686
520.3222543804400270.6445087608800540.677745619559973
530.287887668307640.575775336615280.71211233169236
540.2703525321635720.5407050643271440.729647467836428
550.2534022918819090.5068045837638190.746597708118091
560.2158471502450170.4316943004900330.784152849754983
570.1872455957430580.3744911914861150.812754404256942
580.1695216997649760.3390433995299530.830478300235024
590.1864779458237230.3729558916474470.813522054176277
600.1622529714597170.3245059429194340.837747028540283
610.1348901541537170.2697803083074340.865109845846283
620.1099405805701970.2198811611403950.890059419429802
630.1208756220407670.2417512440815340.879124377959233
640.1033797078436130.2067594156872260.896620292156387
650.09717413919276750.1943482783855350.902825860807232
660.09949547334273390.1989909466854680.900504526657266
670.113973343904060.227946687808120.88602665609594
680.1584350162394790.3168700324789590.84156498376052
690.1499471926795340.2998943853590680.850052807320466
700.1264253616882580.2528507233765170.873574638311742
710.3332323695218310.6664647390436630.666767630478169
720.2917794870203700.5835589740407410.70822051297963
730.3481901239837250.696380247967450.651809876016275
740.4402519608743220.8805039217486440.559748039125678
750.3968337551124350.793667510224870.603166244887565
760.5008408417019730.9983183165960550.499159158298027
770.4603292047578660.9206584095157320.539670795242134
780.4170045532054770.8340091064109530.582995446794523
790.3750672584964550.7501345169929090.624932741503545
800.3855023690548110.7710047381096230.614497630945189
810.3480277121968380.6960554243936760.651972287803162
820.3074486412423940.6148972824847880.692551358757606
830.2743784938884560.5487569877769120.725621506111544
840.2985533126264620.5971066252529240.701446687373538
850.2738768433687890.5477536867375790.726123156631211
860.3138490946508760.6276981893017510.686150905349124
870.2772867965131380.5545735930262760.722713203486862
880.4734557399396370.9469114798792750.526544260060363
890.4748660080809980.9497320161619970.525133991919002
900.4277123557590740.8554247115181480.572287644240926
910.3966324276996770.7932648553993530.603367572300323
920.406185912856160.812371825712320.59381408714384
930.4094724257424480.8189448514848970.590527574257552
940.52247235650630.95505528698740.4775276434937
950.4969744827809110.9939489655618220.503025517219089
960.5591496946278520.8817006107442960.440850305372148
970.5113648170043080.9772703659913830.488635182995692
980.5169661136649240.9660677726701520.483033886335076
990.4692490943622150.938498188724430.530750905637785
1000.4209350598366160.8418701196732330.579064940163384
1010.5324347950402960.9351304099194080.467565204959704
1020.4836956411950020.9673912823900040.516304358804998
1030.4654976642275040.9309953284550090.534502335772496
1040.4333820173801380.8667640347602760.566617982619862
1050.3909573640852240.7819147281704490.609042635914776
1060.4897954243618670.9795908487237340.510204575638133
1070.4808933604444260.9617867208888510.519106639555574
1080.4670825741760830.9341651483521660.532917425823917
1090.4206007490686940.8412014981373890.579399250931306
1100.3731258178222290.7462516356444580.626874182177771
1110.3376168400374710.6752336800749410.66238315996253
1120.4031521790801010.8063043581602020.596847820919899
1130.4209816510084350.8419633020168710.579018348991565
1140.7454914733688840.5090170532622320.254508526631116
1150.8505398997792380.2989202004415240.149460100220762
1160.8714062803531810.2571874392936380.128593719646819
1170.8393072202614770.3213855594770470.160692779738523
1180.8280872588138450.343825482372310.171912741186155
1190.793997354124590.4120052917508190.206002645875409
1200.8575944798217730.2848110403564540.142405520178227
1210.8991876694334720.2016246611330570.100812330566529
1220.8794663610754540.2410672778490930.120533638924546
1230.8467701032918650.3064597934162690.153229896708135
1240.8452760845003330.3094478309993330.154723915499667
1250.8127003606850520.3745992786298960.187299639314948
1260.7677868426934160.4644263146131670.232213157306584
1270.7715721665446290.4568556669107420.228427833455371
1280.7326785721623160.5346428556753680.267321427837684
1290.6874437773908760.6251124452182480.312556222609124
1300.6543563791070070.6912872417859870.345643620892993
1310.6882226360966060.6235547278067890.311777363903394
1320.7725899207639490.4548201584721020.227410079236051
1330.7187058095923740.5625883808152510.281294190407626
1340.6819919043718870.6360161912562250.318008095628113
1350.722006184200210.555987631599580.27799381579979
1360.6958856065571440.6082287868857120.304114393442856
1370.8313290447273450.3373419105453090.168670955272655
1380.774598565693070.4508028686138610.225401434306930
1390.7097279864049540.5805440271900930.290272013595046
1400.9261663523687530.1476672952624940.073833647631247
1410.9115748323426280.1768503353147450.0884251676573723
1420.9045708268558830.1908583462882340.095429173144117
1430.969711135386410.06057772922718050.0302888646135902
1440.9892558064713850.02148838705723000.0107441935286150
1450.978446851657930.04310629668414010.0215531483420700
1460.9528900438321380.09421991233572460.0471099561678623
1470.9570944968604120.08581100627917660.0429055031395883
1480.9221527753047860.1556944493904280.0778472246952139
1490.9781787423142370.04364251537152680.0218212576857634


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level30.0214285714285714OK
10% type I error level60.0428571428571429OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/1030ym1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/1030ym1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/1wh1a1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/1wh1a1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/27q0v1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/27q0v1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/37q0v1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/37q0v1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/47q0v1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/47q0v1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/57q0v1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/57q0v1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/60zzy1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/60zzy1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/7trhj1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/7trhj1291281211.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/8trhj1291281211.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291281403xys3fplft9v73nt/8trhj1291281211.ps (open in new window)


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