Home » date » 2010 » Nov » 23 »

WS7 - Multiple regression model

*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: Tue, 23 Nov 2010 15:49:33 +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/Nov/23/t1290528230dniycisyqzngiq1.htm/, Retrieved Tue, 23 Nov 2010 17:03:53 +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/Nov/23/t1290528230dniycisyqzngiq1.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 «
13 13 14 13 3 2 12 12 8 13 5 1 15 10 12 16 6 0 12 9 7 12 6 3 10 10 10 11 5 3 12 12 7 12 3 1 15 13 16 18 8 3 9 12 11 11 4 1 12 12 14 14 4 4 11 6 6 9 4 0 11 5 16 14 6 3 11 12 11 12 6 2 15 11 16 11 5 4 7 14 12 12 4 3 11 14 7 13 6 1 11 12 13 11 4 1 10 12 11 12 6 2 14 11 15 16 6 3 10 11 7 9 4 1 6 7 9 11 4 1 11 9 7 13 2 2 15 11 14 15 7 3 11 11 15 10 5 4 12 12 7 11 4 2 14 12 15 13 6 1 15 11 17 16 6 2 9 11 15 15 7 2 13 8 14 14 5 4 13 9 14 14 6 2 16 12 8 14 4 3 13 10 8 8 4 3 12 10 14 13 7 3 14 12 14 15 7 4 11 8 8 13 4 2 9 12 11 11 4 2 16 11 16 15 6 4 12 12 10 15 6 3 10 7 8 9 5 4 13 11 14 13 6 2 16 11 16 16 7 5 14 12 13 13 6 3 15 9 5 11 3 1 5 15 8 12 3 1 8 11 10 12 4 1 11 11 8 12 6 2 16 11 13 14 7 3 17 11 15 14 5 9 9 15 6 8 4 0 9 11 12 13 5 0 13 12 16 16 6 2 10 12 5 13 6 2 6 9 15 11 6 3 12 12 12 14 5 1 8 12 8 13 4 2 14 13 13 13 5 0 12 11 14 13 5 5 11 9 12 12 4 2 16 9 16 16 6 4 8 11 10 15 2 3 15 11 15 15 8 0 7 12 8 12 3 0 16 12 16 14 6 4 14 9 19 12 6 1 16 11 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'RServer@AstonUniversity' @ vre.aston.ac.uk


Multiple Linear Regression - Estimated Regression Equation
Popularity[t] = + 0.0342768235376161 + 0.106305539542869FindingFriends[t] + 0.21144283590659KnowingPeople[t] + 0.357652188002145Liked[t] + 0.60600258577461Celebrity[t] + 0.212600241949771Sum_friends[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)0.03427682353761611.4232830.02410.9808180.490409
FindingFriends0.1063055395428690.0955171.1130.2675090.133755
KnowingPeople0.211442835906590.0636263.32320.0011180.000559
Liked0.3576521880021450.0959313.72820.0002730.000136
Celebrity0.606002585774610.1553963.89970.0001457.2e-05
Sum_friends0.2126002419497710.120031.77120.0785540.039277


