Home » date » 2010 » Dec » 02 »

Mini tutorial -

*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 15:06:31 +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/t1291302308ta3t4buzzm5x2ys.htm/, Retrieved Thu, 02 Dec 2010 16:05:19 +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/t1291302308ta3t4buzzm5x2ys.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:
Trend extra
 
IsPrivate?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
2 13 13 14 13 3 5 1 3 12 12 8 13 5 6 1 3 15 10 12 16 6 4 1 3 12 9 7 12 6 6 2 3 10 10 10 11 5 3 1 3 12 12 7 12 3 10 1 2 15 13 16 18 8 8 2 3 9 12 11 11 4 3 1 3 12 12 14 14 4 4 1 4 11 6 6 9 4 3 1 3 11 5 16 14 6 5 2 3 11 12 11 12 6 5 2 2 15 11 16 11 5 6 1 3 7 14 12 12 4 5 1 3 11 14 7 13 6 3 1 3 11 12 13 11 4 4 2 3 10 12 11 12 6 8 1 3 14 11 15 16 6 8 2 2 10 11 7 9 4 8 2 4 6 7 9 11 4 5 1 3 11 9 7 13 2 8 2 2 15 11 14 15 7 2 1 3 11 11 15 10 5 0 1 3 12 12 7 11 4 5 2 2 14 12 15 13 6 2 1 2 15 11 17 16 6 7 1 4 9 11 15 15 7 5 1 2 13 8 14 14 5 2 1 3 13 9 14 14 6 12 2 2 16 12 8 14 4 7 1 4 13 10 8 8 4 0 2 3 12 10 14 13 7 2 1 2 14 12 14 15 7 3 1 3 11 8 8 13 4 0 2 3 9 12 11 11 4 9 2 1 16 11 16 15 6 2 2 3 12 12 10 15 6 3 1 3 10 7 8 9 5 1 2 3 13 11 14 13 6 10 2 2 16 11 16 16 7 1 1 3 14 12 13 13 6 4 1 15 9 5 11 3 6 1 5 5 15 8 12 3 6 1 4 8 11 10 12 4 4 2 3 11 11 8 12 6 4 2 2 16 11 13 14 7 7 1 2 17 11 15 14 5 7 2 3 9 15 6 8 4 7 2 4 9 11 12 13 5 0 1 2 13 12 16 16 6 3 2 3 10 12 5 13 etc...
 
Output produced by software:

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


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time9 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
NotPopular[t] = -0.897130299603902 -0.0394487100113876Popularity[t] + 0.506639399645459FindingFriends[t] + 0.341104470528959KnowingPeople[t] -0.41203603377187Liked[t] -0.0763187735029738Celebrity[t] -0.220036383087809WeightedSum[t] + 1.08469284012130Gender[t] + 0.0251347382005958t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)-0.8971302996039021.748825-0.5130.6087280.304364
Popularity-0.03944871001138760.109012-0.36190.7179650.358983
FindingFriends0.5066393996454590.0678787.46400
KnowingPeople0.3411044705289590.0882313.8660.0001668.3e-05
Liked-0.412036033771870.094158-4.3762.3e-051.1e-05
Celebrity-0.07631877350297380.071209-1.07180.2855830.142791
WeightedSum-0.2200363830878090.124401-1.76880.0790060.039503
Gender1.084692840121300.2400324.51891.3e-056e-06
t0.02513473820059580.0063723.94450.0001236.2e-05


