Home » date » 2010 » Dec » 13 »

*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: Mon, 13 Dec 2010 20:51:13 +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/13/t1292273377k2wegxp4f2bfl3x.htm/, Retrieved Mon, 13 Dec 2010 21:49:37 +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/13/t1292273377k2wegxp4f2bfl3x.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
0 13 13 14 13 3 0 12 12 8 13 5 1 15 10 12 16 6 1 12 9 7 12 6 1 10 10 10 11 5 1 12 12 7 12 3 0 15 13 16 18 8 1 9 12 11 11 4 0 12 12 14 14 4 0 11 6 6 9 4 1 11 5 16 14 6 0 11 12 11 12 6 0 15 11 16 11 5 1 7 14 12 12 4 0 11 14 7 13 6 1 11 12 13 11 4 1 10 12 11 12 6 0 14 11 15 16 6 0 10 11 7 9 4 0 6 7 9 11 4 0 11 9 7 13 2 0 15 11 14 15 7 0 11 11 15 10 5 0 12 12 7 11 4 1 14 12 15 13 6 1 15 11 17 16 6 0 9 11 15 15 7 1 13 8 14 14 5 1 13 9 14 14 6 1 16 12 8 14 4 1 13 10 8 8 4 0 12 10 14 13 7 1 14 12 14 15 7 1 11 8 8 13 4 0 9 12 11 11 4 0 16 11 16 15 6 1 12 12 10 15 6 0 10 7 8 9 5 1 13 11 14 13 6 1 16 11 16 16 7 1 14 12 13 13 6 1 15 9 5 11 3 1 5 15 8 12 3 0 8 11 10 12 4 0 11 11 8 12 6 1 16 11 13 14 7 1 17 11 15 14 5 1 9 15 6 8 4 1 9 11 12 13 5 1 13 12 16 16 6 1 10 12 5 13 6 0 6 9 15 11 6 1 12 12 12 14 5 1 8 12 8 13 4 1 14 13 13 13 5 1 12 11 14 13 5 0 11 9 12 12 4 0 16 9 16 16 6 1 8 11 10 15 2 0 15 11 15 15 8 1 7 12 8 12 3 0 16 12 16 14 6 1 14 9 19 12 6 1 16 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 time6 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Liked[t] = + 9.25946256471586 -0.235508153221877Gender[t] + 0.202661168726369Popularity[t] -0.0127348359586671FindingFriends[t] + 0.0418507240312587KnowingPeople[t] + 0.228874092442771Celebrity[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)9.259462564715861.0936448.466600
Gender-0.2355081532218770.067227-3.50320.0006060.000303
Popularity0.2026611687263690.0643583.1490.0019780.000989
FindingFriends-0.01273483595866710.065811-0.19350.8468250.423413
KnowingPeople0.04185072403125870.0622220.67260.5022360.251118
Celebrity0.2288740924427710.105932.16060.0323130.016157


