Home » date » 2010 » Nov » 22 »

Multiple Lineair Regression

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Mon, 22 Nov 2010 17:37:46 +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/22/t1290447413tuo5acpe19u37eb.htm/, Retrieved Mon, 22 Nov 2010 18:37:05 +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/22/t1290447413tuo5acpe19u37eb.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 0 14 0 13 0 3 0 12 12 12 8 8 13 13 5 5 15 10 10 12 12 16 16 6 6 12 9 9 7 7 12 12 6 6 10 10 0 10 0 11 0 5 0 12 12 0 7 0 12 0 3 0 15 13 13 16 16 18 18 8 8 9 12 12 11 11 11 11 4 4 12 12 12 14 14 14 14 4 4 11 6 6 6 6 9 9 4 4 11 5 0 16 0 14 0 6 0 11 12 12 11 11 12 12 6 6 15 11 11 16 16 11 11 5 5 7 14 0 12 0 12 0 4 0 11 14 0 7 0 13 0 6 0 11 12 12 13 13 11 11 4 4 10 12 12 11 11 12 12 6 6 14 11 0 15 0 16 0 6 0 10 11 11 7 7 9 9 4 4 6 7 0 9 0 11 0 4 0 11 9 9 7 7 13 13 2 2 15 11 0 14 0 15 0 7 0 11 11 11 15 15 10 10 5 5 12 12 0 7 0 11 0 4 0 14 12 12 15 15 13 13 6 6 15 11 0 17 0 16 0 6 0 9 11 0 15 0 15 0 7 0 13 8 8 14 14 14 14 5 5 13 9 0 14 0 14 0 6 0 16 12 12 8 8 14 14 4 4 13 10 10 8 8 8 8 4 4 12 10 0 14 0 13 0 7 0 14 12 12 14 14 15 15 7 7 11 8 0 8 0 13 0 4 0 9 12 12 11 11 11 11 4 4 16 11 0 16 0 15 0 6 0 12 12 12 10 10 15 15 6 6 10 7 0 8 0 9 0 5 0 13 11 11 14 14 13 13 6 6 16 11 11 16 16 16 16 7 7 14 12 0 13 0 13 0 6 0 15 9 9 5 5 11 11 3 3 5 15 15 8 8 12 12 3 3 8 11 0 10 0 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 time10 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135