Multiple Linear Regression - Regression Statistics
Multiple R0.875372522073427
R-squared0.766277052401192
Adjusted R-squared0.753557436205339
F-TEST (value)60.243724386196
F-TEST (DF numerator)8
F-TEST (DF denominator)147
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.42923828943667
Sum Squared Residuals867.476204029183


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
124.3760321563839-2.37603215638390
231.514675451683071.48532454831693
330.9002490340314692.09975096596853
431.124332359009131.87566764099087
532.822088444881840.177911555118155
630.9586379823830892.04136201761691
723.11296176110645-1.11296176110645
834.36764341281784-1.36764341281784
933.84160094816772-0.841600948167725
1040.417728786222443.58227121377756
1131.779071188147561.22092881185244
1234.46923143876531-1.46923143876531
1324.71907987398542-2.71907987398542
1435.09962373191658-2.09962373191658
1533.13684046282462-0.136840462824622
1636.03668929649123-3.03668929649123
1732.889551850394950.110448149605048
1833.05121893605419-0.0512189360541913
1923.5422025334777-1.54220253347770
2041.132127695798322.86787230420168
2131.044237912495061.95576208750494
2223.34244742699068-1.34244742699068
2336.5193719578067-3.51937195780669
2433.93165528582305-0.931655285823046
2525.20543506282498-3.20543506282498
2623.030400615672-1.030400615672
2743.385808699327520.61419130067248
2822.61690865805847-0.616908658058469
2931.956693031644761.04330696835524
3021.504899637897510.495100362102495
3145.73226543120852-1.73226543120852
3234.02957360692908-1.02957360692908
3323.94498127376627-1.94498127376627
3432.813108097682820.186891902317180
3534.81075588582837-1.81075588582837
3615.49810560646981-4.49810560646981
3732.836318537978560.163681462021435
3833.79824533934783-0.798245339347827
3934.07342801288912-1.07342801288912
4024.24563329496387-2.24563329496387
4134.48530916680098-1.48530916680098
42159.59824356394975.40175643605031
43510.163015871426-5.16301587142599
4489.79509653898804-1.79509653898804
45116.898187570232684.10181242976732
46169.71777227652556.2822277234745
471712.44491433859424.55508566140576
4897.202601690659571.79739830934043
49910.3037361030174-1.30373610301743
501313.5629572441280-0.562957244128046
51107.914880530335952.08511946966405
52611.3578536138461-5.35785361384609
531212.1121287615502-0.112128761550237
5489.02062585078764-1.02062585078764
551411.28903032785932.71096967214067
561213.5097062029492-1.50970620294916
571110.19673035087000.80326964912996
581615.33974804998200.660251950017969
59810.8584914775033-2.85849147750332
601513.19031146504561.80968853495444
6178.56440160882829-1.56440160882829
621613.17344522405622.82655477594384
631413.22258005705400.777419942945966
641612.75254656613383.24745343386615
6598.030628664951480.96937133504852
661411.52864238457432.47135761542570
671111.8139154177650-0.813915417764983
68137.494872019967355.50512798003265
691512.49673978861332.50326021138668
7054.556826427092250.443173572907753
711512.57307811532792.42692188467212
721312.99309997440810.00690002559190916
731110.36876096062150.631239039378527
741114.1797015958454-3.17970159584545
751211.13511339807290.864886601927082
761213.1355003297079-1.13550032970793
771212.3038846539797-0.30388465397972
781211.20863633691760.791363663082398
791411.46530542138882.53469457861123
80610.2779200162553-4.27792001625531
8178.157340876844-1.15734087684399
821410.54969349451783.45030650548215
831413.98770701852290.0122929814770966
841011.2308932994876-1.23089329948763
85138.970286224757554.02971377524245
861211.11370240214340.886297597856591
8799.70571401836452-0.705714018364521
881210.93048631277191.06951368722808
891613.17470321528732.82529678471266
901010.7410102531608-0.741010253160765
911412.59254795168831.40745204831168
921011.7123494489778-1.71234944897783
931613.13810217543942.86189782456061
941513.79186856947201.20813143052798
951211.69688303019170.303116969808286
961010.2335824226875-0.233582422687455
9788.84692134889893-0.846921348898932
9888.72400251255341-0.724002512553412
991114.2389633404637-3.23896334046371
100139.873215810210473.12678418978953
1011614.11422451120991.88577548879008
1021613.15227108559492.8477289144051
1031416.1487668990251-2.14876689902506
1041111.9519951104391-0.951995110439108
10546.54559165919482-2.54559165919482
1061412.06659953713071.93340046286926
107912.3725385655714-3.37253856557135
1081414.7694528287679-0.769452828767913
109813.5620023360651-5.56200233606515
110812.1195381747932-4.11953817479322
1111113.0983795716071-2.09837957160709
1121213.5571533906941-1.55715339069414
113119.554457804948461.44554219505154
1141412.06430749495251.93569250504752
1151511.74082759077363.25917240922637
1161612.25216177439973.74783822560030
1171612.15260909166483.84739090833518
118119.498611267959031.50138873204097
1191412.87107545213851.12892454786147
1201413.24392691862390.756073081376064
1211213.5707174173421-1.57071741734210
1221415.6118169324415-1.61181693244152
123811.0362251992596-3.03622519925961
1241313.5589306837328-0.558930683732803
1251614.32661310455121.67338689544879
126128.822981283002473.17701871699753
1271614.03365514883301.96634485116698
1281214.0609128486240-2.06091284862404
1291114.5657727771045-3.56577277710446
13046.31126272484161-2.31126272484161
1311612.66790739399923.33209260600076
1321512.68990224992262.31009775007745
1331010.0980741579090-0.0980741579090252
1341312.53156875370150.46843124629847
1351513.57360162468741.42639837531263
1361212.1988639709057-0.198863970905742
1371415.5997339660851-1.5997339660851
138711.7282442252924-4.72824422529235
1391913.86751223368545.13248776631464
1401215.6963022983277-3.69630229832766
1411214.3678566882992-2.36785668829918
1421313.3915277347035-0.391527734703509
1431516.8633728412394-1.86337284123943
14489.8434796048674-1.84347960486741
1451212.4738033733387-0.47380337333872
146109.75659254973570.243407450264293
14789.12675919737866-1.12675919737866
1481013.8227412004506-3.82274120045061
1491513.86593061380141.13406938619864
1501612.42678428651533.57321571348475
1511310.97494450289282.02505549710717
1521615.27542394325330.72457605674665
153911.6376297982715-2.63762979827154
1541413.65924904739310.34075095260693
1551413.63490046328630.365099536713684
1561213.2331396915687-1.23313969156869


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
127.36296561677173e-050.0001472593123354350.999926370343832
132.45093529440490e-064.90187058880979e-060.999997549064706
146.16922004002754e-071.23384400800551e-060.999999383077996
155.37274866835186e-061.07454973367037e-050.999994627251332
166.063788588944e-071.2127577177888e-060.99999939362114
176.56107551534248e-081.31221510306850e-070.999999934389245
186.47275907396734e-091.29455181479347e-080.99999999352724
192.73037407447581e-075.46074814895162e-070.999999726962593
204.54255087549158e-089.08510175098317e-080.999999954574491
211.23430952533667e-082.46861905067334e-080.999999987656905
221.21314641036168e-082.42629282072335e-080.999999987868536
233.00292421747277e-096.00584843494555e-090.999999996997076
245.87978243507212e-101.17595648701442e-090.999999999412022
251.70280545820092e-103.40561091640185e-100.99999999982972
263.00012067269478e-116.00024134538956e-110.999999999969999
272.72887469479433e-115.45774938958866e-110.999999999972711
283.30007960039896e-116.60015920079793e-110.999999999967
299.17563845882922e-121.83512769176584e-110.999999999990824
301.71334983620567e-123.42669967241134e-120.999999999998287
318.18115113330363e-121.63623022666073e-110.999999999991819
321.71523665606786e-123.43047331213572e-120.999999999998285
336.08957521880222e-131.21791504376044e-120.99999999999939
341.65860404809251e-133.31720809618502e-130.999999999999834
353.23126079078295e-146.4625215815659e-140.999999999999968
368.81656816849453e-141.76331363369891e-130.999999999999912
372.20682298146298e-144.41364596292596e-140.999999999999978
387.43961139362273e-151.48792227872455e-140.999999999999993
393.12800755499881e-156.25601510999761e-150.999999999999997
405.2121277185154e-151.04242554370308e-140.999999999999995
417.0672991546869e-141.41345983093738e-130.99999999999993
420.001592164932883790.003184329865767570.998407835067116
430.007974085941880020.01594817188376000.99202591405812
440.008777794301511450.01755558860302290.991222205698489
450.09828574379811970.1965714875962390.90171425620188
460.7922776229545930.4154447540908140.207722377045407
470.9352187243339230.1295625513321540.0647812756660772
480.918115903165330.1637681936693410.0818840968346704
490.9179557763607470.1640884472785060.0820442236392528
500.920722877260140.1585542454797200.0792771227398602
510.9002394784992170.1995210430015650.0997605215007825
520.9888888334016730.02222233319665370.0111111665983268
530.984815374603160.030369250793680.01518462539684
540.9863484416210760.02730311675784730.0136515583789236
550.9895612867626650.02087742647467080.0104387132373354
560.9862192089142240.02756158217155220.0137807910857761
570.9819779624168250.03604407516634910.0180220375831746
580.9811906163334690.03761876733306250.0188093836665312
590.982761349578880.03447730084224080.0172386504211204
600.982509432806670.03498113438666090.0174905671933304
610.9804471064937320.03910578701253640.0195528935062682
620.985146927307880.02970614538423890.0148530726921195
630.981177193345370.03764561330926090.0188228066546304
640.9847918089171040.03041638216579150.0152081910828958
650.979792785452670.04041442909465970.0202072145473298
660.9784568166196170.0430863667607660.021543183380383
670.9786917140721930.04261657185561410.0213082859278071
680.9892005378975820.02159892420483610.0107994621024181
690.9875509998615620.02489800027687620.0124490001384381
700.9840612533375050.03187749332499070.0159387466624953
710.9849941225731360.03001175485372850.0150058774268642
720.9807660115888790.03846797682224270.0192339884111213
730.974607202886660.0507855942266810.0253927971133405
740.9849697785239130.03006044295217450.0150302214760873
750.9797410790916150.04051784181677060.0202589209083853
760.9776643956000660.04467120879986880.0223356043999344
770.9710402770140710.05791944597185730.0289597229859286
780.9624735519836610.0750528960326780.037526448016339
790.9683209490649740.06335810187005240.0316790509350262
800.9850322481875270.02993550362494510.0149677518124725
810.9844277992185470.03114440156290550.0155722007814527
820.9883422262530870.02331554749382580.0116577737469129
830.9842210345184260.03155793096314790.0157789654815740
840.9814945670793750.03701086584125090.0185054329206254
850.994274188251550.01145162349689760.0057258117484488
860.9921163505433150.01576729891336930.00788364945668463
870.989904892127240.02019021574552190.0100951078727609
880.988380435196280.02323912960744150.0116195648037207
890.9853236725886880.02935265482262310.0146763274113115
900.9813724544358150.03725509112836950.0186275455641847
910.9766666312103440.04666673757931250.0233333687896563
920.9819060089765770.03618798204684690.0180939910234234
930.9806032963015840.03879340739683190.0193967036984160
940.977139516157550.04572096768490210.0228604838424510
950.9705954418734560.05880911625308810.0294045581265440
960.962600970294350.07479805941130060.0373990297056503
970.9602837911602450.07943241767951010.0397162088397551
980.9491014808087740.1017970383824520.0508985191912259
990.954495309566510.0910093808669810.0455046904334905
1000.9487070172020040.1025859655959920.0512929827979962
1010.9388459058952830.1223081882094350.0611540941047174
1020.928192366546020.1436152669079590.0718076334539797
1030.9336666507654820.1326666984690350.0663333492345176
1040.945284550895490.1094308982090200.0547154491045102
1050.9507087448769240.0985825102461530.0492912551230765
1060.9381716155006980.1236567689986040.0618283844993022
1070.9389422948946560.1221154102106870.0610577051053436
1080.9410911192300620.1178177615398770.0589088807699385
1090.9643308016656060.07133839666878760.0356691983343938
1100.972248590175750.05550281964849870.0277514098242494
1110.9697093097151060.06058138056978850.0302906902848942
1120.9781307506124840.04373849877503240.0218692493875162
1130.9702103613337860.05957927733242820.0297896386662141
1140.9610510364921880.07789792701562320.0389489635078116
1150.953866347484890.09226730503021760.0461336525151088
1160.952709220885920.09458155822816170.0472907791140808
1170.9643806897788510.07123862044229790.0356193102211489
1180.955311601714470.08937679657105880.0446883982855294
1190.938554305861940.1228913882761180.0614456941380589
1200.9460075361634950.1079849276730100.0539924638365052
1210.9298700156397920.1402599687204160.0701299843602082
1220.9138363669516360.1723272660967290.0861636330483643
1230.9043399809749540.1913200380500910.0956600190250455
1240.8751486757310810.2497026485378370.124851324268919
1250.8701769738878770.2596460522242460.129823026112123
1260.8813348265224980.2373303469550040.118665173477502
1270.845314807426610.309370385146780.15468519257339
1280.8189685947548540.3620628104902920.181031405245146
1290.8979573234834390.2040853530331220.102042676516561
1300.8949744543354030.2100510913291950.105025545664597
1310.8631957333402570.2736085333194850.136804266659743
1320.8220290587264130.3559418825471740.177970941273587
1330.7695052700204020.4609894599591960.230494729979598
1340.6996334475059870.6007331049880270.300366552494013
1350.6251088120391430.7497823759217130.374891187960856
1360.5819668106942380.8360663786115240.418033189305762
1370.5154334233940280.9691331532119430.484566576605972
1380.5397243234390380.9205513531219230.460275676560962
1390.8708552831321260.2582894337357480.129144716867874
1400.9472698254878220.1054603490243560.052730174512178
1410.911805372106460.1763892557870800.0881946278935399
1420.85427276462530.2914544707493990.145727235374699
1430.7756712602092660.4486574795814680.224328739790734
1440.6250571953959320.7498856092081360.374942804604068


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level310.233082706766917NOK
5% type I error level730.548872180451128NOK
10% type I error level910.68421052631579NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/10twd61291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/10twd61291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/15dgc1291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/15dgc1291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/25dgc1291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/25dgc1291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/3x5yx1291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/3x5yx1291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/4x5yx1291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/4x5yx1291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/5x5yx1291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/5x5yx1291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/6qwx01291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/6qwx01291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/715w31291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/715w31291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/815w31291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/815w31291302380.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/915w31291302380.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/02/t1291302308ta3t4buzzm5x2ys/915w31291302380.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 = 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