Multiple Linear Regression - Regression Statistics
Multiple R0.713764528070818
R-squared0.509459801532158
Adjusted R-squared0.49310846158323
F-TEST (value)31.1570674405529
F-TEST (DF numerator)5
F-TEST (DF denominator)150
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.09077045674136
Sum Squared Residuals655.69816541737


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11311.26913522553841.73086477446156
21210.89357760015551.10642239984454
31512.99309677252742.00690322747264
41211.03676902729230.963230972707725
51010.8137483007782-0.813748300778158
6129.112477404697512.88752259530249
71516.7228950081851-1.72289500818515
8910.2065991460963-1.20659914609633
91212.5516849436718-0.551684943671851
10117.583647111352113.41635288864789
111113.2298367682844-2.2298367682844
121111.9888567475975-0.98885674759747
131512.40131109771032.59868890228966
14711.4135057329903-4.41350573299035
151111.5007484291092-0.500748429109224
161110.62948481790950.370515182090486
171011.9888567475975-1.98885674759747
181414.3715315456393-0.37153154563931
19108.539217886922821.46078211307718
2069.25218577656881-3.25218577656881
21118.757810630246212.24218936975379
221514.40843910750520.591560892494814
231111.8322160738016-0.832216073801602
24129.573428044419752.42657195558025
251412.97968003727621.0203199627238
261514.58181697550270.418183024497282
27914.407281701462-5.407281701462
281312.7324653712750.267534628725015
291313.0195730126929-0.0195730126929221
301611.07042768628254.92957231371746
31138.711903479183934.28809652081606
321213.586829191958-1.58682919195803
331414.7273448889978-0.727344888997826
341110.07495309815920.92504690184085
35910.4191993880461-1.41919938804611
361614.43792243549351.56207756450647
371213.0629707176471-1.06297071764709
38109.569241876281850.430758123718145
391312.87453190377650.125468096223485
401615.61417745122010.385822548779949
411412.98199484936261.01800515063743
42158.013022926253586.98697707374642
4359.6428368592327-4.64283685923271
44810.246502958649-2.24650295864902
451111.2482227003348-0.248222700334833
461613.83934408359652.16065591640355
471714.3258260355592.67417396444096
4898.182744779235790.817255220764212
49911.4204431622892-2.42044316228918
501314.476679679139-1.476679679139
511011.0778519201601-1.07785192016008
52612.3706595265428-6.37065952654285
531212.097001131784-0.0970011317839686
54810.5001752563306-2.50017525633063
551411.84449707728152.15550292271849
561212.9063300438512-0.906330043851218
571110.66937779332620.330622206673767
581614.58296354440991.41703645559007
59810.5326548350058-2.53265483500578
601514.58808380333710.411916196662927
6179.11131999865433-2.11131999865433
621614.18657578703431.81342421296575
631413.14888257427180.85111742572819
641613.3772360378312.62276396216897
65910.4319238475608-1.43192384756085
661412.16339202163821.83660797836182
671113.2598285751234-2.25982857512337
681310.32448257624672.67551742375327
691513.19459509131231.80540490868766
7055.79379231622363-0.793792316223628
711512.90633004385122.09366995614878
721312.58859250553770.411407494462274
731112.4170534821838-1.41705348218382
741114.1988134419703-3.19881344197029
751212.77054117632-0.770541176320009
761213.4048805211757-1.40488052117574
771212.3360884510353-0.336088451035269
781211.95077010541650.0492298945835205
791410.85782744433283.14217255566723
8067.93737979501417-1.93737979501417
8179.71847999047212-2.71847999047212
821412.41170990800271.58829009199725
831414.1612461157759-0.161246115775902
841011.1702430827371-1.17024308273712
85139.114792216783873.88520778321613
861212.3066051230469-0.306605123046929
8799.32091315278132-0.320913152781323
881211.92428302811490.0757169718850501
891614.801841451331.19815854866998
901010.460260606642-0.460260606641973
911413.10171712415660.89828287584341
921013.590993685824-3.59099368582399
931615.50788274881310.492117251186851
941513.40371227799661.5962877220034
951211.48914886422980.510851135770238
96109.35967039642680.640329603573206
97810.1222811445894-2.12228114458937
9888.71607881018586-0.71607881018586
991112.6649170753776-1.66491707537759
1001312.55910917754940.440890822450614
1011615.61302004517690.38697995482313
1021614.93878772490441.06121227509559
1031415.4034377281858-1.40343772818584
104119.047233083750511.95276691624949
10547.15683109806287-3.15683109806287
1061414.7389336167413-0.73893361674132
107910.5284903411398-1.52849034113982
1081415.2258845291864-1.22588452918639
109810.2494992093358-2.24949920933583
110810.6827945285774-2.68279452857739
1111111.8843900526982-0.88439005269823
1121213.1604604648793-1.16046046487934
1131111.0755371080737-0.0755371080737151
1141413.27209874146730.727901258532687
1151514.4495111632370.55048883676298
1161613.44478433372842.55521566627157
1171612.9132891474223.08671085257801
1181112.7851369918863-1.78513699188628
1191414.1877331930774-0.187733193077431
1201410.8819888724123.11801112758803
1211211.55854684190680.441453158093245
1221412.54636304376271.45363695623729
123810.8854610905415-2.88546109054151
1241314.0814384906705-1.08143849067053
1251613.97513295112772.02486704887234
1261210.61574387439471.38425612560534
1271615.47839942082480.521600579175191
1281212.7670797953264-0.767079795326432
1291111.4614935437491-0.461493543749085
13046.00799725042713-2.00799725042713
1311616.1162001466741-0.116200146674122
1321512.66424647391312.33575352608689
1331011.3605315783873-1.36053157838729
1341314.0185198189459-1.01851981894586
1351513.12704679541491.87295320458506
1361210.49901785028741.50098214971255
1371413.6562271696350.343772830364979
138710.381134420137-3.38113442013705
1391913.90758465523035.09241534476974
1401212.9450764503607-0.945076450360723
1411211.87281216209070.127187837909297
1421313.3384896313215-0.338489631321529
1431512.41658835187712.58341164812294
14488.84468525889237-0.844685258892367
1451210.92306092814381.07693907185619
1461010.7601143818466-0.760114381846585
147811.2512297881576-3.25122978815761
1481014.6517017577584-4.65170175775841
1491513.86767000554161.13232999445839
1501614.06006083516021.93993916483983
1511313.2702490596877-0.270249059687717
1521615.08383967095680.916160329043211
15399.82245988079266-0.82245988079266
1541413.06064506842480.939354931575244
1551413.15468044162370.845319558376317
1561210.17384524096041.82615475903955


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
90.1130433994221440.2260867988442880.886956600577856
100.05013382791177740.1002676558235550.949866172088223
110.07267912027590120.1453582405518020.927320879724099
120.03629398921487710.07258797842975410.963706010785123
130.4557232195718920.9114464391437840.544276780428108
140.769116895654180.4617662086916410.23088310434582
150.6908433223386920.6183133553226150.309156677661308
160.6024926471737240.7950147056525510.397507352826276
170.5467760851519190.9064478296961630.453223914848081
180.4604837494362230.9209674988724460.539516250563777
190.3839618847202820.7679237694405650.616038115279718
200.681648999560030.6367020008799420.318351000439971
210.6224804753700680.7550390492598650.377519524629932
220.5913843595604930.8172312808790150.408615640439507
230.5217220838680990.9565558322638030.478277916131901
240.505471724232080.989056551535840.49452827576792
250.4666003742831140.9332007485662280.533399625716886
260.4057023431920120.8114046863840240.594297656807988
270.6656525385961270.6686949228077470.334347461403873
280.6092406590240310.7815186819519370.390759340975969
290.5482178057068580.9035643885862840.451782194293142
300.6967292435969230.6065415128061540.303270756403077
310.7967796950251990.4064406099496030.203220304974802
320.7590158307003840.4819683385992320.240984169299616
330.7126324869308850.574735026138230.287367513069115
340.670862179082850.6582756418342990.329137820917149
350.660485468173780.679029063652440.33951453182622
360.6620864751166060.6758270497667870.337913524883394
370.6315670397406520.7368659205186960.368432960259348
380.5814582939711870.8370834120576260.418541706028813
390.5342609186702440.9314781626595110.465739081329756
400.4937529209909910.9875058419819820.506247079009009
410.4610262260658970.9220524521317940.538973773934103
420.7869745799540750.426050840091850.213025420045925
430.944150764127680.1116984717446390.0558492358723195
440.9501602579188950.09967948416221050.0498397420811053
450.9360855693976340.1278288612047310.0639144306023655
460.9429261368532310.1141477262935380.0570738631467692
470.9410155042204510.1179689915590970.0589844957795486
480.9286144569959340.1427710860081320.0713855430040661
490.9282167447691520.1435665104616950.0717832552308476
500.9172115817422630.1655768365154740.0827884182577368
510.9110089431719210.1779821136561570.0889910568280787
520.9881368005063830.02372639898723420.0118631994936171
530.9839156407870940.03216871842581140.0160843592129057
540.9891141881810530.02177162363789320.0108858118189466
550.9916049927321370.01679001453572540.00839500726786271
560.989274817612040.02145036477592180.0107251823879609
570.985510046847790.0289799063044210.0144899531522105
580.9830998248337850.03380035033242940.0169001751662147
590.9897317601582770.0205364796834450.0102682398417225
600.9879167923304770.02416641533904590.0120832076695229
610.9883954728405830.0232090543188330.0116045271594165
620.9881815610111650.0236368779776690.0118184389888345
630.9861950841846150.02760983163076910.0138049158153845
640.9888387174343390.02232256513132220.0111612825656611
650.9879279038055050.02414419238898990.012072096194495
660.9870471864368760.02590562712624870.0129528135631243
670.9876899085261730.02462018294765330.0123100914738266
680.9900355028826320.01992899423473550.00996449711736776
690.9893371327934220.02132573441315530.0106628672065776
700.9862189658359140.0275620683281720.013781034164086
710.9864901484033160.02701970319336880.0135098515966844
720.982042957120470.03591408575905970.0179570428795299
730.9790989610863860.04180207782722830.0209010389136141
740.986222139464540.02755572107091930.0137778605354597
750.9820889389724880.03582212205502320.0179110610275116
760.9793754198191980.04124916036160410.0206245801808021
770.9730638967713460.05387220645730720.0269361032286536
780.9648125466865290.07037490662694210.0351874533134711
790.9767971775259170.04640564494816590.023202822474083
800.9758336570371320.04833268592573540.0241663429628677
810.9796966465752120.04060670684957580.0203033534247879
820.9789508435858160.04209831282836860.0210491564141843
830.9721156473077480.0557687053845040.027884352692252
840.9661591855420550.06768162891589050.0338408144579453
850.9887493606561960.02250127868760720.0112506393438036
860.9850009684572570.02999806308548610.014999031542743
870.9800846270988810.03983074580223720.0199153729011186
880.9741862017701840.05162759645963290.0258137982298164
890.9685426880007010.06291462399859740.0314573119992987
900.9597027456007290.0805945087985420.040297254399271
910.9518277578170310.09634448436593770.0481722421829689
920.9728773979058950.05424520418821040.0271226020941052
930.9648325104257250.0703349791485490.0351674895742745
940.9600134843719680.07997303125606340.0399865156280317
950.949843462806240.1003130743875210.0501565371937603
960.9377078963427230.1245842073145540.0622921036572768
970.9326663289990020.1346673420019960.0673336710009978
980.916412566796770.1671748664064590.0835874332032297
990.9111653818034430.1776692363931150.0888346181965573
1000.8911113366458350.217777326708330.108888663354165
1010.8669461625978430.2661076748043140.133053837402157
1020.8438511403902890.3122977192194230.156148859609711
1030.856407399097920.2871852018041620.143592600902081
1040.8970960783838270.2058078432323460.102903921616173
1050.8991914877777810.2016170244444390.100808512222219
1060.8769145014821860.2461709970356280.123085498517814
1070.8562531297270550.287493740545890.143746870272945
1080.851737827603690.296524344792620.14826217239631
1090.8492406760226680.3015186479546640.150759323977332
1100.8738840206992920.2522319586014160.126115979300708
1110.8620991218746370.2758017562507260.137900878125363
1120.9024246962304320.1951506075391360.0975753037695679
1130.8765287222660060.2469425554679880.123471277733994
1140.8486910473382820.3026179053234360.151308952661718
1150.8139301874578680.3721396250842630.186069812542132
1160.8128092568573180.3743814862853640.187190743142682
1170.825383224190320.349233551619360.17461677580968
1180.8149325031828430.3701349936343130.185067496817156
1190.773355081836850.4532898363263010.226644918163151
1200.8345619402205520.3308761195588960.165438059779448
1210.8046057280695740.3907885438608520.195394271930426
1220.7774115026583010.4451769946833980.222588497341699
1230.7757768662253670.4484462675492660.224223133774633
1240.7342428456112480.5315143087775040.265757154388752
1250.7303588052703450.5392823894593090.269641194729655
1260.7137838632860450.5724322734279110.286216136713955
1270.6581854586856690.6836290826286630.341814541314331
1280.6270213796300420.7459572407399150.372978620369957
1290.6441547884153080.7116904231693830.355845211584692
1300.6387987303957710.7224025392084580.361201269604229
1310.5730707520884010.8538584958231980.426929247911599
1320.5600256200099990.8799487599800030.439974379990001
1330.5277134776274870.9445730447450250.472286522372513
1340.4601172862362310.9202345724724630.539882713763769
1350.433758222992540.867516445985080.56624177700746
1360.4283149547483770.8566299094967540.571685045251623
1370.3559294526942620.7118589053885250.644070547305738
1380.4400521787412310.8801043574824630.559947821258769
1390.7891160615449870.4217678769100260.210883938455013
1400.8113383097895780.3773233804208430.188661690210422
1410.7683123913540740.4633752172918530.231687608645926
1420.684830836244760.630338327510480.31516916375524
1430.642263362748480.715473274503040.35773663725152
1440.5279450142397360.9441099715205280.472054985760264
1450.508045768189990.983908463620020.49195423181001
1460.6727966931690960.6544066136618090.327203306830904
1470.571448072484720.857103855030560.42855192751528


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level320.23021582733813NOK
10% type I error level450.323741007194245NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/10ypum1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/10ypum1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/1sofa1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/1sofa1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/2sofa1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/2sofa1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/32fev1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/32fev1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/42fev1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/42fev1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/52fev1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/52fev1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/6vody1290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/6vody1290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/76xv11290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/76xv11290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/86xv11290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/86xv11290527360.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/96xv11290527360.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290528230dniycisyqzngiq1/96xv11290527360.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