Multiple Linear Regression - Regression Statistics
Multiple R0.452533389584601
R-squared0.204786468688928
Adjusted R-squared0.178279350978559
F-TEST (value)7.72571619919355
F-TEST (DF numerator)5
F-TEST (DF denominator)150
p-value1.72100968731659e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.42245083732669
Sum Squared Residuals880.240208889717


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11313.0010373044619-0.00103730446192066
21313.0177548123922-0.0177548123921965
31613.81197682583462.18802317416544
41213.0074745354578-1.00747453545783
51112.4860954416974-1.48609544169744
61212.2826477502535-0.282647750253518
71814.63443155219103.36556844780898
81112.0709412326422-1.07094123264222
91413.03998506413700.960014935863021
10912.5789271189125-3.57892711891254
111413.23240922684750.767590773152538
121213.1695199082024-1.16951990820238
131113.9732789467800-2.97327894678004
141211.68199994730340.318000052696592
151312.976647340160.0233526598399927
161112.5599650181575-1.55996501815747
171212.7313505862541-0.731350586254131
181613.95764114646522.04235885353482
19912.3544424944241-3.3544424944241
201111.6784386114158-0.67843861141581
211312.12482515018230.875174849817743
221514.34732568360310.652674316396935
231013.1207835478433-3.12078354784331
241112.7470299959182-1.74702999591817
251313.7093981572846-0.70939815728464
261614.00849561003221.99150438996781
271513.17320939527611.82679060472389
281413.28695151591890.713048484081091
291413.5030907724030.496909227596987
301413.36401724163300.635982758366977
31812.7815034073713-4.78150340737125
321313.7520770133826-0.752077013382626
331513.89642152569621.10357847430385
341312.40165074183580.598349258164151
351112.3064493858641-1.30644938586410
361514.40481420794920.59518579205082
371513.09482219967561.90517780032439
38912.6761066547328-3.67610665473280
391313.4776211004857-0.477621100485679
401614.39818014717011.60181985282993
411313.6256967092221-0.625696709222122
421112.8451343162461-1.84513431624611
431210.86766578532421.13233421467580
441212.0746723290651-0.0746723290651366
451213.0567025720673-1.05670257206727
461414.2726279750763-0.272627975076297
471414.1012424069796-0.101242406979641
48811.8234831046099-3.82348310460993
491312.35440088507490.645599114925083
501613.54858771258952.45141228741047
511312.48024624206660.519753757933421
521112.3618214685716-1.36182146857157
531412.94964955529541.05035044470465
541311.74272789182211.25727210817793
551313.3840877808207-0.384087780820684
561313.0460858393165-0.0460858393165396
571212.7918269552241-0.791826955224094
581614.43028387986651.56971612013349
591511.38141599095773.61858400904228
601514.61805050007710.381949499922905
611211.31119263065290.688807369347064
621414.3920793719905-0.392079371990512
631213.9150055612857-1.91500556128568
641514.08560460666480.914395393335215
651212.1287662128047-0.128766212804698
661313.6323307700012-0.632330770001228
671213.1014146511055-1.10141465110553
681212.9430571038654-0.94305710386543
691313.8283578779485-0.82835787794849
70510.7196317859369-5.71963178593693
711313.6540693454956-0.654069345495645
721313.4296696012749-0.429669601274859
731412.95338065171831.04661934828173
741713.13597294282633.86402705717372
751313.4395014728773-0.439501472877338
761313.5395839730538-0.53958397305378
771213.2561243206211-1.25612432062108
781313.0424396231613-0.0424396231612821
791412.95869490418031.04130509581971
801110.79595592142130.204044078578722
811211.73372415228630.266275847713675
821213.937613878196-1.937613878196
831613.87393969840272.12606030159733
841212.5279461657287-0.527946165728693
851212.6371156241392-0.637115624139247
861213.4012969650013-1.40129696500134
871012.193632049729-2.19363204972899
881512.97147301105742.02852698894257
891514.54335279155030.456647208449673
901212.4381439424866-0.438143942486615
911613.51287937308702.48712062691299
921513.06329502349721.93670497650281
931614.38544531121141.61455468878859
941314.2148878751815-1.21488787518148
951212.9205336672228-0.920533667222764
961112.3835583824967-1.38355838249669
971312.33225551359780.667744486402205
981011.4592682393894-1.45926823938938
991512.88162917846622.11837082153383
1001313.5748422456551-0.574842245655113
1011614.44003087120131.55996912879867
1021514.57910274040200.420897259597975
1031813.76762993342984.23237006657018
1041312.25726295860380.742737041396155
1051010.3324018078234-0.332401807823358
1061613.94515788605522.05484211394478
1071311.86753681211681.13246318788322
1081514.41538933135070.584610668649274
1091411.85853307258102.14146692741897
1101511.84825279564673.15174720435333
1111412.77245805848631.22754194151368
1121313.5838892561093-0.583889256109342
1131312.76660885885550.233391141144536
1141513.62569670922211.37430329077788
1151614.015381246361.98461875364000
1161414.0856046066648-0.085604606664785
117610.848503587769-4.84850358776901
1181410.84849015402643.15150984597359
1191111.8200868585557-0.82008685855573
1201210.56876325958591.43123674041407
1211212.8285851651662-0.828585165166163
122412.9676285614340-8.96762856143401
1231612.05707985380643.94292014619355
1241210.36314085583661.63685914416342
1251410.93609105536223.06390894463781
1261311.65551874727881.34448125272124
12759.66422037570819-4.66422037570819
1281611.45431701290274.54568298709733
1291112.4772984013443-1.47729840134427
130811.4506693930624-3.45066939306244
1311512.62007479680892.37992520319106
132611.3256206693923-5.32562066939232
1331410.77678029012353.22321970987651
1341211.75600588277970.24399411722031
1351510.73470642403444.26529357596557
1361411.88127990916582.11872009083418
137411.9783028208671-7.9783028208671
1381512.08992683830202.91007316169805
1391011.7775344920746-1.77753449207458
1401011.9818121789172-1.98181217891719
1411311.71913622241101.28086377758898
142512.5801037368533-7.58010373685326
1431511.34445461896133.65554538103875
1441211.66828015339640.331719846603630
1451210.61829791483581.38170208516416
1461612.93054566784893.06945433215112
147412.9609945006549-8.96099450065491
1481411.91401187889152.08598812110847
1491111.3376971338196-0.337697133819581
1501310.11596746366752.88403253633253
151129.139041506927832.86095849307217
1521010.5726775502868-0.572677550286762
15398.798891625039870.201108374960133
1541010.3438450671932-0.343845067193171
155129.773771222422882.22622877757712
1561311.33109457178571.66890542821435


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.03320637952917180.06641275905834350.966793620470828
100.00818266752363020.01636533504726040.99181733247637
110.006354467020220580.01270893404044120.99364553297978
120.002649545844924810.005299091689849630.997350454155075
130.1708990607424270.3417981214848550.829100939257573
140.1053190051546550.2106380103093100.894680994845345
150.06161223641764520.1232244728352900.938387763582355
160.05347855812742980.1069571162548600.94652144187257
170.03871598603151390.07743197206302780.961284013968486
180.02968540163083330.05937080326166670.970314598369167
190.02154443245860110.04308886491720220.978455567541399
200.02593798050818340.05187596101636670.974062019491817
210.05510996186280860.1102199237256170.944890038137191
220.03548720290512430.07097440581024860.964512797094876
230.05686660625600850.1137332125120170.943133393743992
240.04039428507629760.08078857015259510.959605714923702
250.03235127229848380.06470254459696760.967648727701516
260.02368254690911230.04736509381822470.976317453090888
270.02023721929988350.04047443859976690.979762780700117
280.01348673222350100.02697346444700190.9865132677765
290.008364650844212380.01672930168842480.991635349155788
300.005569144209203410.01113828841840680.994430855790797
310.01951615446354440.03903230892708880.980483845536456
320.01470799157755370.02941598315510730.985292008422446
330.009661717184858730.01932343436971750.990338282815141
340.008770909816508620.01754181963301720.991229090183491
350.005762542109115470.01152508421823090.994237457890885
360.003627699308216580.007255398616433160.996372300691783
370.003219868719089980.006439737438179960.99678013128091
380.003797806863197570.007595613726395140.996202193136802
390.002700704423645430.005401408847290860.997299295576355
400.001745312508145860.003490625016291710.998254687491854
410.001278996213117500.002557992426234990.998721003786883
420.0008557707538766360.001711541507753270.999144229246123
430.0007790055350896640.001558011070179330.99922099446491
440.0005226031275025390.001045206255005080.999477396872497
450.0003225435454748650.000645087090949730.999677456454525
460.0002093161028807820.0004186322057615640.99979068389712
470.0001238515807004020.0002477031614008050.9998761484193
480.0003160990670925170.0006321981341850350.999683900932907
490.0001998863204525930.0003997726409051850.999800113679547
500.0001693671897013770.0003387343794027530.999830632810299
510.0001227046011629350.0002454092023258710.999877295398837
528.96692580477432e-050.0001793385160954860.999910330741952
535.77686743941312e-050.0001155373487882620.999942231325606
545.23465235456143e-050.0001046930470912290.999947653476454
553.27209495952781e-056.54418991905561e-050.999967279050405
561.87221918667679e-053.74443837335358e-050.999981277808133
571.07851489024146e-052.15702978048293e-050.999989214851098
588.34591880135242e-061.66918376027048e-050.999991654081199
595.04409808309112e-050.0001008819616618220.99994955901917
602.95079815552761e-055.90159631105522e-050.999970492018445
611.95191484788638e-053.90382969577275e-050.999980480851521
621.17670821461057e-052.35341642922114e-050.999988232917854
631.83445296541794e-053.66890593083588e-050.999981655470346
641.09663237563734e-052.19326475127468e-050.999989033676244
656.74626782564889e-061.34925356512978e-050.999993253732174
663.83789395744204e-067.67578791488408e-060.999996162106043
673.24687618326127e-066.49375236652255e-060.999996753123817
681.95585103708257e-063.91170207416515e-060.999998044148963
691.27585840183468e-062.55171680366936e-060.999998724141598
701.47517042337942e-052.95034084675885e-050.999985248295766
719.44108218984345e-061.88821643796869e-050.99999055891781
725.43545077342035e-061.08709015468407e-050.999994564549227
734.29553371975103e-068.59106743950205e-060.99999570446628
741.17963126668169e-052.35926253336337e-050.999988203687333
756.88177136827811e-061.37635427365562e-050.999993118228632
764.05641938029076e-068.11283876058153e-060.99999594358062
772.60084105511261e-065.20168211022523e-060.999997399158945
781.46385175299052e-062.92770350598103e-060.999998536148247
791.07785120421103e-062.15570240842205e-060.999998922148796
807.43047174197283e-071.48609434839457e-060.999999256952826
815.4563401078505e-071.0912680215701e-060.99999945436599
824.10631316449519e-078.21262632899038e-070.999999589368684
834.73785601725248e-079.47571203450496e-070.999999526214398
842.7624757670266e-075.5249515340532e-070.999999723752423
852.03038446977654e-074.06076893955308e-070.999999796961553
861.36072332213164e-072.72144664426328e-070.999999863927668
871.30581862181447e-072.61163724362894e-070.999999869418138
881.12488608225840e-072.24977216451679e-070.999999887511392
896.11976930446247e-081.22395386089249e-070.999999938802307
903.75016314080406e-087.50032628160812e-080.999999962498369
913.89806499851154e-087.79612999702309e-080.99999996101935
923.56015406488215e-087.12030812976431e-080.99999996439846
932.35772970834702e-084.71545941669403e-080.999999976422703
941.41626441015748e-082.83252882031497e-080.999999985837356
958.8430107531714e-091.76860215063428e-080.99999999115699
966.52677823728966e-091.30535564745793e-080.999999993473222
975.07886174784363e-091.01577234956873e-080.999999994921138
985.51534555150793e-091.10306911030159e-080.999999994484654
994.0923835229472e-098.1847670458944e-090.999999995907616
1002.18726469888137e-094.37452939776274e-090.999999997812735
1011.52345411610492e-093.04690823220983e-090.999999998476546
1027.92577505163597e-101.58515501032719e-090.999999999207422
1035.12226493247483e-091.02445298649497e-080.999999994877735
1045.99477329362574e-091.19895465872515e-080.999999994005227
1051.58805599181335e-083.17611198362669e-080.99999998411944
1061.09533246334767e-082.19066492669535e-080.999999989046675
1076.69160368617817e-091.33832073723563e-080.999999993308396
1084.72121536659872e-099.44243073319744e-090.999999995278785
1095.79219582562647e-091.15843916512529e-080.999999994207804
1106.540929601759e-091.3081859203518e-080.99999999345907
1113.35805079432463e-096.71610158864927e-090.99999999664195
1122.25095582579562e-094.50191165159124e-090.999999997749044
1131.41222952744239e-092.82445905488478e-090.99999999858777
1148.98756840744456e-101.79751368148891e-090.999999999101243
1159.6101248690528e-101.92202497381056e-090.999999999038988
1167.5539302997093e-101.51078605994186e-090.999999999244607
1172.53977653479898e-085.07955306959795e-080.999999974602235
1185.16106532064725e-081.03221306412945e-070.999999948389347
1192.82867593441334e-085.65735186882668e-080.99999997171324
1201.47123577463059e-082.94247154926117e-080.999999985287642
1219.2627432108212e-091.85254864216424e-080.999999990737257
1226.15860540521451e-061.23172108104290e-050.999993841394595
1231.51741900564564e-053.03483801129128e-050.999984825809944
1241.07215946125291e-052.14431892250582e-050.999989278405387
1251.44241477476284e-052.88482954952569e-050.999985575852252
1261.21742629134651e-052.43485258269301e-050.999987825737087
1270.0001220768453924170.0002441536907848330.999877923154608
1280.0002007369138006640.0004014738276013280.9997992630862
1290.0001519453162438370.0003038906324876730.999848054683756
1300.0001703520757349090.0003407041514698180.999829647924265
1310.0001797634184732010.0003595268369464020.999820236581527
1320.0007464479915520740.001492895983104150.999253552008448
1330.0005697819787818850.001139563957563770.999430218021218
1340.0003340335997320410.0006680671994640820.999665966400268
1350.0004461688021423280.0008923376042846550.999553831197858
1360.0004729011902909150.000945802380581830.99952709880971
1370.01774850555164330.03549701110328660.982251494448357
1380.01713254555259610.03426509110519230.982867454447404
1390.01052086294575600.02104172589151200.989479137054244
1400.007225339378202720.01445067875640540.992774660621797
1410.004417415063544840.008834830127089680.995582584936455
1420.03259334350430110.06518668700860220.967406656495699
1430.04107354505943980.08214709011887960.95892645494056
1440.02982547975158810.05965095950317620.970174520248412
1450.02118281975738770.04236563951477540.978817180242612
1460.1095979999693360.2191959999386730.890402000030664
1470.7971014211855570.4057971576288870.202898578814443


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level1030.741007194244604NOK
5% type I error level1210.870503597122302NOK
10% type I error level1310.942446043165468NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/10prwd1292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/10prwd1292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/1iqh11292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/1iqh11292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/2iqh11292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/2iqh11292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/3shg41292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/3shg41292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/4shg41292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/4shg41292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/5shg41292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/5shg41292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/63qx71292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/63qx71292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/7ezea1292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/7ezea1292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/8ezea1292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/8ezea1292273462.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/9ezea1292273462.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/13/t1292273377k2wegxp4f2bfl3x/9ezea1292273462.ps (open in new window)


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