Multiple Linear Regression - Estimated Regression Equation
Popularity[t] = + 0.303717782313307 + 0.176147992195911FindingFriends[t] -0.151288107973995`Findingfriends*G`[t] + 0.240478962981778KnowingPeople[t] + 0.0325063503433276`Knowingpeople*G`[t] + 0.215766283815847Liked[t] + 0.219515353217923`Liked*G`[t] + 0.708072246853356Celebrity[t] -0.166549255423799`Celebrity*G`[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.3037177823133071.4156160.21450.8304170.415208
FindingFriends0.1761479921959110.1140941.54390.1247650.062383
`Findingfriends*G`-0.1512881079739950.142194-1.0640.2890920.144546
KnowingPeople0.2404789629817780.1108032.17030.0315880.015794
`Knowingpeople*G`0.03250635034332760.1335190.24350.8079890.403994
Liked0.2157662838158470.140891.53150.1278060.063903
`Liked*G`0.2195153532179230.1745341.25770.2104870.105243
Celebrity0.7080722468533560.2928242.41810.0168260.008413
`Celebrity*G`-0.1665492554237990.345665-0.48180.6306480.315324


Multiple Linear Regression - Regression Statistics
Multiple R0.721556275076144
R-squared0.52064345810176
Adjusted R-squared0.494556027250155
F-TEST (value)19.9576363446204
F-TEST (DF numerator)8
F-TEST (DF denominator)147
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation2.0877829424917
Sum Squared Residuals640.749129399017


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
11310.88952559277112.11047440722889
21211.15219513816390.847804861836061
31514.04178452555140.958215474448622
41210.91087152656891.08912847343113
51010.3837776903313-0.383777690331296
6128.814258575886933.18574142411307
71517.1619146884442-2.16191468844422
8910.5590648126422-1.55906481264216
91212.6838656637188-0.683865663718782
10118.17441566661762.82558433338241
111112.3012826055433-1.30128260554330
121112.0773924325350-1.07739243253504
131512.44065448647532.55934551352468
14711.0770216220410-4.07702162204099
151111.5065375846547-0.506537584654662
161111.1050354392924-0.105035439292366
171012.0773924325350-2.07739243253504
181413.54922416336870.450775836631309
19108.571700401052281.42829959894772
2068.90678250390843-2.90678250390843
21119.180061197884411.81993880211559
221513.80105116342441.19894883657558
231111.7323875361164-0.732387536116447
24129.306564538924432.69343546107557
251413.60461532286920.39538467713077
261514.03018208933220.969817910667754
27914.0415301264062-5.0415301264062
281313.1259491182607-0.125949118260674
291312.52491664836340.475083351636604
301611.04595378376814.95404621623185
31138.38454419312174.6154558068783
321213.1933706035968-1.19337060359682
331414.7437162750412-0.743716275041222
34119.273984100754261.72601589924574
35910.5590648126422-1.55906481264216
361613.57393684253462.42606315746538
371213.1102520303112-1.11025203031124
38108.942843220148311.05715677985169
391313.3067701253222-0.306770125322209
401615.70010865450330.299891345496714
411412.59711537815351.40288462184649
42158.305050288596226.69494971140378
4359.7084471709368-4.7084471709368
44810.0676197194897-2.0676197194897
451111.2335766083378-0.233576608337807
461613.34480591662682.65519408337320
471713.47351408425153.52648591574847
4898.947230701082850.0527692989171527
49912.2192765072424-3.21927650724244
501315.1834455472956-2.18344554729565
511010.8747621896182-0.874762189618176
52612.1180967598976-6.11809675989763
531211.86433045213420.135669547865782
5489.9785760695379-1.97857606953790
551412.06519112349611.93480887650394
561212.7652471338927-0.765247133892652
571111.1927521103353-0.192752110335282
581615.10886589462990.891134105370103
5989.29877407723053-1.29877407723053
601515.5333646955740-0.533364695573968
6179.0547375388687-2.0547375388687
621613.53431855091472.46568144908531
631414.1866952864701-0.186695286470134
641614.17733339938971.82266660061025
65910.0963632218142-1.09636322181421
661412.51712170478951.48287829521054
671112.8623070203012-1.86230702030121
681310.23040306959362.76959693040637
691513.05864469621901.94135530378098
7056.22668143776913-1.22668143776913
711512.76524713389272.23475286610735
721312.51712170478950.482878295210537
731111.4477034969565-0.447703496956529
741112.6437715232232-1.64377152322320
751212.7359396144501-0.735939614450082
761213.6046153228692-1.60461532286923
771212.3796852653027-0.379685265302714
781212.4176821679018-0.417682167901798
791411.04595378376812.95404621623185
8068.11109226315751-2.11109226315751
8179.52233082274028-2.52233082274028
821412.47420375385381.52579624614625
831414.3396297230984-0.339629723098414
841011.4861496726617-1.48614967266165
85138.333300649923374.66669935007663
861212.3170181235518-0.317018123551792
8799.15512922589445-0.155129225894450
881212.7174149310972-0.717414931097212
891615.26037938224890.739620617751137
90109.827140756507920.172859243492077
911413.52067378312310.479326216876903
921013.9043480860646-3.90434808606464
931615.72496853872520.275031461274797
941513.82788086775051.17211913224950
951211.01617092932480.983829070675166
96109.740108872666840.259891127333161
97810.4774774551835-2.47747745518349
9888.55887400045114-0.55887400045114
991111.8564626931300-0.856462693129975
1001312.51267406956880.487325930431191
1011615.97309396782840.0269060321716083
1021615.01670158836630.983298411633672
1031414.9901586335517-0.990158633551675
104119.200473446885671.79952655311433
10546.60092088806472-2.60092088806472
1061414.6534395344260-0.653439534426044
107910.8383853268363-1.83838532683631
1081415.5333646955740-1.53336469557397
109811.0006816505450-3.00068165054497
110811.6299213130174-3.62992131301744
1111112.6296982600543-1.62969826005430
1121214.0466987774111-2.04669877741112
1131111.4207328162684-0.420732816268387
1141413.92920797028660.0707920297134405
1151513.71200751347261.28799248652737
1161613.74205176235602.25794823764402
1171613.76691164657792.23308835342210
1181112.0420194146922-1.04201941469216
1191413.29383958793290.706160412067092
1201410.54857764545333.45142235454674
1211211.70261340003480.297386599965199
1221412.21856574423371.78143425576628
12389.82714075650792-1.82714075650792
1241313.4699875801288-0.46998758012882
1251613.29383958793292.70616041206709
1261211.04150614854750.958493851452505
1271615.72052090350450.279479096495450
1281213.6046153228692-1.60461532286923
1291112.0340078649603-1.03400786496025
13046.04772724989257-2.04772724989257
1311615.72052090350450.279479096495450
1321512.7607994986722.239200501328
1331011.9165170578357-1.91651705783569
1341313.4080972278583-0.408097227858265
1351512.81288166196942.18711833803065
1361210.88365746005951.11634253994052
1371413.1176915957370.882308404263004
138710.9987940848966-3.99879408489658
1391914.47517859693684.52482140306323
1401213.1756688867045-1.17566888670451
1411211.72625978119620.273740218803786
1421313.0533606249511-0.0533606249511303
1431513.55442893778631.44557106221368
14488.59687402439871-0.596874024398706
1451211.15664277338460.84335722661541
1461010.6266367605150-0.626636760514988
147810.9024146002071-2.90241460020711
1481014.0380498483365-4.03804984833649
1491513.35817055871881.64182944128123
1501614.73926863982061.26073136017943
1511313.3023224901016-0.302322490101555
1521615.45198322540010.548016774599902
153910.4235159388038-1.42351593880380
1541412.43587299841161.5641270015884
1551412.44568006512351.55431993487648
1561210.75700385666241.24299614333756


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
120.01488464407694420.02976928815388840.985115355923056
130.2703671719343650.540734343868730.729632828065635
140.4527385804225790.9054771608451580.547261419577421
150.3890445580714670.7780891161429340.610955441928533
160.2763159441352120.5526318882704240.723684055864788
170.2352004798822940.4704009597645890.764799520117706
180.2043402230347560.4086804460695120.795659776965244
190.1735040751253190.3470081502506390.82649592487468
200.5925408901199070.8149182197601850.407459109880093
210.5149150205531540.9701699588936930.485084979446846
220.6280948018322650.743810396335470.371905198167735
230.553254968827020.893490062345960.44674503117298
240.5353153954329620.9293692091340760.464684604567038
250.4681265792537630.9362531585075250.531873420746237
260.4500525184772590.9001050369545190.549947481522741
270.5721643993664480.8556712012671040.427835600633552
280.5152452815314330.9695094369371330.484754718468567
290.472567890599770.945135781199540.52743210940023
300.6566232233024660.6867535533950670.343376776697534
310.7919575860157670.4160848279684670.208042413984233
320.7691046398115980.4617907203768030.230895360188402
330.720160708768080.559678582463840.27983929123192
340.6826635790729780.6346728418540440.317336420927022
350.6850764295376260.6298471409247480.314923570462374
360.7456226517233020.5087546965533970.254377348276698
370.7201439664532380.5597120670935230.279856033546762
380.6793122967624850.641375406475030.320687703237515
390.6253909114208160.7492181771583680.374609088579184
400.5809552401678080.8380895196643830.419044759832192
410.576153079767350.84769384046530.42384692023265
420.8362941211961820.3274117576076350.163705878803818
430.9449396009451460.1101207981097080.0550603990548541
440.9548753701394150.09024925972116980.0451246298605849
450.942230988252420.1155380234951620.0577690117475809
460.959817509978170.08036498004366170.0401824900218309
470.974387910617410.05122417876518190.0256120893825910
480.966174702496470.06765059500706070.0338252975035304
490.9792473741582650.04150525168347080.0207526258417354
500.9797796748165920.04044065036681610.0202203251834080
510.9740274054715020.0519451890569960.025972594528498
520.9968602859327670.006279428134465160.00313971406723258
530.9954297968808360.009140406238328780.00457020311916439
540.9965020204015080.00699595919698380.0034979795984919
550.9966285506925150.006742898614970840.00337144930748542
560.995395103728970.009209792542060520.00460489627103026
570.9938435887747360.01231282245052880.00615641122526438
580.9917338967288220.01653220654235650.00826610327117827
590.9917599546532130.01648009069357360.00824004534678678
600.988819019241960.02236196151607910.0111809807580395
610.98930087567180.02139824865639880.0106991243281994
620.991622278616690.0167554427666220.008377721383311
630.9884398118179060.02312037636418730.0115601881820937
640.9872750091196050.02544998176078910.0127249908803945
650.9854640034734480.02907199305310380.0145359965265519
660.9831241200316120.03375175993677540.0168758799683877
670.9827300087191380.03453998256172510.0172699912808625
680.9862438873652430.02751222526951430.0137561126347572
690.9860933865054740.02781322698905310.0139066134945265
700.9832648737004250.0334702525991490.0167351262995745
710.9839528330052620.03209433398947560.0160471669947378
720.9787435118921710.04251297621565720.0212564881078286
730.9721556745489580.05568865090208460.0278443254510423
740.9700495653143580.05990086937128430.0299504346856422
750.962169496051840.07566100789631960.0378305039481598
760.957952784366730.08409443126654040.0420472156332702
770.9470087504446860.1059824991106270.0529912495553137
780.9355095154968030.1289809690063940.0644904845031971
790.9496981816432630.1006036367134750.0503018183567374
800.9523588343971140.09528233120577270.0476411656028863
810.9566839614351840.0866320771296320.043316038564816
820.9564392914338660.08712141713226780.0435607085661339
830.9447752170187130.1104495659625750.0552247829812873
840.9374920914450420.1250158171099160.0625079085549582
850.9901641325549690.01967173489006290.00983586744503145
860.986916375408940.026167249182120.01308362459106
870.9829291579271170.0341416841457660.017070842072883
880.980118783136350.03976243372730170.0198812168636508
890.9746533693279580.05069326134408480.0253466306720424
900.9691862847457680.06162743050846470.0308137152542324
910.9614373589685180.07712528206296440.0385626410314822
920.9827077549852260.03458449002954820.0172922450147741
930.9766961602740050.04660767945198930.0233038397259947
940.9722359677530820.05552806449383560.0277640322469178
950.9666698588905350.06666028221892920.0333301411094646
960.9560377448747220.08792451025055650.0439622551252783
970.954146382685920.09170723462816030.0458536173140801
980.9515851828001780.09682963439964470.0484148171998223
990.9499505117157050.1000989765685900.0500494882842949
1000.9358400184721080.1283199630557840.0641599815278922
1010.917727832899840.1645443342003200.0822721671001602
1020.9013721022467940.1972557955064120.0986278977532062
1030.9003795683075310.1992408633849390.0996204316924694
1040.9136384717672180.1727230564655630.0863615282327816
1050.921603936191390.1567921276172200.0783960638086098
1060.9050805349804560.1898389300390870.0949194650195436
1070.8944292098173690.2111415803652620.105570790182631
1080.8893139239512460.2213721520975080.110686076048754
1090.9035140034915310.1929719930169380.0964859965084689
1100.9308528087761040.1382943824477910.0691471912238956
1110.9268025280123150.1463949439753690.0731974719876846
1120.94418472472610.11163055054780.0558152752739
1130.926193338971520.1476133220569600.0738066610284801
1140.9044644041520220.1910711916959560.095535595847978
1150.8808716309881220.2382567380237560.119128369011878
1160.8767089610817780.2465820778364430.123291038918222
1170.8815944114969690.2368111770060620.118405588503031
1180.8550648879726630.2898702240546730.144935112027337
1190.8205925612535140.3588148774929710.179407438746486
1200.9414427364983560.1171145270032870.0585572635016436
1210.922378370118890.1552432597622190.0776216298811095
1220.9037881758718540.1924236482562920.096211824128146
1230.8880669446652870.2238661106694250.111933055334713
1240.8556153123627760.2887693752744480.144384687637224
1250.8547420739122060.2905158521755880.145257926087794
1260.8255316196835130.3489367606329730.174468380316487
1270.7799376886074890.4401246227850220.220062311392511
1280.7719102692092070.4561794615815850.228089730790793
1290.7740909062170910.4518181875658180.225909093782909
1300.7339777155270720.5320445689458550.266022284472928
1310.6859451937916640.6281096124166730.314054806208336
1320.6648659010287450.6702681979425090.335134098971255
1330.7658093702059230.4683812595881550.234190629794077
1340.704462400820870.5910751983582600.295537599179130
1350.7364813173491520.5270373653016960.263518682650848
1360.7015959302490420.5968081395019170.298404069750958
1370.6221070425301140.7557859149397720.377892957469886
1380.7469059054948730.5061881890102540.253094094505127
1390.962080418210850.07583916357830240.0379195817891512
1400.9915645841162660.01687083176746760.0084354158837338
1410.9878628445434670.02427431091306620.0121371554565331
1420.9671729346322970.06565413073540550.0328270653677028
1430.9187531708005330.1624936583989330.0812468291994665
1440.8334721400866620.3330557198266770.166527859913338


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level50.037593984962406NOK
5% type I error level320.240601503759398NOK
10% type I error level540.406015037593985NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/10kl1t1290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/10kl1t1290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/1dk4h1290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/1dk4h1290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/26b321290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/26b321290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/36b321290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/36b321290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/46b321290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/46b321290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/5z3l51290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/5z3l51290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/6z3l51290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/6z3l51290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/7rckq1290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/7rckq1290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/8rckq1290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/8rckq1290447455.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/9kl1t1290447455.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/22/t1290447413tuo5acpe19u37eb/9kl1t1290447455.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